Description of problem: SELinux blocks write acces to /var/log/ for cgrulesengd. Here are the audit messages: node=alphstein type=AVC msg=audit(1290419683.646:25322): avc: denied { write } for pid=4517 comm="cgrulesengd" name="log" dev=dm-1 ino=129512 scontext=unconfined_u:system_r:cgred_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir node=alphstein type=SYSCALL msg=audit(1290419683.646:25322): arch=c000003e syscall=2 success=no exit=-13 a0=7fffb276380d a1=441 a2=1b6 a3=0 items=0 ppid=1 pid=4517 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="cgrulesengd" exe="/sbin/cgrulesengd" subj=unconfined_u:system_r:cgred_t:s0 key=(null) Steps to Reproduce: 1. Edit /etc/sysconfig/cgred.conf to specify a custom logfile 2. Start cgconfig and cgred service (see bug #655720) 3. Each command '/etc/init.d/cgred restart' will give an SELinux alert.
cgred uses syslog by default. I could add a new type for a log file and rules but there would need to be a default location for the log file. So since this is a local customization, you need to add a local policy module using # grep cgred_t /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp
There is a default location for the log file: it is written in /etc/sysconfig/cgred.conf. I guess I was not clear: I have not made a real customization, I have just uncommented the line. I think that for consistency, this log file must be allowed.
Miroslav I think we should add a type for the log file. Alphonse what is the name of the log file created.
(In reply to comment #2) > There is a default location for the log file: it is written in > /etc/sysconfig/cgred.conf. > I guess I was not clear: I have not made a real customization, I have just > uncommented the line. I think that for consistency, this log file must be > allowed. Then also my fault. I have checked the bad config file.
The default logfile reported in /etc/sysconfig/cgred.conf is "/var/log/cgrulesengd.log"
Fixed in selinux-policy-3.9.7-14.fc14
selinux-policy-3.9.7-14.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-14.fc14
selinux-policy-3.9.7-14.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update selinux-policy'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-14.fc14
selinux-policy-3.9.7-14.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.