Bug 1473866

Summary: SELinux is preventing /usr/sbin/sedispatch from write access on the sock_file /dev/log.
Product: [Fedora] Fedora Reporter: dan
Component: setroubleshootAssignee: Petr Lautrbach <plautrba>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: dan, dwalsh, mgrepl, plautrba, pmoore, vmojzis
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: 2018-05-29 12:05:28 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 dan 2017-07-21 23:00:44 UTC
SELinux is preventing /usr/sbin/sedispatch from write access on the sock_file /dev/log.

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

If you believe that sedispatch should be allowed write access on the log sock_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 'sedispatch' --raw | audit2allow -M my-sedispatch
# semodule -X 300 -i my-sedispatch.pp

Additional Information:
Source Context                system_u:system_r:audisp_t:s0
Target Context                system_u:object_r:device_t:s0
Target Objects                /dev/log [ sock_file ]
Source                        sedispatch
Source Path                   /usr/sbin/sedispatch
Port                          <Unknown>
Host                          somehost
Source RPM Packages           setroubleshoot-server-3.3.12-1.fc26.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-260.1.fc26.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     somehost
Platform                      Linux somehost 4.11.10-300.fc26.x86_64 #1 SMP
                              Wed Jul 12 17:05:39 UTC 2017 x86_64 x86_64
Alert Count                   36
First Seen                    2017-07-21 18:56:11 EDT
Last Seen                     2017-07-21 18:56:13 EDT
Local ID                      f1005848-db8e-44ff-b634-a9ddb00d4641

Raw Audit Messages
type=AVC msg=audit(1500677773.24:2193): avc:  denied  { write } for  pid=734 comm="sedispatch" name="log" dev="devtmpfs" ino=21509 scontext=system_u:system_r:audisp_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=sock_file permissive=0


type=SYSCALL msg=audit(1500677773.24:2193): arch=x86_64 syscall=connect success=no exit=EACCES a0=4 a1=7f6d4cca1120 a2=6e a3=1 items=1 ppid=725 pid=734 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sedispatch exe=/usr/sbin/sedispatch subj=system_u:system_r:audisp_t:s0 key=(null)

type=CWD msg=audit(1500677773.24:2193): cwd=/

type=PATH msg=audit(1500677773.24:2193): item=0 name=/dev/log inode=21509 dev=00:06 mode=0140666 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:device_t:s0 nametype=NORMAL

Hash: sedispatch,audisp_t,device_t,sock_file,write

Comment 1 dan 2017-08-17 03:59:17 UTC
Still occurring.  Here's a snippet of my journal.

Aug 16 23:42:43 somehost.com audit[9363]: AVC avc:  denied  { write } for  pid=9363 comm="sendmail" name="system_bus_socket" dev="tmpfs" ino=3009 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:system_dbusd_var_run_t:s0 tclass=sock_file permissive=0
Aug 16 23:42:43 somehost.com sendmail[9363]: v7H3ggBM009363: ruleset=check_rcpt, arg1=<webmaster>, relay=abts-tn-static-201.148.165.122.airtelbroadband.in [122.165.148.201] (may be forged), reject=554 5.7.1 Rejected 122.165.148.201 listed by zen.spamhaus.org
Aug 16 23:42:43 somehost.com sendmail[9363]: v7H3ggBM009363: from=<vm>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v6, relay=abts-tn-static-201.148.165.122.airtelbroadband.in [122.165.148.201] (may be forged)
Aug 16 23:42:46 somehost.com dbus-daemon[990]: [system] Activating service name='org.fedoraproject.Setroubleshootd' requested by ':1.392' (uid=0 pid=961 comm="/usr/sbin/sedispatch " label="system_u:system_r:audisp_t:s0") (using servicehelper)
Aug 16 23:42:46 somehost.com dbus-daemon[990]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Aug 16 23:42:47 somehost.com setroubleshoot[9369]: SELinux is preventing sendmail from write access on the sock_file system_bus_socket. For complete SELinux messages run: sealert -l 618e7c58-a467-4095-baa3-82ea4f8067f8
Aug 16 23:42:47 somehost.com python3[9369]: SELinux is preventing sendmail from write access on the sock_file system_bus_socket.
                                                
                                                *****  Plugin catchall (100. confidence) suggests   **************************
                                                
                                                If you believe that sendmail should be allowed write access on the system_bus_socket sock_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 'sendmail' --raw | audit2allow -M my-sendmail
                                                # semodule -X 300 -i my-sendmail.pp

Comment 2 dan 2017-08-17 04:03:57 UTC
Oops, this update was meant for ticket 1473836.  Please disregard comment immediately above.

Comment 3 Petr Lautrbach 2017-08-21 08:22:29 UTC
Looks like your /dev/log has a wrong label device_t while it should be devlog_t:

$ matchpathcon /dev/log
/dev/log        system_u:object_r:devlog_t:s0


The following command should fix it:

# restorecon -v /dev/log

Comment 4 Fedora End Of Life 2018-05-03 08:40:38 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 '26'.

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 26 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 5 Fedora End Of Life 2018-05-29 12:05:28 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
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.