Bug 701644

Summary: SELinux is preventing /usr/bin/perl from 'write' accesses on the directory /var/lib/munin/plugin-state.
Product: [Fedora] Fedora Reporter: Filip Kovář <ageszo>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:099ba74a9815a6e9db916faca975842d67b3a23520f0b71aee741845f283430f
Fixed In Version: selinux-policy-3.9.7-42.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-12 05:16:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Filip Kovář 2011-05-03 13:11:03 UTC
SELinux is preventing /usr/bin/perl from 'write' accesses on the directory /var/lib/munin/plugin-state.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that perl should be allowed write access on the plugin-state directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep munin_stats /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:munin_t:s0
Target Context                system_u:object_r:munin_plugin_state_t:s0
Target Objects                /var/lib/munin/plugin-state [ dir ]
Source                        munin_stats
Source Path                   /usr/bin/perl
Port                          <Neznámé>
Host                          (removed)
Source RPM Packages           perl-5.12.3-143.fc14
Target RPM Packages           munin-1.4.5-6.fc14
Policy RPM                    selinux-policy-3.9.7-40.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.12-90.fc14.x86_64 #1 SMP Fri
                              Apr 22 16:01:29 UTC 2011 x86_64 x86_64
Alert Count                   1219
First Seen                    Pá 29. duben 2011, 09:25:06 CEST
Last Seen                     Út 3. květen 2011, 15:10:04 CEST
Local ID                      40a3a1c3-542b-429c-ac97-4da5ae5d8c4f

Raw Audit Messages
type=AVC msg=audit(1304428204.715:64221): avc:  denied  { write } for  pid=10043 comm="munin_stats" name="plugin-state" dev=dm-1 ino=660953 scontext=system_u:system_r:munin_t:s0 tcontext=system_u:object_r:munin_plugin_state_t:s0 tclass=dir


type=SYSCALL msg=audit(1304428204.715:64221): arch=x86_64 syscall=open success=no exit=EACCES a0=c395b0 a1=241 a2=1b6 a3=33d8d26f20 items=0 ppid=9836 pid=10043 auid=4294967295 uid=491 gid=486 euid=491 suid=491 fsuid=491 egid=486 sgid=486 fsgid=486 tty=(none) ses=4294967295 comm=munin_stats exe=/usr/bin/perl subj=system_u:system_r:munin_t:s0 key=(null)

Hash: munin_stats,munin_t,munin_plugin_state_t,dir,write

audit2allow

#============= munin_t ==============
#!!!! The source type 'munin_t' can write to a 'dir' of the following types:
# tmp_t, munin_tmp_t, munin_log_t, var_run_t, var_log_t, munin_var_lib_t, munin_var_run_t, httpd_munin_content_t, root_t

allow munin_t munin_plugin_state_t:dir write;

audit2allow -R

#============= munin_t ==============
#!!!! The source type 'munin_t' can write to a 'dir' of the following types:
# tmp_t, munin_tmp_t, munin_log_t, var_run_t, var_log_t, munin_var_lib_t, munin_var_run_t, httpd_munin_content_t, root_t

allow munin_t munin_plugin_state_t:dir write;

Comment 1 Miroslav Grepl 2011-05-03 14:06:47 UTC
Could you try to execute

# chcon -t system_munin_plugin_exec_t /usr/share/munin/plugins/munin_*

and re-test it. Thank you.

Comment 2 Filip Kovář 2011-05-04 09:34:52 UTC
(In reply to comment #1)
> Could you try to execute
> 
> # chcon -t system_munin_plugin_exec_t /usr/share/munin/plugins/munin_*
> 
> and re-test it. Thank you.

Now It seems to be OK. No more warnings in Sealert. Thank You.

Comment 3 Miroslav Grepl 2011-05-27 09:58:33 UTC
Fixed in selinux-policy-3.9.7-42.fc14

Comment 4 Fedora Update System 2011-05-27 15:45:38 UTC
selinux-policy-3.9.7-42.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-42.fc14

Comment 5 Fedora Update System 2011-05-27 20:27:36 UTC
Package selinux-policy-3.9.7-42.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.7-42.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-42.fc14
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-07-12 05:14:57 UTC
selinux-policy-3.9.7-42.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.