Bug 837566 - SELinux is preventing /usr/lib64/realmd/realmd from 'write' accesses on the directory /etc/sssd. realmd writes out /etc/sssd/sssd.conf in order to configure SSSD.
SELinux is preventing /usr/lib64/realmd/realmd from 'write' accesses on the d...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
rawhide
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:7869d1b4778b5626a90372c44e0...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-04 05:05 EDT by Stef Walter
Modified: 2012-07-15 14:14 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-15 14:14:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ausearch -m avc |grep realmd (26.08 KB, text/plain)
2012-07-10 08:05 EDT, Stef Walter
no flags Details
realmd.fc (77 bytes, application/octet-stream)
2012-07-11 10:12 EDT, Stef Walter
no flags Details
realmd.if (390 bytes, application/octet-stream)
2012-07-11 10:13 EDT, Stef Walter
no flags Details
realmd.pp (74.09 KB, application/octet-stream)
2012-07-11 10:13 EDT, Stef Walter
no flags Details
realmd.sh (1.07 KB, application/x-shellscript)
2012-07-11 10:14 EDT, Stef Walter
no flags Details
realmd.te (492 bytes, application/octet-stream)
2012-07-11 10:14 EDT, Stef Walter
no flags Details

  None (edit)
Description Stef Walter 2012-07-04 05:05:39 EDT
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.4-5.fc17.x86_64
time:           Wed 04 Jul 2012 11:05:08 AM CEST

description:
:SELinux is preventing /usr/lib64/realmd/realmd from 'write' accesses on the directory /etc/sssd.
:
:*****  Plugin catchall_labels (83.8 confidence) suggests  ********************
:
:If you want to allow realmd to have write access on the sssd directory
:Then you need to change the label on /etc/sssd
:Do
:# semanage fcontext -a -t FILE_TYPE '/etc/sssd'
:where FILE_TYPE is one of the following: var_run_t, system_dbusd_var_run_t, tmp_t, system_dbusd_tmp_t. 
:Then execute: 
:restorecon -v '/etc/sssd'
:
:
:*****  Plugin catchall (17.1 confidence) suggests  ***************************
:
:If you believe that realmd should be allowed write access on the sssd directory 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 realmd /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:system_dbusd_t:s0-s0:c0.c1023
:Target Context                system_u:object_r:etc_t:s0
:Target Objects                /etc/sssd [ dir ]
:Source                        realmd
:Source Path                   /usr/lib64/realmd/realmd
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           realmd-0.4-1.fc18.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-132.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed)
:                              3.3.4-5.fc17.x86_64 #1 SMP Mon May 7 17:29:34 UTC
:                              2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    Wed 04 Jul 2012 11:04:44 AM CEST
:Last Seen                     Wed 04 Jul 2012 11:04:44 AM CEST
:Local ID                      bd113dcb-8be0-4cbe-93e4-f3f869def254
:
:Raw Audit Messages
:type=AVC msg=audit(1341392684.11:294): avc:  denied  { write } for  pid=20044 comm="realmd" name="sssd" dev="sda7" ino=55874 scontext=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir
:
:
:type=SYSCALL msg=audit(1341392684.11:294): arch=x86_64 syscall=open success=no exit=EACCES a0=194a240 a1=c2 a2=1b6 a3=1 items=0 ppid=1 pid=20044 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=realmd exe=/usr/lib64/realmd/realmd subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 key=(null)
:
:Hash: realmd,system_dbusd_t,etc_t,dir,write
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:
Comment 1 Miroslav Grepl 2012-07-04 09:35:01 EDT
So we will need to add a policy for realmd.

The problem is we have the /etc/sssd/sssd.conf file labeled as etc_t.

Stef,
could you execute

# sepolgen -t 1 /usr/lib64/realmd/realmd
# sh realmd.sh

and re-test it.
Comment 2 Stef Walter 2012-07-06 07:01:43 EDT
Sadly no. Now it failed with:


