Bug 1286052 - SELinux prevents munin-cgi-graph from creating its log file
SELinux prevents munin-cgi-graph from creating its log file
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.7
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-27 05:20 EST by Milos Malik
Modified: 2016-05-10 16:02 EDT (History)
7 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-286.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 16:02:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milos Malik 2015-11-27 05:20:00 EST
Description of problem:

Version-Release number of selected component (if applicable):
httpd-2.2.15-45.el6.x86_64
httpd-tools-2.2.15-45.el6.x86_64
munin-2.0.25-2.el6.noarch
munin-cgi-2.0.25-2.el6.noarch
munin-common-2.0.25-2.el6.noarch
munin-node-2.0.25-2.el6.noarch
selinux-policy-3.7.19-279.el6.noarch
selinux-policy-targeted-3.7.19-279.el6.noarch

How reproducible:
 * always

Steps to Reproduce:
1. get a RHEL-6.7 machine (active targeted policy)
2. htpasswd -c /etc/munin/munin-htpasswd test-user
3. start the httpd service
4. links http://localhost/munin-cgi/munin-cgi-graph and log in as test-user
5. search for SELinux denials

Actual results (enforcing mode):
----
type=PATH msg=audit(11/27/2015 05:05:05.632:391) : item=1 name=/var/log/munin/munin-cgi-graph.log nametype=CREATE 
type=PATH msg=audit(11/27/2015 05:05:05.632:391) : item=0 name=/var/log/munin/ inode=529283 dev=fc:01 mode=dir,775 ouid=apache ogid=munin rdev=00:00 obj=system_u:object_r:munin_log_t:s0 nametype=PARENT 
type=CWD msg=audit(11/27/2015 05:05:05.632:391) :  cwd=/var/www/cgi-bin 
type=SYSCALL msg=audit(11/27/2015 05:05:05.632:391) : arch=x86_64 syscall=open success=no exit=-13(Permission denied) a0=0x2df0ed0 a1=O_WRONLY|O_CREAT|O_APPEND a2=0666 a3=0x3764d1dd50 items=2 ppid=1676 pid=2832 auid=root uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=4 comm=munin-cgi-graph exe=/usr/bin/perl subj=unconfined_u:system_r:httpd_munin_script_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 05:05:05.632:391) : avc:  denied  { write } for  pid=2832 comm=munin-cgi-graph name=munin dev=vda1 ino=529283 scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=system_u:object_r:munin_log_t:s0 tclass=dir 
----

Expected results:
 * no SELinux denials
