Bug 1480924

Summary: 3 AVC violations by Nagios on fresh install of Fedora 25
Product: [Fedora] Fedora Reporter: Greg <greg.a.metcalfe>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 25CC: affix, athmanem, b.heden, dominick.grift, dwalsh, greg.a.metcalfe, jose.p.oliveira.oss, kenyon, linux, lsm5, lvrabec, mgrepl, ondrejj, plautrba, pmoore, smooge, smooge, ssekidde, s, swilkerson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 10:16:52 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 Greg 2017-08-12 21:44:26 UTC
Fixed these via audit2allow, and Nagios came up.
# 1 ###################################

SELinux is preventing status.cgi from read access on the file /var/spool/nagios/objects.cache.

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

If you believe that status.cgi should be allowed read access on the objects.cache 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:
# ausearch -c 'status.cgi' --raw | audit2allow -M my-statuscgi
# semodule -X 300 -i my-statuscgi.pp

Additional Information:
Source Context                system_u:system_r:nagios_script_t:s0
Target Context                system_u:object_r:nagios_spool_t:s0
Target Objects                /var/spool/nagios/objects.cache [ file ]
Source                        status.cgi
Source Path                   status.cgi
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.19.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     feynman.peoria.local
Platform                      Linux feynman.peoria.local 4.11.12-200.fc25.x86_64
                              #1 SMP Fri Jul 21 16:41:43 UTC 2017 x86_64 x86_64
Alert Count                   5
First Seen                    2017-08-12 13:27:57 PDT
Last Seen                     2017-08-12 13:32:03 PDT
Local ID                      954e3303-23fa-44c3-9bb9-4dcfe3263f9a

Raw Audit Messages
type=AVC msg=audit(1502569923.720:2144): avc:  denied  { read } for  pid=3728 comm="trends.cgi" name="objects.cache" dev="dm-0" ino=2364515 scontext=system_u:system_r:nagios_script_t:s0 tcontext=system_u:object_r:nagios_spool_t:s0 tclass=file permissive=0


Hash: status.cgi,nagios_script_t,nagios_spool_t,file,read

# 2 ###################################

SELinux is preventing statusjson.cgi from open access on the file /var/spool/nagios/objects.cache.

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

If you believe that statusjson.cgi should be allowed open access on the objects.cache 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:
# ausearch -c 'statusjson.cgi' --raw | audit2allow -M my-statusjsoncgi
# semodule -X 300 -i my-statusjsoncgi.pp

Additional Information:
Source Context                system_u:system_r:nagios_script_t:s0
Target Context                system_u:object_r:nagios_spool_t:s0
Target Objects                /var/spool/nagios/objects.cache [ file ]
Source                        statusjson.cgi
Source Path                   statusjson.cgi
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.19.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     feynman.peoria.local
Platform                      Linux feynman.peoria.local 4.11.12-200.fc25.x86_64
                              #1 SMP Fri Jul 21 16:41:43 UTC 2017 x86_64 x86_64
Alert Count                   3
First Seen                    2017-08-12 13:37:13 PDT
Last Seen                     2017-08-12 13:51:20 PDT
Local ID                      4ef61090-bb34-49dc-9754-76a78a3c8fe9

Raw Audit Messages
type=AVC msg=audit(1502571080.120:2169): avc:  denied  { open } for  pid=4311 comm="tac.cgi" path="/var/spool/nagios/objects.cache" dev="dm-0" ino=2364515 scontext=system_u:system_r:nagios_script_t:s0 tcontext=system_u:object_r:nagios_spool_t:s0 tclass=file permissive=0


Hash: statusjson.cgi,nagios_script_t,nagios_spool_t,file,open

# 2 ###################################

SELinux is preventing statusjson.cgi from getattr access on the file /var/spool/nagios/objects.cache.

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

If you believe that statusjson.cgi should be allowed getattr access on the objects.cache 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:
# ausearch -c 'statusjson.cgi' --raw | audit2allow -M my-statusjsoncgi
# semodule -X 300 -i my-statusjsoncgi.pp

Additional Information:
Source Context                system_u:system_r:nagios_script_t:s0
Target Context                system_u:object_r:nagios_spool_t:s0
Target Objects                /var/spool/nagios/objects.cache [ file ]
Source                        statusjson.cgi
Source Path                   statusjson.cgi
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.19.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     feynman.peoria.local
Platform                      Linux feynman.peoria.local 4.11.12-200.fc25.x86_64
                              #1 SMP Fri Jul 21 16:41:43 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-08-12 14:02:23 PDT
