Bug 756332

Summary: After setting authentication to Winbind, it's connections are blocked by selinux
Product: [Fedora] Fedora Reporter: David Jaša <djasa>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 19CC: asn, dwalsh, gdeschner, mgrepl, ssorce, tmraz
Target Milestone: ---Keywords: Reopened, SELinux
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-18 11:07:40 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 David Jaša 2011-11-23 10:28:25 UTC
Description of problem:
SSIA

Version-Release number of selected component (if applicable):
authconfig-6.1.16-3.fc17.x86_64
samba-winbind-3.6.1-76.fc17.x86_64

How reproducible:
always

Steps to Reproduce:
1. have an AD server and fresh Fedora Rawhide
2. run this command on Fedora:
authconfig --enablewinbind --enablewinbindauth \
  --smbsecurity=domain --smbservers=<ad_address> \
  --smbworkgroup=<domain_name> \
  --winbindtemplateshell=/bin/bash \
  --enablewinbindoffline --winbindjoin=vdcadmin \
  --enablemkhomedir --update
3. run command on Fedora:
getent passwd <domain>\\<user>
  
Actual results:
user info is not shown and and this AVC is generated:
type=AVC msg=audit(1322043924.605:407): avc:  denied  { name_connect } for  pid=7749 comm="winbindd" dest=389 scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:object_r:ldap_port_t:s0 tclass=tcp_socket

Expected results:
no winbindd-related AVC's are generated and user info is printed to terminal

Additional info:

Comment 1 Miroslav Grepl 2011-11-23 12:49:46 UTC
# cat /tmp/winbind.log |audit2allow


#============= winbind_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     authlogin_nsswitch_use_ldap, allow_ypbind

allow winbind_t ldap_port_t:tcp_socket name_connect;



Also the sealert should tell you what to do.

# setsebool -P authlogin_nsswitch_use_ldap 1

Comment 2 David Jaša 2011-11-23 13:15:40 UTC
The bug was assigned to authconfig because when one calls it (or system-config-authentication) to enable authentication via winbind, he won't expect that he has to do anything else to make desired configuration work and conversely, when user disables remote authentication again, he won't expect that he will have to change boolean to get back to default security setting.

If authconfig/system-config-authentication can not modify selinux booleans for any reason, it should at least check if they are in line with authentication settings and give big phat warning if not.

Reopening and resetting back to authconfig.

Comment 3 Tomas Mraz 2011-11-23 14:03:56 UTC
This should be done in the winbindd systemd unit. The boolean should be enabled automatically (without the -P) when the winbindd is started. The same way it is done in the ypbind init script.

Comment 4 Simo Sorce 2011-11-23 14:55:54 UTC
(In reply to comment #1)
> # cat /tmp/winbind.log |audit2allow
> 
> 
> #============= winbind_t ==============
> #!!!! This avc can be allowed using one of the these booleans:
> #     authlogin_nsswitch_use_ldap, allow_ypbind
> 
> allow winbind_t ldap_port_t:tcp_socket name_connect;
> 
> 
> 
> Also the sealert should tell you what to do.
> 
> # setsebool -P authlogin_nsswitch_use_ldap 1

Is this sebool badly named ?
Otherwise I am not sure what this has to do with nsswitch ?
This is teh winbind daemon that is apparently being blocked.
Why should we try to work around it by using the nsswitch boolean ?
The winbind daemon should always be allowed to use LDAP, it is what it does.
And at the same time there is no reason to allow any nss library to access LDAPbecause with both SSSD and Winbindd the nss libs use a domain socket to connect to the daemon and then the daemon connects to LDAP, we do not want to allow random application to connect to LDAP in this case.

Or is there something I am missing ?

Comment 5 Daniel Walsh 2011-11-23 18:24:01 UTC
Ok I did not know that winbind connected directly to ldap, I thought it would do this through sssd.  

Yes our goal is to prevent random apps that use ldap for identity from using it, since they should be using sssd.  But we still have the boolean for users who choose not to use sssd but use pam_ldap.

Miroslav backport

6ce5571eb1bd7d4c76bd5750058223a12622121a

To F16.

Comment 6 Simo Sorce 2011-11-23 18:53:27 UTC
Winbind (the daemon not nss_winbind or pam_winbind) is analogous and parallel to sssd for now.

But even with sssd integration, at least in the short term sssd will connect to winbind and winbind will connect to AD (LDAP, KRB, CLDAP, MS-RPC, SMB). So please do not constrain the winbind daemon from using all these protocols or we will have very strange and difficult to debug failures.

Comment 7 Daniel Walsh 2011-11-23 20:07:47 UTC
I have checked in a fix for Rawhide, just need to wait for it to be back ported to F16.

Comment 8 Fedora End Of Life 2013-04-03 20:33:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 9 Fedora End Of Life 2015-01-09 22:30:13 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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 19 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 10 Fedora End Of Life 2015-02-18 11:07:40 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 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.