Comment 1 Milos Malik 2015-11-27 05:28:39 EST
Actual results (permissive mode):
----
type=PATH msg=audit(11/27/2015 05:26:12.962:432) : item=1 name=/var/log/munin/munin-cgi-graph.log inode=529411 dev=fc:01 mode=file,644 ouid=apache ogid=apache rdev=00:00 obj=unconfined_u:object_r:munin_log_t:s0 nametype=CREATE 
type=PATH msg=audit(11/27/2015 05:26:12.962:432) : item=0 name=/var/log/munin/ inode=529283 dev=fc:01 mode=dir,775 ouid=apache ogid=munin rdev=00:00 obj=system_u:object_r:munin_log_t:s0 nametype=PARENT 
type=CWD msg=audit(11/27/2015 05:26:12.962:432) :  cwd=/var/www/cgi-bin 
type=SYSCALL msg=audit(11/27/2015 05:26:12.962:432) : arch=x86_64 syscall=open success=yes exit=3 a0=0x2c6ded0 a1=O_WRONLY|O_CREAT|O_APPEND a2=0666 a3=0x3764d1dd50 items=2 ppid=1676 pid=3450 auid=root uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=4 comm=munin-cgi-graph exe=/usr/bin/perl subj=unconfined_u:system_r:httpd_munin_script_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 05:26:12.962:432) : avc:  denied  { create } for  pid=3450 comm=munin-cgi-graph name=munin-cgi-graph.log scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=unconfined_u:object_r:munin_log_t:s0 tclass=file 
type=AVC msg=audit(11/27/2015 05:26:12.962:432) : avc:  denied  { add_name } for  pid=3450 comm=munin-cgi-graph name=munin-cgi-graph.log scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=system_u:object_r:munin_log_t:s0 tclass=dir 
type=AVC msg=audit(11/27/2015 05:26:12.962:432) : avc:  denied  { write } for  pid=3450 comm=munin-cgi-graph name=munin dev=vda1 ino=529283 scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=system_u:object_r:munin_log_t:s0 tclass=dir 
----
type=SYSCALL msg=audit(11/27/2015 05:26:12.792:431) : arch=x86_64 syscall=ioctl success=no exit=-22(Invalid argument) a0=0x0 a1=0x5401 a2=0x7fff3e6c6880 a3=0x48 items=0 ppid=1676 pid=3450 auid=root uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=4 comm=munin-cgi-graph exe=/usr/bin/perl subj=unconfined_u:system_r:httpd_munin_script_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 05:26:12.792:431) : avc:  denied  { ioctl } for  pid=3450 comm=munin-cgi-graph path=socket:[62467] dev=sockfs ino=62467 scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=unconfined_u:system_r:httpd_t:s0 tclass=unix_stream_socket 
----
type=SYSCALL msg=audit(11/27/2015 05:26:12.964:433) : arch=x86_64 syscall=getpeername success=no exit=-107(Transport endpoint is not connected) a0=0x0 a1=0x7fff3e6c6ba0 a2=0x7fff3e6c6b9c a3=0x7fff3e6c6910 items=0 ppid=1676 pid=3450 auid=root uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=4 comm=munin-cgi-graph exe=/usr/bin/perl subj=unconfined_u:system_r:httpd_munin_script_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 05:26:12.964:433) : avc:  denied  { getattr } for  pid=3450 comm=munin-cgi-graph path=/var/run/mod_fcgid/1676.2 scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=unconfined_u:system_r:httpd_t:s0 tclass=unix_stream_socket 
----
type=SOCKADDR msg=audit(11/27/2015 05:26:12.964:434) : saddr=local 0 
type=SYSCALL msg=audit(11/27/2015 05:26:12.964:434) : arch=x86_64 syscall=accept success=yes exit=4 a0=0x0 a1=0x7fff3e6c6b70 a2=0x7fff3e6c6b6c a3=0x7fff3e6c6820 items=0 ppid=1676 pid=3450 auid=root uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=4 comm=munin-cgi-graph exe=/usr/bin/perl subj=unconfined_u:system_r:httpd_munin_script_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 05:26:12.964:434) : avc:  denied  { accept } for  pid=3450 comm=munin-cgi-graph path=/var/run/mod_fcgid/1676.2 scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=unconfined_u:system_r:httpd_t:s0 tclass=unix_stream_socket 
----
type=SYSCALL msg=audit(11/27/2015 05:26:12.983:435) : arch=x86_64 syscall=shutdown success=yes exit=0 a0=0x4 a1=0x1 a2=0x24901d0 a3=0x7fff3e6c64b0 items=0 ppid=1676 pid=3450 auid=root uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=4 comm=munin-cgi-graph exe=/usr/bin/perl subj=unconfined_u:system_r:httpd_munin_script_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 05:26:12.983:435) : avc:  denied  { shutdown } for  pid=3450 comm=munin-cgi-graph path=/var/run/mod_fcgid/1676.2 scontext=unconfined_u:system_r:httpd_munin_script_t:s0 tcontext=unconfined_u:system_r:httpd_t:s0 tclass=unix_stream_socket 
----
Comment 2 Miroslav Grepl 2015-11-30 07:02:40 EST
We need to back port

manage_files_pattern(munin_script_t, munin_log_t, munin_log_t)

and

#!!!! This avc is allowed in the current policy
allow httpd_munin_script_t httpd_t:unix_stream_socket { shutdown accept };
Comment 8 errata-xmlrpc 2016-05-10 16:02:54 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0763.html

Note You need to log in before you can comment on or make changes to this bug.