Bug 827853

Summary: SELinux prevents BackupPC from reading /etc/shadow
Product: [Fedora] Fedora Reporter: Joel Uckelman <uckelman>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: dwalsh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-04 11:20:40 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 Joel Uckelman 2012-06-03 10:12:08 UTC
Description of problem:

SELinux is preventing /usr/bin/perl from open access on the file /etc/shadow.

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

If you believe that perl should be allowed open 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 BackupPC_Admin. /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


WARNING: Policy would be downgraded from version 27 to 26.
WARNING: Policy would be downgraded from version 27 to 26.
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                        BackupPC_Admin.
Source Path                   /usr/bin/perl
Port                          <Unknown>
Host                          clio.ellipsis.cx
Source RPM Packages           perl-5.14.2-211.fc17.x86_64
Target RPM Packages           setup-2.8.48-1.fc17.noarch
Policy RPM                    selinux-policy-3.10.0-125.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     clio.ellipsis.cx
Platform                      Linux clio.ellipsis.cx 3.3.7-1.fc17.x86_64 #1 SMP
                              Mon May 21 22:32:19 UTC 2012 x86_64 x86_64
Alert Count                   21
First Seen                    Sat Jun  2 12:08:38 2012
Last Seen                     Sun Jun  3 12:04:56 2012
Local ID                      856f1e50-4f23-47a5-a260-d1b6913e9442

Raw Audit Messages
type=AVC msg=audit(1338717896.437:583): avc:  denied  { open } for  pid=13521 comm="BackupPC_Admin." name="shadow" dev="dm-0" ino=41157886 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:shadow_t:s0 tclass=file


type=SYSCALL msg=audit(1338717896.437:583): arch=x86_64 syscall=open success=no exit=EACCES a0=7f96d6c3d6eb a1=80000 a2=1b6 a3=238 items=0 ppid=13029 pid=13521 auid=4294967295 uid=48 gid=48 euid=498 suid=498 fsuid=498 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm=BackupPC_Admin. exe=/usr/bin/perl subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: BackupPC_Admin.,httpd_t,shadow_t,file,open

audit2allow

#============= httpd_t ==============
allow httpd_t shadow_t:file open;

audit2allow -R

#============= httpd_t ==============
allow httpd_t shadow_t:file open;


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

BackupPC-3.2.1-7.fc17.x86_64
selinux-policy-targeted-3.10.0-125.fc17.noarch

Comment 1 Miroslav Grepl 2012-06-04 11:20:40 UTC

*** This bug has been marked as a duplicate of bug 827854 ***