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 1855770 - auditd cannot write into reply cache (/var/tmp/krb5_0.rcache2) due to security context
Summary: auditd cannot write into reply cache (/var/tmp/krb5_0.rcache2) due to securit...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.3
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-10 12:59 UTC by Ondrej Moriš
Modified: 2020-11-04 01:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:57:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1841488 0 medium CLOSED sshd cannot write into reply cache (/var/tmp/krb5_0.rcache2) due to security context 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2020:4528 0 None None None 2020-11-04 01:57:27 UTC

Description Ondrej Moriš 2020-07-10 12:59:42 UTC
Description of problem:

After recent rebase of krb5 (1.17 -> 1.18) in RHEL-8.3.0 audit remote logging using securing communication via KRB5 stopped working with the following AVC:

time->Fri Jul 10 07:36:37 2020
type=PROCTITLE msg=audit(1594380997.750:3561): proctitle="/sbin/auditd"
type=SYSCALL msg=audit(1594380997.750:3561): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=560e5c73cf70 a2=20042 a3=180 items=0 ppid=1 pid=28528 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="auditd" exe="/usr/sbin/auditd" subj=system_u:system_r:auditd_t:s0 key=(null)
type=AVC msg=audit(1594380997.750:3561): avc:  denied  { write } for  pid=28528 comm="auditd" name="krb5_0.rcache2" dev="vda1" ino=6916127 scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:object_r:kadmind_tmp_t:s0 tclass=file permissive=0

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

selinux-policy-3.14.3-48.el8
krb5-server-1.18.2-3.el8

How reproducible:

100%

Steps to Reproduce:

1. Enable audit remote logging using KRB5 to secure communication.

Actual results:

Remote logging does not work, AVC produced.

Expected results:

Remote logging works, no AVC.

Additional info:

Works fine with krb5-server-1.17, see also BZ#1841488 for wider context.

Comment 1 Ondrej Moriš 2020-07-10 13:02:40 UTC
KRB5 is the only way to secure communication between server and clients in audit remote logging (see e.g. [1]). We have automated test case (linked) and I can help with verification of this bug.

[1] https://access.redhat.com/articles/3975971

Comment 4 Zdenek Pytela 2020-07-29 15:25:07 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/400

Comment 11 Ondrej Moriš 2020-08-17 19:03:48 UTC
There is still some selinux-related bug I am not able to investigate. I do not see any AVC - not even in permissive mode but even with selinux-policy-3.14.3-51.el8.noarch audit remote logging using KRB5 still works ONLY when both client and server are in permissive mode. File /var/tmp/krb5_0.rcache2 is krb5_host_rcache_t but it seems not to be enough. Are there any tricks how to investigate this?

In enforcing mode I see the following in the journal:

SERVER:

Aug 17 14:53:41 ci-vm-10-0-139-99.hosted.upshift.rdu2.redhat.com auditd[62901]: TCP session from ::ffff:10.0.139.243:56008 will be closed, error ignored

CLIENT:

Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com kcm[165210]: Starting up
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: GSS error: initializing context: Unspecified GSS failure.  Minor code may provide more information
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: GSS error: initializing context: No Kerberos credentials available (default cache: KCM:)
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: startup network failure, First attempt at connecting to server unsuccessful
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: socket already setup
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: GSS error: encrypting message: A required input parameter could not be read
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: GSS error: encrypting message: No context has been established
Aug 17 14:53:40 ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com audisp-remote[165188]: kerberos principal: auditd/ci-vm-10-0-139-243.hosted.upshift.rdu2.redhat.com.COM

When I switch both server and client to permissive and restard auditd on both sides, it work just fine but I do not see any AVC (even with disabled dontaudit rules).

Comment 12 Zdenek Pytela 2020-08-19 10:07:25 UTC
Ondrej,

Disabling dontaudit rules is the only way how to disclose any hidden denials:

  # semodule -DB

I'd rather try it first in enforcing mode as in permissive subsequent denials are not audited.

Comment 15 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


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