Skip to contentSkip to conversation

initrc.te

PATCH Russell Coker 2 participants 2 messages Jul 11, 2004 – Jul 12, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This patch moves all the Red Hat specific stuff to one place, causes files the administrator creates under the root directory to have type etc_runtime_t (for /halt) and does not permit stat'ing device nodes of types that are used for files.

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page
domains/program/initrc.te renamed from usr/src/se/policy/domains/program/initrc.te +17 -19
diff -ru /usr/src/se/policy/domains/program/initrc.te ./domains/program/initrc.te
@@ -176,8 +176,8 @@
 allow initrc_t device_t:lnk_file read;
 
 # Stat any file.
-allow initrc_t file_type:file_class_set getattr;
-allow initrc_t file_type:dir { search getattr };
+allow initrc_t file_type:notdevfile_class_set getattr;
+allow initrc_t file_type:dir { search getattr };
 
 # Read and write console and ttys.
 allow initrc_t devtty_t:chr_file rw_file_perms;
@@ -195,6 +195,20 @@
 # Redhat systems typically create this file at boot time.
 allow initrc_t boot_t:lnk_file rw_file_perms;
 file_type_auto_trans(initrc_t, boot_t, boot_runtime_t, file)
+
+#
+# readahead asks for these
+#
+allow initrc_t etc_aliases_t:file { getattr read };
+allow initrc_t system_cron_spool_t:file { getattr read };
+allow initrc_t var_lib_nfs_t:file { getattr read };
+
+# for /halt /.autofsck and other flag files
+file_type_auto_trans({ initrc_t sysadm_t }, root_t, etc_runtime_t, file)
+
+# Access /var/lib/rpm.
+allow initrc_t var_lib_rpm_t:dir rw_dir_perms;
+allow initrc_t var_lib_rpm_t:file create_file_perms;
 ')
 
 allow initrc_t system_map_t:{ file lnk_file } r_file_perms;
@@ -218,15 +232,6 @@
 allow initrc_t sound_device_t:chr_file { setattr ioctl read write };
 ifdef(`sound.te', `allow initrc_t sound_file_t:file { setattr write };')
 
-ifdef(`rpm.te', `
-# for /halt /.autofsck and other flag files
-file_type_auto_trans(initrc_t, root_t, etc_runtime_t, file)
-
-# Access /var/lib/rpm.
-allow initrc_t var_lib_rpm_t:dir rw_dir_perms;
-allow initrc_t var_lib_rpm_t:file create_file_perms;
-')
-
 ifdef(`apmd.te',
 `# Access /dev/apm_bios.
 allow initrc_t apm_bios_t:chr_file { setattr getattr };')
@@ -287,7 +292,6 @@
 ')
 
 # for lsof in shutdown scripts
-allow initrc_t security_t:dir getattr;
 allow initrc_t krb5_conf_t:file read;
 dontaudit initrc_t krb5_conf_t:file write;
 #
@@ -303,13 +307,7 @@
 unconfined_domain(initrc_t) 
 ')
 #
-# readahead asks for these
-#
-allow initrc_t etc_aliases_t:file { getattr read };
-allow initrc_t system_cron_spool_t:file { getattr read };
-allow initrc_t var_lib_nfs_t:file { getattr read };
-#
 # initrc script does a cat /selinux/enforce
 #
-allow initrc_t security_t:dir { search };
+allow initrc_t security_t:dir { getattr search };
 allow initrc_t security_t:file { getattr read };
#1 lore raw
Quoted 4 lines · Russell Coker

This patch moves all the Red Hat specific stuff to one place, causes files the administrator creates under the root directory to have type etc_runtime_t (for /halt) and does not permit stat'ing device nodes of types that are used for files.

Thanks, merged.

Signature · 8 lines
Stephen Smalley <[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.