Bug 1001703 - SELinux is preventing /usr/libexec/sssd/krb5_child from 'write' accesses on the key .
SELinux is preventing /usr/libexec/sssd/krb5_child from 'write' accesses on t...
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
19
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
abrt_hash:0e273eb3a58d6ccbe7b82f26898...
:
Depends On: 1063827
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-27 10:38 EDT by Stephen Gallagher
Modified: 2015-02-18 06:25 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-18 06:25:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Gallagher 2013-08-27 10:38:16 EDT
Description of problem:
We are adding a new kerberos credential cache type that uses the kernel keyring. We need to design policy for this access to ensure that these credential caches are properly secured and accessible by the appropriate usages.

Essentially, a keyring should be accessible by the owning UID from any process or by root from the 'sssd_be' or 'krb5_child' processes only.
SELinux is preventing /usr/libexec/sssd/krb5_child from 'write' accesses on the key .

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

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

Additional Information:
Source Context                system_u:system_r:sssd_t:s0
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                 [ key ]
Source                        krb5_child
Source Path                   /usr/libexec/sssd/krb5_child
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           sssd-krb5-common-1.11.0-0.1.beta2.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-73.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.10.9-200.fc19.x86_64 #1 SMP Wed
                              Aug 21 19:27:58 UTC 2013 x86_64 x86_64
Alert Count                   9
First Seen                    2013-08-19 08:23:56 EDT
Last Seen                     2013-08-27 10:22:15 EDT
Local ID                      d02477e3-16b2-4c3b-8dde-0fffdb8b26f3

Raw Audit Messages
type=AVC msg=audit(1377613335.365:649): avc:  denied  { write } for  pid=27579 comm="krb5_child" scontext=system_u:system_r:sssd_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=key


type=SYSCALL msg=audit(1377613335.365:649): arch=x86_64 syscall=add_key success=yes exit=225259422 a0=3afb68ac23 a1=3afb68ac3e a2=0 a3=0 items=0 ppid=27274 pid=27579 auid=4294967295 uid=13041 gid=13041 euid=13041 suid=13041 fsuid=13041 egid=13041 sgid=13041 fsgid=13041 ses=4294967295 tty=(none) comm=krb5_child exe=/usr/libexec/sssd/krb5_child subj=system_u:system_r:sssd_t:s0 key=(null)

Hash: krb5_child,sssd_t,unconfined_t,key,write

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.10.9-200.fc19.x86_64
type:           libreport
Comment 1 Simo Sorce 2013-08-27 10:44:18 EDT
Note we will need access also from rpc.gssd when nfs with sec=krb5 is configured.
Openssh may also need to create/access the keyring to store forwarded credentials or create a new ccache when pam_krb5 is used.
Comment 2 Anthony Messina 2014-02-08 18:30:58 EST
I needed the following when "default_ccache_name = KEYRING:persistent:%{uid}" is added to /etc/krb5.conf, using selinux-policy-3.12.1-119.fc20.


module fixkernelkeyring 1.0;

require {
        type sssd_t;
        type gssd_t;
        class key { write setattr read view };
}

#============= gssd_t ==============
allow gssd_t sssd_t:key { read write setattr };

#============= sssd_t ==============
allow sssd_t gssd_t:key { read write view };
Comment 3 Alexander Bokovoy 2014-02-12 14:44:00 EST
For F20 I have created bug 1063827.
Comment 4 Daniel Walsh 2014-02-14 13:15:56 EST
These are more mislabeled keys.  We do not label keys correctly.  I am pretty sure the keys here are owned by an unconfined_t process.  Not sshd_t or gssd_t.
But they are getting labeled incorrectly.  
sssd_t should be calling setkeycreatecon(USERTYPE) before creating the key, to get it to make some sense.  ALso I have no idea why there is a gssd_t key?  Is this also a key owned by a user?  Or does gssd create its own keyring?
Comment 5 Simo Sorce 2014-02-14 13:52:01 EST
I supposed that this happens when rpc.gssd acquires a ticket on behalf of the user. When a iuser walks an NFS mountpoint rpc.gssd will lookup the credentials and if not available will acquire a ticket for the remote NFS server. This ticket is stored in a key and linked to the user keyring.
Comment 6 Daniel Walsh 2014-02-14 15:42:19 EST
Does the keyring end up with the equivalent of the UID of the user?  If so we really need to get the keyring to be labeled as the users label keyring.

unconfined_u:unconfined_r:unconfined_t:s0

If the user process was running, it could just do a 

getpidcon or getpeercon of the user process and then a setkeycreatecon() before creating the keyring.
Comment 7 Fedora End Of Life 2015-01-09 17:16:34 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 8 Fedora End Of Life 2015-02-18 06:25:20 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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