Bug 847438

Summary: SELinux is preventing /usr/libexec/dovecot/auth from 'name_connect' accesses on the tcp_socket .
Product: [Fedora] Fedora Reporter: Braden McDaniel <braden>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, janfrode, mgrepl, mhlavink
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:73fcf559f8c1f57a84853c1da21d14dda90b3839023b10be7b3e5899fe0eadd4
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-27 23:03:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Braden McDaniel 2012-08-11 09:23:57 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.5.1-1.fc17.x86_64
time:           Sat 11 Aug 2012 05:23:13 AM EDT

description:
:SELinux is preventing /usr/libexec/dovecot/auth from 'name_connect' accesses on the tcp_socket .
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that auth should be allowed name_connect access on the  tcp_socket 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 auth /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:dovecot_auth_t:s0
:Target Context                system_u:object_r:ldap_port_t:s0
:Target Objects                 [ tcp_socket ]
:Source                        auth
:Source Path                   /usr/libexec/dovecot/auth
:Port                          389
:Host                          (removed)
:Source RPM Packages           dovecot-2.1.8-1.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-145.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.5.1-1.fc17.x86_64 #1
:                              SMP Thu Aug 9 17:50:43 UTC 2012 x86_64 x86_64
:Alert Count                   4
:First Seen                    Sat 11 Aug 2012 04:57:14 AM EDT
:Last Seen                     Sat 11 Aug 2012 05:21:49 AM EDT
:Local ID                      152b1b84-7dcf-4135-aa75-cb5715f99cb2
:
:Raw Audit Messages
:type=AVC msg=audit(1344676909.622:100): avc:  denied  { name_connect } for  pid=1857 comm="auth" dest=389 scontext=system_u:system_r:dovecot_auth_t:s0 tcontext=system_u:object_r:ldap_port_t:s0 tclass=tcp_socket
:
:
:type=SYSCALL msg=audit(1344676909.622:100): arch=x86_64 syscall=connect success=no exit=ECONNREFUSED a0=10 a1=154ab40 a2=10 a3=3418b77640 items=0 ppid=680 pid=1857 auid=4294967295 uid=97 gid=97 euid=97 suid=97 fsuid=97 egid=97 sgid=97 fsgid=97 tty=(none) ses=4294967295 comm=auth exe=/usr/libexec/dovecot/auth subj=system_u:system_r:dovecot_auth_t:s0 key=(null)
:
:Hash: auth,dovecot_auth_t,ldap_port_t,tcp_socket,name_connect
:
:audit2allow
:
:#============= dovecot_auth_t ==============
:#!!!! This avc can be allowed using one of the these booleans:
:#     authlogin_nsswitch_use_ldap, allow_ypbind
:
:allow dovecot_auth_t ldap_port_t:tcp_socket name_connect;
:
:audit2allow -R
:
:#============= dovecot_auth_t ==============
:#!!!! This avc can be allowed using one of the these booleans:
:#     authlogin_nsswitch_use_ldap, allow_ypbind
:
:allow dovecot_auth_t ldap_port_t:tcp_socket name_connect;
:

Comment 1 Daniel Walsh 2012-08-13 19:22:10 UTC
Do you use ldap for user authorization on your machine, or is dovecot setup to use ldap?

Comment 2 Braden McDaniel 2012-08-13 23:26:19 UTC
Dovecot is set up to use LDAP for user information; Kerberos is used for authentication.

Comment 3 Daniel Walsh 2012-08-14 15:00:50 UTC
But your machine is not using pam_ldap?

Comment 4 Daniel Walsh 2012-08-14 15:02:59 UTC
Basically we have a boolean authlogin_nsswitch_use_ldap which would allow this access, but it would allow all domains that call getpw to now connect to the ldap server.  I am just trying to figure out if dovecot uses ldap even if the system is not setup to use ldap for authorization through pam_ldap.

Comment 5 Braden McDaniel 2012-08-14 15:22:02 UTC
(In reply to comment #3)
> But your machine is not using pam_ldap?

pam_ldap seems to be installed; however, pam_ldap.so occurs nowhere in /etc/pam.d/password-auth. Is there somewhere else it would get pulled in?

(In reply to comment #4)
> Basically we have a boolean authlogin_nsswitch_use_ldap which would allow
> this access, but it would allow all domains that call getpw to now connect
> to the ldap server.  I am just trying to figure out if dovecot uses ldap
> even if the system is not setup to use ldap for authorization through
> pam_ldap.

As I indicated, dovecot is using LDAP to get user information. What that means is that the dovecot configuration includes something like this:

hosts = ldap
dn = cn=Manager,dc=endoframe,dc=net
dnpass = ********
ldap_version = 3
base = ou=people,dc=endoframe,dc=net
deref = never
scope = subtree
user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid
user_filter = (&(objectClass=posixAccount)(uid=%u))


(I'm using the Manager account for this at the moment; though the recommendation is to set up an account for dovecot with read-only privileges.)

Comment 6 Daniel Walsh 2012-08-14 19:09:35 UTC
Ok that is exactly what I wanted to know.

I will add to F18, Miroslav please back port, to F17.

Comment 7 Fedora Update System 2012-08-20 13:09:16 UTC
selinux-policy-3.10.0-146.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-146.fc17

Comment 8 Fedora Update System 2012-08-21 09:50:04 UTC
Package selinux-policy-3.10.0-146.fc17:
* should fix your issue,
* was pushed to the Fedora 17 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.10.0-146.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-12355/selinux-policy-3.10.0-146.fc17
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2012-08-27 23:03:07 UTC
selinux-policy-3.10.0-146.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.