Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1863043

Summary: kadmind doesn't have an access to /var/tmp/krb5_0.rcache2 when selinux label is set to krb5_host_rcache_t
Product: Red Hat Enterprise Linux 8 Reporter: Filip Dvorak <fdvorak>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: lvrabec, mmalik, plautrba, ssekidde
Target Milestone: rcKeywords: AutoVerified
Target Release: 8.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:57: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 Filip Dvorak 2020-08-03 14:26:52 UTC
Description of problem:
According to BZ#1855770 (comment#3) the default label for the replaycache will be set to "krb5_host_rcache_t" but with this label the kadmind doesn't have an acces to replay cache and therefore the remote access to the KDC database via kadmin fails.

Version-Release number of selected component (if applicable):
RHEL-8.3
# rpm -qa | grep -e krb5 -e selinux-policy
selinux-policy-targeted-3.14.3-49.el8.noarch
selinux-policy-3.14.3-49.el8.noarch
krb5-server-1.18.2-3.el8.x86_64
krb5-workstation-1.18.2-3.el8.x86_64
krb5-libs-1.18.2-3.el8.x86_64


How reproducible:
Always

Steps to Reproduce:
1. Install and configure krb5kdc and kadmin

hostnamectl set-hostname kerberos.example.com
sed -i "1i 127.0.0.1 kerberos.example.com" /etc/hosts
echo -ne '[realms]\nEXAMPLE.COM = {\n    kdc = kerberos.example.com\n    admin_server = kerberos.example.com\n}\n\n[domain_realm]\n.example.com = EXAMPLE.COM\nexample.com = example.com\n' > /etc/krb5.conf.d/example_com
sed -i "s/^# default_realm/ default_realm/" /etc/krb5.conf
echo -ne "passwd\npasswd\n" | kdb5_util create -s
systemctl start krb5kdc kadmin
 
kadmin.local -r EXAMPLE.COM -q "addprinc -pw passwd root/admin"
kadmin.local -r EXAMPLE.COM -q "addprinc -randkey host/localhost
kadmin.local -r EXAMPLE.COM -q "ktadd host/localhost"
kadmin.local -r EXAMPLE.COM -q "ank -pw passwd bob"
kadmin.local -r EXAMPLE.COM -q "ank -pw passwd bob/admin"

2. set KerberosAuthentication and KerberosTicketCleanup in /ets/sshd_config to yes
3. echo passwd | kinit bob
4. ssh bob.com
5. chcon -t krb5_host_rcache_t /var/tmp/krb5_0.rcache2


Actual results:
# kadmin -p bob/admin
Authenticating as principal bob/admin with password.
Password for bob/admin: 
kadmin: GSS-API (or Kerberos) error while initializing kadmin interface

Expected results:
[root@kerberos ~]# kadmin -p bob/admin
Authenticating as principal bob/admin with password.
Password for bob/admin: 
kadmin:  

Additional info:
AVC:
time->Mon Aug  3 10:08:18 2020
type=PROCTITLE msg=audit(1596463698.887:694): proctitle=2F7573722F7362696E2F6B61646D696E64002D50002F7661722F72756E2F6B61646D696E642E706964
type=SYSCALL msg=audit(1596463698.887:694): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=55c2a02ed0c0 a2=20042 a3=180 items=0 ppid=1 pid=7534 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="kadmind" exe="/usr/sbin/kadmind" subj=system_u:system_r:kadmind_t:s0 key=(null)
type=AVC msg=audit(1596463698.887:694): avc:  denied  { write } for  pid=7534 comm="kadmind" name="krb5_0.rcache2" dev="vda1" ino=6717156 scontext=system_u:system_r:kadmind_t:s0 tcontext=system_u:object_r:krb5_host_rcache_t:s0 tclass=file permissive=0

Comment 2 Zdenek Pytela 2020-08-03 15:02:18 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy-contrib/pull/319

Comment 13 errata-xmlrpc 2020-11-04 01:57:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (selinux-policy bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4528