Skip to contentSkip to conversation

refpolicy HEAD, patch for Debian logs of syslog rotation

PATCH Václav Ovsík 2 participants 2 messages Dec 11, 2007 – Dec 12, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,
there is another change for the refpolicy, so the Debian system can run /etc/cron.daily/sysklogd successfully. This is rotation for logs parsed from syslog.conf config file. Script /usr/sbin/syslogd-listfiles lists logs, that needs rotation. Logs are rotated using script /usr/bin/savelog then.

Without attached patch domain logrotate_t is not allowed to read syslog_conf_t and following denials are generated:

audit(1197384508.149:3): avc:  denied  { read } for  pid=1589 comm="syslogd-listfil" name="syslog.conf" dev=sda1 ino=213265 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:syslog_conf_t:s0 tclass=file
audit(1197384508.149:4): avc:  denied  { ioctl } for  pid=1589 comm="syslogd-listfil" name="syslog.conf" dev=sda1 ino=213265 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:syslog_conf_t:s0 tclass=file
audit(1197384508.149:5): avc:  denied  { getattr } for  pid=1589 comm="syslogd-listfil" name="syslog.conf" dev=sda1 ino=213265 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:syslog_conf_t:s0 tclass=file

Can be changes applied?
Thanks

Signature · 1 line
Zito
modules/system/logging.if +19 -0
Index: policy/modules/system/logging.if
===================================================================
@@ -663,6 +663,25 @@
 
 ########################################
 ## <summary>
+##	Read syslog_conf_t file.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`logging_read_syslog_conf',`
+	gen_require(`
+		type syslog_conf_t;
+	')
+
+	allow $1 syslog_conf_t:file read_file_perms;
+')
+
+########################################
+## <summary>
 ##	All of the rules required to administrate
 ##	the audit environment
 ## </summary>
modules/admin/logrotate.te +5 -0
Index: policy/modules/admin/logrotate.te
===================================================================
@@ -108,6 +108,11 @@
 # cjp: why is this needed?
 logging_exec_all_logs(logrotate_t)
 
+ifdef(`distro_debian', `
+	# for syslogd-listfiles
+	logging_read_syslog_conf(logrotate_t)
+')
+
 libs_use_ld_so(logrotate_t)
 libs_use_shared_libs(logrotate_t)
 
#1 lore raw
Quoted 6 lines · Václav Ovsík

there is another change for the refpolicy, so the Debian system can run /etc/cron.daily/sysklogd successfully. This is rotation for logs parsed from syslog.conf config file. Script /usr/sbin/syslogd-listfiles lists logs, that needs rotation. Logs are rotated using script /usr/bin/savelog then.

Quoted 6 lines

Without attached patch domain logrotate_t is not allowed to read syslog_conf_t and following denials are generated:

audit(1197384508.149:3): avc:  denied  { read } for  pid=1589 comm="syslogd-listfil" name="syslog.conf" dev=sda1 ino=213265 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:syslog_conf_t:s0 tclass=file
audit(1197384508.149:4): avc:  denied  { ioctl } for  pid=1589 comm="syslogd-listfil" name="syslog.conf" dev=sda1 ino=213265 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:syslog_conf_t:s0 tclass=file
audit(1197384508.149:5): avc:  denied  { getattr } for  pid=1589 comm="syslogd-listfil" name="syslog.conf" dev=sda1 ino=213265 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:syslog_conf_t:s0 tclass=file

Merged. I renamed the interface and moved the te file change lower to the preexisting distro_debian block.

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.