Last Seen                     2017-08-12 14:02:23 PDT
Local ID                      fd534c60-127d-4b8a-b1e4-643c45085149

Raw Audit Messages
type=AVC msg=audit(1502571743.315:2187): avc:  denied  { getattr } for  pid=4468 comm="statusjson.cgi" path="/var/spool/nagios/objects.cache" dev="dm-0" ino=2364515 scontext=system_u:system_r:nagios_script_t:s0 tcontext=system_u:object_r:nagios_spool_t:s0 tclass=file permissive=0


Hash: statusjson.cgi,nagios_script_t,nagios_spool_t,file,getattr

Comment 1 Stephen John Smoogen 2017-08-13 00:23:22 UTC
This will need to be filed against selinux-policy versus nagios. Selinux policy for packages in Fedora are centralized inside the selinux-policy package as it is shipped as part of the distribution. [EPEL is done as a sub-package because the selinux-policy package is run outside of EPEL's control.]

I have not reassigned a bug before so I need to see how to do that. I will remain cc'd on the bug as I don't like seeing this broken.

Comment 2 Greg 2017-08-15 16:13:30 UTC
Two more:

# 4 ==================
SELinux is preventing lnusertemp from create access on the directory .kde.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to enable polyinstantiated directory support.
Then you must tell SELinux about this by enabling the 'polyinstantiation_enabled' boolean.

Do
setsebool -P polyinstantiation_enabled 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that lnusertemp should be allowed create access on the .kde 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:
# ausearch -c 'lnusertemp' --raw | audit2allow -M my-lnusertemp
# semodule -X 300 -i my-lnusertemp.pp

Additional Information:
Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:admin_home_t:s0
Target Objects                .kde [ dir ]
Source                        lnusertemp
Source Path                   lnusertemp
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.19.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     feynman.peoria.local
Platform                      Linux feynman.peoria.local 4.11.12-200.fc25.x86_64
                              #1 SMP Fri Jul 21 16:41:43 UTC 2017 x86_64 x86_64
Alert Count                   13
First Seen                    2017-08-07 14:55:45 PDT
Last Seen                     2017-08-14 08:46:54 PDT
Local ID                      82c97ab4-c08b-4e43-86e8-47f2a6ebf773

Raw Audit Messages
type=AVC msg=audit(1502725614.166:316): avc:  denied  { create } for  pid=2801 comm="kdm" name=".kde" scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:admin_home_t:s0 tclass=dir permissive=0


Hash: lnusertemp,xdm_t,admin_home_t,dir,create


# 5 ==================
nagios/.esmtp_queue/93ovvB0w/mail.

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

If you believe that esmtp should be allowed read access on the mail 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:
# ausearch -c 'esmtp' --raw | audit2allow -M my-esmtp
# semodule -X 300 -i my-esmtp.pp

Additional Information:
Source Context                system_u:system_r:system_mail_t:s0
Target Context                system_u:object_r:nagios_spool_t:s0
Target Objects                /var/spool/nagios/.esmtp_queue/93ovvB0w/mail [
                              file ]
Source                        esmtp
Source Path                   esmtp
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.19.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     feynman.peoria.local
Platform                      Linux feynman.peoria.local 4.11.12-200.fc25.x86_64
                              #1 SMP Fri Jul 21 16:41:43 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-08-15 09:00:31 PDT
Last Seen                     2017-08-15 09:00:31 PDT
Local ID                      ba05f294-bfe9-47c8-8aaf-0d9877025ae5

Raw Audit Messages
type=AVC msg=audit(1502812831.994:769): avc:  denied  { read } for  pid=12022 comm="esmtp" path="/var/spool/nagios/.esmtp_queue/93ovvB0w/mail" dev="dm-0" ino=2360090 scontext=system_u:system_r:system_mail_t:s0 tcontext=system_u:object_r:nagios_spool_t:s0 tclass=file permissive=0


Hash: esmtp,system_mail_t,nagios_spool_t,file,read

Comment 3 Fedora End Of Life 2017-11-16 14:04:53 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 4 Fedora End Of Life 2017-12-12 10:16:52 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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.