Bug 1139581 - SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file .
Summary: SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file .
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:8eec5c99adff5c28364672a19bb...
: 1139587 1139597 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-09 09:05 UTC by GuL
Modified: 2015-06-30 01:08 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.12.1-185.fc20
Clone Of:
Environment:
Last Closed: 2015-06-30 01:08:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
munin-cron added lines in /var/log/audit/audit.log with setenforce 1 (3.04 KB, text/plain)
2014-09-10 19:52 UTC, GuL
no flags Details
munin-cron added lines in /var/log/audit/audit.log with setenforce 0 (2.72 KB, text/plain)
2014-09-10 19:53 UTC, GuL
no flags Details
munin-cron added lines in /var/log/munin-node/munin-node.log (793 bytes, text/plain)
2014-09-10 19:54 UTC, GuL
no flags Details
grep munin /var/log/audit/audit.log | grep AVC > munin-audit.log (37.29 KB, text/plain)
2014-09-29 10:57 UTC, GuL
no flags Details
grep 1412356 /var/log/audit/audit.log | grep munin | grep AVC > munin-AVC.log (2.70 KB, text/plain)
2014-10-03 17:27 UTC, GuL
no flags Details

Description GuL 2014-09-09 09:05:38 UTC
Description of problem:
Hello,
This error has occured when restarting munin-node service after enabling fail2ban module in /etc/munin/plugins/fail2ban. I am using fail2ban-0.9-2.fc20, munin-node-2.0.21-1.fc20 and selinux-policy-3.12.1-182.fc20.
Thanks to solve it.
SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file .

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

If vous pensez que bash devrait être autorisé à accéder getattr sur  file par défaut.
Then vous devriez rapporter ceci en tant qu'anomalie.
Vous pouvez générer un module de stratégie local pour autoriser cet accès.
Do
autoriser cet accès pour le moment en exécutant :
# grep fail2ban /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:services_munin_plugin_t:s0
Target Context                system_u:object_r:fail2ban_client_exec_t:s0
Target Objects                 [ file ]
Source                        fail2ban
Source Path                   /usr/bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.2.47-3.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-182.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.15.10-201.fc20.x86_64 #1 SMP Wed
                              Aug 27 21:10:06 UTC 2014 x86_64 x86_64
Alert Count                   3
First Seen                    2014-09-09 10:59:19 CEST
Last Seen                     2014-09-09 11:00:01 CEST
Local ID                      686664db-5ad9-497a-98f4-c7794d537459

Raw Audit Messages
type=AVC msg=audit(1410253201.696:3168): avc:  denied  { getattr } for  pid=28887 comm="fail2ban" path="/usr/bin/fail2ban-client" dev="dm-0" ino=2236640 scontext=system_u:system_r:services_munin_plugin_t:s0 tcontext=system_u:object_r:fail2ban_client_exec_t:s0 tclass=file


type=SYSCALL msg=audit(1410253201.696:3168): arch=x86_64 syscall=stat success=no exit=EACCES a0=124f810 a1=7fff6eb38090 a2=7fff6eb38090 a3=7fff6eb37f20 items=0 ppid=28885 pid=28887 auid=4294967295 uid=99 gid=99 euid=99 suid=99 fsuid=99 egid=99 sgid=99 fsgid=99 tty=(none) ses=4294967295 comm=fail2ban exe=/usr/bin/bash subj=system_u:system_r:services_munin_plugin_t:s0 key=(null)

Hash: fail2ban,services_munin_plugin_t,fail2ban_client_exec_t,file,getattr

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.15.10-201.fc20.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-09-09 13:58:06 UTC
*** Bug 1139597 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2014-09-09 13:58:10 UTC
*** Bug 1139587 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2014-09-09 14:00:52 UTC
commit f1f596169585edc293066d0e1697da5d7866db9e
Author: Miroslav Grepl <mgrepl>
Date:   Tue Sep 9 16:00:28 2014 +0200

    Allow munin services plugins to execute fail2ban-client in fail2ban_client_t domain.

Comment 4 Lukas Vrabec 2014-09-10 09:15:13 UTC
commit f2d7b6cb7e83f65c96c569e19b81996f380ad0f7
Author: Miroslav Grepl <mgrepl>
Date:   Tue Sep 9 16:00:28 2014 +0200

    Allow munin services plugins to execute fail2ban-client in fail2ban_client_t domain.

