Since the last update os salt eauth authentication doesn't work
Description of Issue/Question
Since the last update of salt, the eauth authentication module doesn't work. I use sssd service to authenticate user via ssh to the machines and delegate the users db to Active Directory. The salt-master use pam-sssd to authenticate and authorize users to execute commands and modules.
Only local users can launch salt commands, the others one we have to use sudo.
~> stat /usr/bin/salt-master File: «/usr/bin/salt-master» Size: 734 Blocks: 8 IO Block: 4096 fichero regular Device: fd01h/64769d Inode: 3188 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2017-03-12 07:46:48.917067596 +0100 Modify: 2017-02-24 00:34:22.000000000 +0100 Change: 2017-03-10 06:58:17.697547137 +0100
~> salt -a pam -T 'vmoracle01*' test.ping username: pablolemos password: Failed to authenticate! This is most likely because this user is not permitted to execute commands, but there is a small possibility that a disk error occurred (check disk/inode usage).`
~> salt -a pam -T 'vmoracle01*' test.ping username: oracle password: dbdoracle01.srv.gva.es: True
Setup
/etc/salt/master.d/salt-api.conf
external_auth: pam: oracle: - 'oracle': - test.* 14831ADMASL%: - .* # Acceso a todos los modulos de ejecucion - '@wheel' # Acceso a todos los modulos wheel - '@runner' # Acceso a todos los modulos run - '@jobs' # Acceso a los jobs
~> id pablolemos uid=1063401301(pablolemos) gid=1063400513(Domain Users) grupos=1063400513(Domain Users),1063407449(14831ADMASL)
Steps to Reproduce Issue
cat /var/log/salt/master
2017-03-13 12:47:24,603 [salt.master ][WARNING ][7767] Authentication failure of type "eauth" occurred. 2017-03-13 12:47:24,752 [salt.master ][WARNING ][7763] Authentication failure of type "eauth" occurred.
Versions Report
~> salt --versions-report Salt Version: Salt: 2016.11.3
Dependency Versions: cffi: Not Installed cherrypy: 3.2.2 dateutil: 1.4.1 gitdb: 0.5.4 gitpython: 0.3.2 RC1 ioflo: Not Installed Jinja2: 2.8.1 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.20.2 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: 1.2.5 pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed Python: 2.6.6 (r266:84292, Aug 19 2016, 02:44:53) python-gnupg: Not Installed PyYAML: 3.11 PyZMQ: 14.5.0 RAET: Not Installed smmap: 0.8.1 timelib: Not Installed Tornado: 4.3 ZMQ: 4.0.5
System Versions: dist: centos 6.8 Santiago machine: x86_64 release: 2.6.32-642.15.1.el6.x86_64 system: Linux version: Red Hat Enterprise Linux Server 6.8 Santiago
Any help for that? All the Rest/API application that use salt-master was failed (rundeck, etc..)
I am going to be setting this up with sssd to test this, but I just want to make sure that you have python-sss installed?
Thanks, Daniel
I did not have the python-sss package installed because I thought it was for the manipulation of users and groups of sssd and salt used pam modules for user authentication.
I just installed the package and tested the eauth authentication module and it has all worked again.
~> yum info python-sss Complementos cargados:product-id, refresh-packagekit, rhnplugin, security, subscription-manager Nota Los repositorios de Red Hat Network no se listan abajo. Debe ejecutar este comando como root para acceder a repositorios de RHN. Paquetes disponibles Nombre : python-sss Arquitectura : x86_64 Versión : 1.13.3 Lanzamiento : 22.el6_8.6 Tamaño : 119 k Repositorio : smt Resumen : Python2 bindings for sssd URL : http://fedorahosted.org/sssd/ Licencia : LGPLv3+ Descripción :Provides python2 module for manipulating users, groups, and nested groups in : SSSD when using id_provider = local in /etc/sssd/sssd.conf. : : Also provides several other useful python2 bindings: : * function for retrieving list of groups user belongs to. : * class for obfuscation of passwords
~> salt -a pam -T 'vmoracle01*' test.ping username: pablolemos password:
vmoracle01: True
Sorry for the inconvenience...
Thanks a lot!!
No problem!
I recently put a note in the pam eauth that python-sss was required for this, just fyi for anyone that comes across this in the future.
https://docs.saltstack.com/en/latest/ref/auth/all/salt.auth.pam.html
Explained the need for it here.
Note
Using PAM groups with SSSD groups on python2.
To use sssd with the PAM eauth module and groups the pysss module is needed. On RedHat/CentOS this is python-sss.
This should not be needed with python >= 3.3, because the os modules has the getgrouplist function.
https://github.com/saltstack/salt/issues/46802