Bug 1318496

Summary: SELinux is preventing unix_chkpwd from 'read' accesses on the file /etc/shadow.
Product: [Fedora] Fedora Reporter: Chen_Min_Chin <tcfxfzoi>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:116d694de9ce6a51fa40654e78184f49fee690ac15edfdc02f70740b65c0f6c3;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-21 10:03:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chen_Min_Chin 2016-03-17 05:02:43 UTC
Description of problem:
SELinux is preventing unix_chkpwd from 'read' accesses on the file /etc/shadow.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that unix_chkpwd should be allowed read access on the shadow file 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 unix_chkpwd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:shadow_t:s0
Target Objects                /etc/shadow [ file ]
Source                        unix_chkpwd
Source Path                   unix_chkpwd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           setup-2.10.1-1.fc23.noarch
Policy RPM                    selinux-policy-3.13.1-158.9.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.4.4-301.fc23.x86_64 #1 SMP Fri
                              Mar 4 17:42:42 UTC 2016 x86_64 x86_64
Alert Count                   2
First Seen                    2016-03-17 12:07:39 CST
Last Seen                     2016-03-17 12:07:39 CST
Local ID                      396210f8-f215-40e7-8f27-e004c1b30f8f

Raw Audit Messages
type=AVC msg=audit(1458187659.490:461): avc:  denied  { read } for  pid=6256 comm="unix_chkpwd" name="shadow" dev="dm-1" ino=1182133 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:shadow_t:s0 tclass=file permissive=0


Hash: unix_chkpwd,httpd_t,shadow_t,file,read

Version-Release number of selected component:
selinux-policy-3.13.1-158.9.fc23.noarch

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.4-301.fc23.x86_64
type:           libreport

Comment 1 Daniel Walsh 2016-03-17 20:08:45 UTC
Allowing the apache process to read the /etc/shadow file seems like a bad idea.