Skip to contentSkip to conversation

crond_log_t

PATCH Russell Coker 2 participants 2 messages May 16, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

What is the point of the type crond_log_t?

It's been in the policy for ages but I don't recall any time at which it had a purpose.

/var/log/cron* are the only files to get that type according to the file contexts. /var/log/cron* files need no special protection and they are written by syslogd (which usually writes files with type var_log_t). If we are going to apply some special protection to syslogd output then we should probably start with /var/log/secure...

crond.te allows crond_t and system_crond_t to write to crond_log_t. If we only have one file on the system that is a candidate for writing with that label then having system_crond_t, crond_t, and syslogd_t fighting over who gets to write to it seems like a bad idea.

I suggest the attached patch as the solution to this problem.

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/crond.te +0 -5
diff -ru orig/domains/program/crond.te new/domains/program/crond.te
@@ -43,8 +43,6 @@
 
 read_locale(crond_t)
 
-log_domain(crond)
-
 # Use capabilities.
 allow crond_t self:capability { dac_override setgid setuid net_bind_service sys_nice };
 dontaudit crond_t self:capability sys_resource;
@@ -103,9 +101,6 @@
 # Still need to study anacron.
 domain_auto_trans(initrc_t, anacron_exec_t, system_crond_t)
 
-# Access log files
-file_type_auto_trans(system_crond_t, var_log_t, crond_log_t, file)
-
 # Inherit and use descriptors from init for anacron.
 allow system_crond_t init_t:fd use;
 
domains/program/syslogd.te +0 -2
diff -ru orig/domains/program/syslogd.te new/domains/program/syslogd.te
@@ -64,8 +64,6 @@
 allow privlog devlog_t:lnk_file read;
 
 ifdef(`crond.te', `
-# Write to the cron log.
-allow syslogd_t crond_log_t:file rw_file_perms;
 # for daemon re-start
 allow system_crond_t syslogd_t:lnk_file read;
 ')
file_contexts/program/crond.fc +0 -1
diff -ru orig/file_contexts/program/crond.fc new/file_contexts/program/crond.fc
@@ -9,7 +9,6 @@
 /var/spool/cron/crontabs/root -- system_u:object_r:sysadm_cron_spool_t
 /var/spool/cron/root	--	system_u:object_r:sysadm_cron_spool_t
 /var/spool/cron/[^/]*	--	<<none>>
-/var/log/cron.*		--	system_u:object_r:crond_log_t
 /var/run/crond\.reboot	--	system_u:object_r:crond_var_run_t
 /var/run/crond?\.pid	--	system_u:object_r:crond_var_run_t
 # fcron
types/file.te +1 -0
diff -ru orig/types/file.te new/types/file.te
@@ -188,6 +188,7 @@
 #
 type var_run_t, file_type, sysadmfile;
 type var_log_t, file_type, sysadmfile, logfile;
+typealias var_log_t alias crond_log_t;
 type faillog_t, file_type, sysadmfile, logfile;
 type var_lock_t, file_type, sysadmfile, lockfile;
 type var_lib_t, file_type, sysadmfile;
#1 lore raw

dead types (was: crond_log_t)

Quoted 4 lines · Russell Coker

What is the point of the type crond_log_t?

It's been in the policy for ages but I don't recall any time at which it had a purpose.

Speaking of dead types, while looking around, I found that lvm_vg_t has no rules (other then those implied by it's attributes). I'm not very familiar with LVM, but from what I'm guessing, it was used for LVM volume group device nodes. However, these are treated in exactly the same was as fixed_disk_device_t, so at some point the rules were switched over to fixed_disk_device_t, but lvm_vg_t was not deleted. There are no file context entries for this type.

Udev_runtime_t seems to be a copy of udev_tbl_t, based on the description in types/file.te. Only hotplug and initrc have access to this type. It also has no file context entries.

Signature · 10 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150



--
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.