SELinux is preventing /usr/lib64/realmd/realmd from add_name access on the directory sssd.conf.EZDDHW.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow realmd to have add_name access on the sssd.conf.EZDDHW directory
Then you need to change the label on sssd.conf.EZDDHW
Do
# semanage fcontext -a -t FILE_TYPE 'sssd.conf.EZDDHW'
where FILE_TYPE is one of the following: var_run_t, system_dbusd_var_run_t, tmp_t, system_dbusd_tmp_t. 
Then execute: 
restorecon -v 'sssd.conf.EZDDHW'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that realmd should be allowed add_name access on the sssd.conf.EZDDHW directory 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 realmd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:system_dbusd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_t:s0
Target Objects                sssd.conf.EZDDHW [ dir ]
Source                        realmd
Source Path                   /usr/lib64/realmd/realmd
Port                          <Unknown>
Host                          stef-rawhide.thewalter.lan
Source RPM Packages           realmd-0.4-1.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-134.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     stef-rawhide.thewalter.lan
Platform                      Linux stef-rawhide.thewalter.lan
                              3.3.4-5.fc17.x86_64 #1 SMP Mon May 7 17:29:34 UTC
                              2012 x86_64 x86_64
Alert Count                   1
First Seen                    Fri 06 Jul 2012 01:00:15 PM CEST
Last Seen                     Fri 06 Jul 2012 01:00:15 PM CEST
Local ID                      29f15f6d-6293-447c-b7fb-4a11a9163637

Raw Audit Messages
type=AVC msg=audit(1341572415.618:206): avc:  denied  { add_name } for  pid=23101 comm="realmd" name="sssd.conf.EZDDHW" scontext=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir


type=SYSCALL msg=audit(1341572415.618:206): arch=x86_64 syscall=open success=no exit=EACCES a0=2460480 a1=c2 a2=1b6 a3=1 items=0 ppid=1 pid=23101 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=realmd exe=/usr/lib64/realmd/realmd subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 key=(null)

Hash: realmd,system_dbusd_t,etc_t,dir,add_name

audit2allowunable to open /sys/fs/selinux/policy:  Permission denied


audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
Comment 3 Stef Walter 2012-07-06 07:03:07 EDT
Also:

Raw Audit Messages
type=AVC msg=audit(1341572415.617:205): avc:  denied  { open } for  pid=25695 comm="realmd" name="net" dev="sda7" ino=135294 scontext=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:samba_net_exec_t:s0 tclass=file


type=SYSCALL msg=audit(1341572415.617:205): arch=x86_64 syscall=execve success=no exit=EACCES a0=242add0 a1=245f150 a2=245ef10 a3=7fff542e7010 items=0 ppid=23101 pid=25695 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=realmd exe=/usr/lib64/realmd/realmd subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 key=(null)

Hash: realmd,system_dbusd_t,samba_net_exec_t,file,open
Comment 4 Miroslav Grepl 2012-07-09 02:32:03 EDT
# ls -Z /usr/lib64/realmd/realmd


Also could you ping me?
Comment 5 Stef Walter 2012-07-10 07:34:41 EDT
[stef@stef-rawhide glib]$ ls -Z /usr/lib64/realmd/realmd
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       /usr/lib64/realmd/realmd
Comment 6 Stef Walter 2012-07-10 08:05:30 EDT
Created attachment 597321 [details]
ausearch -m avc |grep realmd
Comment 7 Miroslav Grepl 2012-07-11 07:17:48 EDT
Ok, now we have realmd_t. Could you attach realmd.* policy files.
Comment 8 Stef Walter 2012-07-11 10:12:42 EDT
Created attachment 597586 [details]
realmd.fc
Comment 9 Stef Walter 2012-07-11 10:13:00 EDT
Created attachment 597587 [details]
realmd.if
Comment 10 Stef Walter 2012-07-11 10:13:17 EDT
Created attachment 597588 [details]
realmd.pp
Comment 11 Stef Walter 2012-07-11 10:14:05 EDT
Created attachment 597589 [details]
realmd.sh
Comment 12 Stef Walter 2012-07-11 10:14:25 EDT
Created attachment 597590 [details]
realmd.te
Comment 13 Miroslav Grepl 2012-07-12 03:33:53 EDT
Ok, I added the policy to rawhide. Is the policy needed also for F17?
Comment 14 Stef Walter 2012-07-14 08:23:05 EDT
I don't think so. realmd is a new package in F18.

Note You need to log in before you can comment on or make changes to this bug.