https://github.com/selinux-policy/selinux-policy/commit/f2d7b6cb7e83f65c96c569e19b81996f380ad0f7

Comment 5 GuL 2014-09-10 19:50:23 UTC
Hello,

Here are more infos. Even with the following selinux rules added, munin is displaying an empty graph for fail2ban. However it works with selinux disabled.

#============= httpd_munin_script_t ==============
allow httpd_munin_script_t self:process execmem;

#============= munin_t ==============
allow munin_t self:capability net_admin;
allow munin_t self:process execmem;

#============= services_munin_plugin_t ==============
allow services_munin_plugin_t fail2ban_client_exec_t:file { ioctl execute read o
pen getattr execute_no_trans };
allow services_munin_plugin_t fail2ban_t:unix_stream_socket connectto;
allow services_munin_plugin_t fail2ban_var_run_t:sock_file write;

grep munin /var/log/audit/audit.log | audit2allow -M munin-gul ; more munin-gul.te gives me nothing more

You will find below the lines added by munin-cron in /var/log/audit/audit.log with setenforce 1 and with setenforce 0 after munin-node service restart. I am also providing the corresponding lines in /var/log/munin-node/munin-node.log

Cheers,

Comment 6 GuL 2014-09-10 19:52:16 UTC
Created attachment 936314 [details]
munin-cron added lines in /var/log/audit/audit.log with setenforce 1

Comment 7 GuL 2014-09-10 19:53:12 UTC
Created attachment 936316 [details]
munin-cron added lines in /var/log/audit/audit.log with setenforce 0

Comment 8 GuL 2014-09-10 19:54:22 UTC
Created attachment 936317 [details]
munin-cron added lines in /var/log/munin-node/munin-node.log

Comment 9 Fedora Update System 2014-09-23 08:29:40 UTC
selinux-policy-3.12.1-186.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-186.fc20

Comment 10 Fedora Update System 2014-09-25 10:45:08 UTC
Package selinux-policy-3.12.1-186.fc20:
* should fix your issue,
* was pushed to the Fedora 20 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.12.1-186.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-11479/selinux-policy-3.12.1-186.fc20
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2014-09-25 16:57:53 UTC
selinux-policy-3.12.1-187.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-187.fc20

Comment 12 GuL 2014-09-26 10:46:48 UTC
Hello,
After updating to selinux-policy-3.12.1.186.fc20, I got several selinux errors solved with

allow fail2ban_client_t munin_t:fifo_file { write getattr ioctl };
allow fail2ban_client_t munin_t:tcp_socket { ioctl getattr };

Cheers,

Comment 13 Lukas Vrabec 2014-09-29 08:03:50 UTC
Hi, 

Could you paste here your actual AVC list? 

Thank you.

Comment 14 GuL 2014-09-29 10:57:26 UTC
Created attachment 942289 [details]
grep munin /var/log/audit/audit.log | grep AVC > munin-audit.log

Hi,
Here are the requested AVC after a reboot using permissive mode
Cheers

Comment 15 Fedora Update System 2014-09-30 08:36:45 UTC
selinux-policy-3.12.1-188.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-188.fc20

Comment 16 Fedora Update System 2014-10-01 04:23:07 UTC
Package selinux-policy-3.12.1-188.fc20:
* should fix your issue,
* was pushed to the Fedora 20 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.12.1-188.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-11932/selinux-policy-3.12.1-188.fc20
then log in and leave karma (feedback).

Comment 17 GuL 2014-10-03 17:27:32 UTC
Created attachment 943763 [details]
grep 1412356 /var/log/audit/audit.log | grep munin | grep AVC > munin-AVC.log

Hi, after updating to selinux-policy-3.12.1-188.fc20, full selinux relabel and reboot, I still have the following errors concerning munin.

#============= fail2ban_client_t ==============
allow fail2ban_client_t munin_t:fifo_file { write getattr ioctl };
allow fail2ban_client_t munin_t:tcp_socket { ioctl getattr };

#============= munin_t ==============
allow munin_t self:capability net_admin;
allow munin_t self:process execmem;

audit.log has been restricted to the relevant date.

Cheers

Comment 18 Fedora End Of Life 2015-05-29 12:49:48 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

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

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is 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  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 19 Fedora End Of Life 2015-06-30 01:08:34 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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