diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2014-04-24 03:02:52 -0400 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2014-04-24 19:52:40 -0400 |
commit | 2d5d3d861cf0468c05f45727ab16a9c626847e85 (patch) | |
tree | fe76814244b7ecb1dc206566c18c3ff72d998a53 | |
parent | 002a8bef46b03e339dd1212b4070d9979773bef1 (diff) | |
download | meta-selinux-2d5d3d861cf0468c05f45727ab16a9c626847e85.tar.gz |
refpolicy: add setrans.conf for mcs/mls policy
Add initial version for setrans.conf:
- setrans-mls.conf: copied from \
policycoreutils/mcstrans/share/examples/default/setrans.conf
- setrans-mcs.conf: copied from radhat policy.
This fixes below issue:
$ chcat -L
IOError: No such file or directory: \
'/etc/selinux/$POLICY_NAME/setrans.conf'
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/refpolicy/files/setrans-mcs.conf | 17 | ||||
-rw-r--r-- | recipes-security/refpolicy/files/setrans-mls.conf | 52 | ||||
-rw-r--r-- | recipes-security/refpolicy/refpolicy_common.inc | 8 |
3 files changed, 77 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/files/setrans-mcs.conf b/recipes-security/refpolicy/files/setrans-mcs.conf new file mode 100644 index 0000000..0ac9c90 --- /dev/null +++ b/recipes-security/refpolicy/files/setrans-mcs.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | # | ||
2 | # Multi-Category Security translation table for SELinux | ||
3 | # | ||
4 | # | ||
5 | # Objects can be categorized with 0-1023 categories defined by the admin. | ||
6 | # Objects can be in more than one category at a time. | ||
7 | # Categories are stored in the system as c0-c1023. Users can use this | ||
8 | # table to translate the categories into a more meaningful output. | ||
9 | # Examples: | ||
10 | # s0:c0=CompanyConfidential | ||
11 | # s0:c1=PatientRecord | ||
12 | # s0:c2=Unclassified | ||
13 | # s0:c3=TopSecret | ||
14 | # s0:c1,c3=CompanyConfidentialRedHat | ||
15 | s0=SystemLow | ||
16 | s0-s0:c0.c1023=SystemLow-SystemHigh | ||
17 | s0:c0.c1023=SystemHigh | ||
diff --git a/recipes-security/refpolicy/files/setrans-mls.conf b/recipes-security/refpolicy/files/setrans-mls.conf new file mode 100644 index 0000000..eb181d2 --- /dev/null +++ b/recipes-security/refpolicy/files/setrans-mls.conf | |||
@@ -0,0 +1,52 @@ | |||
1 | # | ||
2 | # Multi-Level Security translation table for SELinux | ||
3 | # | ||
4 | # Uncomment the following to disable translation libary | ||
5 | # disable=1 | ||
6 | # | ||
7 | # Objects can be labeled with one of 16 levels and be categorized with 0-1023 | ||
8 | # categories defined by the admin. | ||
9 | # Objects can be in more than one category at a time. | ||
10 | # Users can modify this table to translate the MLS labels for different purpose. | ||
11 | # | ||
12 | # Assumptions: using below MLS labels. | ||
13 | # SystemLow | ||
14 | # SystemHigh | ||
15 | # Unclassified | ||
16 | # Secret with compartments A and B. | ||
17 | # | ||
18 | # SystemLow and SystemHigh | ||
19 | s0=SystemLow | ||
20 | s15:c0.c1023=SystemHigh | ||
21 | s0-s15:c0.c1023=SystemLow-SystemHigh | ||
22 | |||
23 | # Unclassified level | ||
24 | s1=Unclassified | ||
25 | |||
26 | # Secret level with compartments | ||
27 | s2=Secret | ||
28 | s2:c0=A | ||
29 | s2:c1=B | ||
30 | |||
31 | # ranges for Unclassified | ||
32 | s0-s1=SystemLow-Unclassified | ||
33 | s1-s2=Unclassified-Secret | ||
34 | s1-s15:c0.c1023=Unclassified-SystemHigh | ||
35 | |||
36 | # ranges for Secret with compartments | ||
37 | s0-s2=SystemLow-Secret | ||
38 | s0-s2:c0=SystemLow-Secret:A | ||
39 | s0-s2:c1=SystemLow-Secret:B | ||
40 | s0-s2:c0,c1=SystemLow-Secret:AB | ||
41 | s1-s2:c0=Unclassified-Secret:A | ||
42 | s1-s2:c1=Unclassified-Secret:B | ||
43 | s1-s2:c0,c1=Unclassified-Secret:AB | ||
44 | s2-s2:c0=Secret-Secret:A | ||
45 | s2-s2:c1=Secret-Secret:B | ||
46 | s2-s2:c0,c1=Secret-Secret:AB | ||
47 | s2-s15:c0.c1023=Secret-SystemHigh | ||
48 | s2:c0-s2:c0,c1=Secret:A-Secret:AB | ||
49 | s2:c0-s15:c0.c1023=Secret:A-SystemHigh | ||
50 | s2:c1-s2:c0,c1=Secret:B-Secret:AB | ||
51 | s2:c1-s15:c0.c1023=Secret:B-SystemHigh | ||
52 | s2:c0,c1-s15:c0.c1023=Secret:AB-SystemHigh | ||
diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc index fbf9441..76c3efb 100644 --- a/recipes-security/refpolicy/refpolicy_common.inc +++ b/recipes-security/refpolicy/refpolicy_common.inc | |||
@@ -7,6 +7,8 @@ LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833" | |||
7 | 7 | ||
8 | # Specific config files for Poky | 8 | # Specific config files for Poky |
9 | SRC_URI += "file://customizable_types \ | 9 | SRC_URI += "file://customizable_types \ |
10 | file://setrans-mls.conf \ | ||
11 | file://setrans-mcs.conf \ | ||
10 | " | 12 | " |
11 | 13 | ||
12 | S = "${WORKDIR}/refpolicy" | 14 | S = "${WORKDIR}/refpolicy" |
@@ -109,6 +111,12 @@ EOF | |||
109 | cat ${WORKDIR}/customizable_types >> \ | 111 | cat ${WORKDIR}/customizable_types >> \ |
110 | ${D}${sysconfdir}/selinux/${POLICY_NAME}/contexts/customizable_types | 112 | ${D}${sysconfdir}/selinux/${POLICY_NAME}/contexts/customizable_types |
111 | 113 | ||
114 | # install setrans.conf for mls/mcs policy | ||
115 | if [ -f ${WORKDIR}/setrans-${POLICY_TYPE}.conf ]; then | ||
116 | install -m 0644 ${WORKDIR}/setrans-${POLICY_TYPE}.conf \ | ||
117 | ${D}${sysconfdir}/selinux/${POLICY_NAME}/setrans.conf | ||
118 | fi | ||
119 | |||
112 | # install policy headers | 120 | # install policy headers |
113 | oe_runmake install-headers DESTDIR=${D} | 121 | oe_runmake install-headers DESTDIR=${D} |
114 | 122 | ||