Bug 826166

Summary: SELinux is preventing /bin/bash from 'execute' accesses on the file /etc/munin/plugins/sntp.sh
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: muninAssignee: Kevin Fenzi <kevin>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, drjohnson1, dwalsh, ingvar, jvanek, kevin, mgrepl, opensource
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 19:56:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Till Maas 2012-05-29 18:08:56 UTC
*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that bash should be allowed execute access on the sntp.sh file 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 sntp.sh /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                unconfined_u:object_r:munin_etc_t:s0
Target Objects                /etc/munin/plugins/sntp.sh [ file ]
Source                        sntp.sh
Source Path                   /bin/bash
Port                          &lt;Unbekannt&gt;
Host                          (removed)
Source RPM Packages           bash-4.2.10-4.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-52.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.43.7-1.fc15.x86_64 #1 SMP
                              Tue May 22 14:23:34 UTC 2012 x86_64 x86_64
Alert Count                   3751
First Seen                    Sa 12 Mai 2012 12:13:58 CEST
Last Seen                     Di 29 Mai 2012 19:55:10 CEST
Local ID                      26d76b89-412f-4057-ad56-07d46568ea68

Raw Audit Messages
type=AVC msg=audit(1338314110.635:3119): avc:  denied  { execute } for  pid=3891 comm="munin-node" name="sntp.sh" dev="dm-2" ino=2807 scontext=system_u:system_r:munin_t:s0 tcontext=unconfined_u:object_r:munin_etc_t:s0 tclass=file


type=AVC msg=audit(1338314110.635:3119): avc:  denied  { execute_no_trans } for  pid=3891 comm="munin-node" path="/etc/munin/plugins/sntp.sh" dev="dm-2" ino=2807 scontext=system_u:system_r:munin_t:s0 tcontext=unconfined_u:object_r:munin_etc_t:s0 tclass=file


type=SYSCALL msg=audit(1338314110.635:3119): arch=x86_64 syscall=execve success=yes exit=0 a0=1488430 a1=184f550 a2=18b3f10 a3=8 items=0 ppid=3370 pid=3891 auid=4294967295 uid=99 gid=470 euid=99 suid=99 fsuid=99 egid=470 sgid=470 fsgid=470 tty=(none) ses=4294967295 comm=sntp.sh exe=/bin/bash subj=system_u:system_r:munin_t:s0 key=(null)

Hash: sntp.sh,munin_t,munin_etc_t,file,execute

audit2allow

#============= munin_t ==============
allow munin_t munin_etc_t:file { execute execute_no_trans };

audit2allow -R

#============= munin_t ==============
allow munin_t munin_etc_t:file { execute execute_no_trans };

Additional info:
I wrote my own plugin for munin (sntp.sh) and put it into /et/munin/plugins. This seems to be the appropiate location or is there a better one?

Comment 1 Daniel Walsh 2012-05-29 18:53:17 UTC
chcon -Rt bin_t /etc/munin/plugins/

Should fix this.

Comment 2 Daniel Walsh 2012-05-29 18:56:42 UTC
I just updated F17 policy for this. But we will not be fixing this in F15, since it is nearing end of life.  the chcon command should fix your problem.

Comment 3 Miroslav Grepl 2012-05-29 20:09:09 UTC
So plugins can be also located in the /etc/munin/plugins?


I think 

/usr/share/munin/plugins

is better place. We have labeling for them in this directory.

Comment 4 Till Maas 2012-05-29 20:13:55 UTC
(In reply to comment #3)
> So plugins can be also located in the /etc/munin/plugins?
>
> I think 
> 
> /usr/share/munin/plugins
> 
> is better place. We have labeling for them in this directory.

The usual way is to symlink plugins from /usr/share/munin/plugins in /etc/munin/plugins. But for unpackaged plugins it would be wrong to move them to /usr/share/munin/plugins.

Comment 5 Miroslav Grepl 2012-05-29 20:32:58 UTC
Yeap, I thought it for default plugins.

Comment 6 Fedora End Of Life 2012-08-07 19:56:26 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping