summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2014-04-24 03:02:52 -0400
committerJoe MacDonald <joe@deserted.net>2014-04-24 19:52:40 -0400
commit2d5d3d861cf0468c05f45727ab16a9c626847e85 (patch)
treefe76814244b7ecb1dc206566c18c3ff72d998a53
parent002a8bef46b03e339dd1212b4070d9979773bef1 (diff)
downloadmeta-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.conf17
-rw-r--r--recipes-security/refpolicy/files/setrans-mls.conf52
-rw-r--r--recipes-security/refpolicy/refpolicy_common.inc8
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
15s0=SystemLow
16s0-s0:c0.c1023=SystemLow-SystemHigh
17s0: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
19s0=SystemLow
20s15:c0.c1023=SystemHigh
21s0-s15:c0.c1023=SystemLow-SystemHigh
22
23# Unclassified level
24s1=Unclassified
25
26# Secret level with compartments
27s2=Secret
28s2:c0=A
29s2:c1=B
30
31# ranges for Unclassified
32s0-s1=SystemLow-Unclassified
33s1-s2=Unclassified-Secret
34s1-s15:c0.c1023=Unclassified-SystemHigh
35
36# ranges for Secret with compartments
37s0-s2=SystemLow-Secret
38s0-s2:c0=SystemLow-Secret:A
39s0-s2:c1=SystemLow-Secret:B
40s0-s2:c0,c1=SystemLow-Secret:AB
41s1-s2:c0=Unclassified-Secret:A
42s1-s2:c1=Unclassified-Secret:B
43s1-s2:c0,c1=Unclassified-Secret:AB
44s2-s2:c0=Secret-Secret:A
45s2-s2:c1=Secret-Secret:B
46s2-s2:c0,c1=Secret-Secret:AB
47s2-s15:c0.c1023=Secret-SystemHigh
48s2:c0-s2:c0,c1=Secret:A-Secret:AB
49s2:c0-s15:c0.c1023=Secret:A-SystemHigh
50s2:c1-s2:c0,c1=Secret:B-Secret:AB
51s2:c1-s15:c0.c1023=Secret:B-SystemHigh
52s2: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
9SRC_URI += "file://customizable_types \ 9SRC_URI += "file://customizable_types \
10 file://setrans-mls.conf \
11 file://setrans-mcs.conf \
10 " 12 "
11 13
12S = "${WORKDIR}/refpolicy" 14S = "${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