Bug 1374572

Summary: SELinux prevents PAM in cockpit-session from resetting expired passwords
Product: Red Hat Enterprise Linux 7 Reporter: Stef Walter <stefw>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED CURRENTRELEASE QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: lvrabec, mgrepl, mmalik, plautrba, pvrabec, ssekidde, stefw
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-100.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-23 12:52:03 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 Stef Walter 2016-09-09 06:09:09 UTC
Description of problem:

SELinux prevents the PAM stack running in cockpit-session from doing the usual reset of an expired password:

Unexpected journal message 'type=1400 audit(1473362821.508:6): avc:  denied  { search } for  pid=971 comm="cockpit-session" name="cracklib" dev="vda3" ino=105006 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:crack_db_t:s0 tclass=dir'
Unexpected journal message 'type=1400 audit(1473362821.511:7): avc:  denied  { read } for  pid=971 comm="cockpit-session" name="pw_dict.pwd" dev="vda3" ino=105282 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:crack_db_t:s0 tclass=file'
Unexpected journal message 'type=1400 audit(1473362821.513:8): avc:  denied  { open } for  pid=971 comm="cockpit-session" path="/usr/share/cracklib/pw_dict.pwd" dev="vda3" ino=105282 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:crack_db_t:s0 tclass=file'
Unexpected journal message 'type=1400 audit(1473362821.514:9): avc:  denied  { getattr } for  pid=971 comm="cockpit-session" path="/usr/share/cracklib/pw_dict.pwi" dev="vda3" ino=105283 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:crack_db_t:s0 tclass=file'
Unexpected journal message 'type=1400 audit(1473362821.549:10): avc:  denied  { write } for  pid=971 comm="cockpit-session" name=".pwd.lock" dev="vda3" ino=8592827 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:passwd_file_t:s0 tclass=file'
Unexpected journal message 'type=1400 audit(1473362821.569:11): avc:  denied  { create } for  pid=971 comm="cockpit-session" name="nshadow" scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:shadow_t:s0 tclass=file'
Unexpected journal message 'type=1400 audit(1473362821.571:12): avc:  denied  { write } for  pid=971 comm="cockpit-session" path="/etc/nshadow" dev="vda3" ino=9404257 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:shadow_t:s0 tclass=file'
Unexpected journal message 'type=1400 audit(1473362821.572:13): avc:  denied  { setattr } for  pid=971 comm="cockpit-session" name="nshadow" dev="vda3" ino=9404257 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:shadow_t:s0 tclass=file'

Version-Release number of selected component (if applicable):

 selinux-policy-targeted-3.13.1-93.el7.noarch
 docker-selinux-1.10.3-46.el7.10.x86_64
 selinux-policy-3.13.1-93.el7.noarch

How reproducible:

Happens regularly in Cockpit integration testing:

https://fedorapeople.org/groups/cockpit/logs/pull-4993-ca895051-verify-rhel-7/log

Comment 1 Stef Walter 2016-09-09 06:09:25 UTC
Broken feature: https://github.com/cockpit-project/cockpit/pull/4993

Comment 5 Stef Walter 2016-09-09 18:12:31 UTC
Tracker for when this happens during Cockpit integration tests:

https://github.com/cockpit-project/cockpit/issues/5010

Similar Fedora bug: 

https://bugzilla.redhat.com/show_bug.cgi?id=1374262