Bug 1532001

Summary: SELinux is preventing /usr/sbin/unix_chkpwd from using the dac_read_search capability
Product: Red Hat Enterprise Linux 7 Reporter: srakitnican <samuel.rakitnican>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NEXTRELEASE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: lvrabec, mgrepl, mmalik, plautrba, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-08 09:31:16 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 srakitnican 2018-01-07 10:32:23 UTC
SELinux is preventing /usr/sbin/unix_chkpwd from using the dac_read_search capability.

*****  Plugin dac_override (91.4 confidence) suggests   **********************

If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
Then turn on full auditing to get path information about the offending file and generate the error again.
Do

Turn on full auditing
# auditctl -w /etc/shadow -p w
Try to recreate AVC. Then execute
# ausearch -m avc -ts recent
If you see PATH record check ownership/permissions on file, and fix it,
If you see PATH record check ownership/permissions on file, and fix it,
otherwise report as a bugzilla.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that unix_chkpwd should have the dac_read_search capability 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 'unix_chkpwd' --raw | audit2allow -M my-unixchkpwd
# semodule -i my-unixchkpwd.pp


Additional Information:
Source Context                system_u:system_r:chkpwd_t:s0-s0:c0.c1023
Target Context                system_u:system_r:chkpwd_t:s0-s0:c0.c1023
Target Objects                /etc/shadow [ capability ]
Source                        unix_chkpwd
Source Path                   /usr/sbin/unix_chkpwd
Port                          <Unknown>
Host                          crnigrom
Source RPM Packages           pam-1.1.8-18.el7.x86_64
Target RPM Packages           setup-2.8.71-7.el7.noarch
Policy RPM                    selinux-policy-3.13.1-166.el7_4.7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     crnigrom
Platform                      Linux crnigrom 4.14.6-1.el7.elrepo.x86_64 #1 SMP
                              Thu Dec 14 09:52:47 EST 2017 x86_64 x86_64
Alert Count                   19969
First Seen                    2017-10-27 19:40:01 CEST
Last Seen                     2018-01-07 11:20:01 CET
Local ID                      33366ddd-db20-4ede-a585-034516071bad

Raw Audit Messages
type=AVC msg=audit(1515320401.605:105916): avc:  denied  { dac_read_search } for  pid=1681 comm="unix_chkpwd" capability=2  scontext=system_
u:system_r:chkpwd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:chkpwd_t:s0-s0:c0.c1023 tclass=capability permissive=0


type=SYSCALL msg=audit(1515320401.605:105916): arch=x86_64 syscall=open success=yes exit=ESRCH a0=7ff57a28c453 a1=80000 a2=1b6 a3=24 items=1
 ppid=1680 pid=1681 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=unix_chkpwd exe=/
usr/sbin/unix_chkpwd subj=system_u:system_r:chkpwd_t:s0-s0:c0.c1023 key=(null)

type=CWD msg=audit(1515320401.605:105916): cwd=/

type=PATH msg=audit(1515320401.605:105916): item=0 name=/etc/shadow inode=2097668 dev=08:02 mode=0100000 ouid=0 ogid=0 rdev=00:00 obj=system
_u:object_r:shadow_t:s0 nametype=NORMAL cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0

Hash: unix_chkpwd,chkpwd_t,chkpwd_t,capability,dac_read_search

Comment 2 Lukas Vrabec 2018-01-08 09:31:16 UTC
Hello, 

This will be fixed in next minor release. 

Thanks,
Lukas.

Comment 3 Milos Malik 2018-01-08 09:36:24 UTC
As soon as RHEL-7.5 becomes GA.