Skip to contentSkip to conversation

gentoo diff for dhcpd

PATCH petre rodan 2 participants 2 messages Nov 21, 2004 – Nov 23, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

added needed capabilities
sys_chroot-related file locations

bye,
peter

Signature · 4 lines
petre rodan
<[email protected]>
Developer,
Hardened Gentoo Linux
root/cvs/cvs.gentoo.org/gentoo-projects/selinux/dhcp/dhcpd.fc renamed from root/public_html/policy/nsa/file_contexts/program/dhcpd.fc +24 -0
@@ -8,3 +8,27 @@
 /var/lib/dhcp(3)?	-d	system_u:object_r:dhcp_state_t
 define(`dhcp_defined')
 ')
+
+ifdef(`distro_gentoo', `
+/etc/dhcp			-d	system_u:object_r:dhcp_etc_t
+/etc/dhcp(/.*)?			--	system_u:object_r:dhcp_etc_t
+/var/lib/dhcp			-d 	system_u:object_r:dhcp_state_t
+/var/lib/dhcp/dhcpd\.leases.* 	--	system_u:object_r:dhcpd_state_t
+/var/run/dhcp/dhcpd\.pid     	--	system_u:object_r:dhcpd_var_run_t
+
+# for the chroot setup
+/chroot						-d	system_u:object_r:root_t
+/chroot/dhcp					-d	system_u:object_r:root_t
+/chroot/dhcp/dev				-d	system_u:object_r:device_t
+/chroot/dhcp/etc				-d	system_u:object_r:etc_t
+/chroot/dhcp/etc/dhcp               -d  system_u:object_r:dhcp_etc_t
+/chroot/dhcp/etc/dhcp(/.*)?         --  system_u:object_r:dhcp_etc_t
+/chroot/dhcp/usr/sbin/dhcpd         --  system_u:object_r:dhcpd_exec_t
+/chroot/dhcp/var				-d	system_u:object_r:var_t
+/chroot/dhcp/var/run				-d	system_u:object_r:var_run_t
+/chroot/dhcp/var/lib				-d	system_u:object_r:var_lib_t
+/chroot/dhcp/var/lib/dhcp			-d	system_u:object_r:dhcp_state_t
+/chroot/dhcp/var/lib/dhcp/dhcpd\.leases.*	--	system_u:object_r:dhcpd_state_t
+/chroot/dhcp/var/run/dhcp/dhcpd\.pid     	--	system_u:object_r:dhcpd_state_t
+')
+
root/cvs/cvs.gentoo.org/gentoo-projects/selinux/dhcp/dhcpd.te renamed from root/public_html/policy/nsa/domains/program/unused/dhcpd.te +5 -0
@@ -67,3 +67,8 @@
 # allow reading /proc
 allow dhcpd_t proc_t:{ file lnk_file } r_file_perms;
 tmp_domain(dhcpd)
+
+ifdef(`distro_gentoo', `
+allow dhcpd_t self:capability { chown dac_override setgid setuid sys_chroot };
+allow initrc_t dhcpd_state_t:file setattr;
+')
#1 lore raw

Merged. I removed the '/chroot' line. It will already be labeled with root_t and it doesn't pertain to the dhcp stuff anyway.

root/cvs/cvs.gentoo.org/gentoo-projects/selinux/dhcp/dhcpd.fc 2004-11-19 10:35:55.000000000 +0200 renamed from root/public_html/policy/nsa/file_contexts/program/dhcpd.fc 2004-11-19 10:48:10.000000000 +0200 +24 -0
@@ -8,3 +8,27 @@
 /var/lib/dhcp(3)?      -d      system_u:object_r:dhcp_state_t
 define(`dhcp_defined')
 ')
+
+ifdef(`distro_gentoo', `
+/etc/dhcp                      -d      system_u:object_r:dhcp_etc_t
+/etc/dhcp(/.*)?                        --      system_u:object_r:dhcp_etc_t
+/var/lib/dhcp                  -d      system_u:object_r:dhcp_state_t
+/var/lib/dhcp/dhcpd\.leases.*  --      system_u:object_r:dhcpd_state_t
+/var/run/dhcp/dhcpd\.pid       --      system_u:object_r:dhcpd_var_run_t
+
+# for the chroot setup
+/chroot                                                -d      system_u:object_r:root_t
+/chroot/dhcp                                   -d      system_u:object_r:root_t
+/chroot/dhcp/dev                               -d      system_u:object_r:device_t
+/chroot/dhcp/etc                               -d      system_u:object_r:etc_t
+/chroot/dhcp/etc/dhcp               -d  system_u:object_r:dhcp_etc_t
+/chroot/dhcp/etc/dhcp(/.*)?         --  system_u:object_r:dhcp_etc_t
+/chroot/dhcp/usr/sbin/dhcpd         --  system_u:object_r:dhcpd_exec_t
+/chroot/dhcp/var                               -d      system_u:object_r:var_t
+/chroot/dhcp/var/run                           -d      system_u:object_r:var_run_t
+/chroot/dhcp/var/lib                           -d      system_u:object_r:var_lib_t
+/chroot/dhcp/var/lib/dhcp                      -d      system_u:object_r:dhcp_state_t
+/chroot/dhcp/var/lib/dhcp/dhcpd\.leases.*      --      system_u:object_r:dhcpd_state_t
+/chroot/dhcp/var/run/dhcp/dhcpd\.pid           --      system_u:object_r:dhcpd_state_t
+')
+
Quoted 5 lines · petre rodan

added needed capabilities
sys_chroot-related file locations

bye,
peter

Signature · 7 lines
James Carter <[email protected]>
National Security Agency

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.