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 1853432 - ipa trust-add fails with 'Fetching domains from trusted forest failed'
Summary: ipa trust-add fails with 'Fetching domains from trusted forest failed'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.3
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1845596 1869311
TreeView+ depends on / blocked
 
Reported: 2020-07-02 16:19 UTC by Alexander Bokovoy
Modified: 2020-11-04 01:58 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1869311 (view as bug list)
Environment:
Last Closed: 2020-11-04 01:56:46 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4528 0 None None None 2020-11-04 01:57:16 UTC

Description Alexander Bokovoy 2020-07-02 16:19:54 UTC
This bug was initially created as a copy of Bug #1845596

The purpose of this bug is to track delivery of selinux-policy fix to oddjob selinux policy module.



The core of the issue is an AVC that is marked as don't audit in SELinux policy.

When starting the helper to retrieve information about trusted domains, oddjobd uses `execve()` function.
It looks like in RHEL 8.3 and Fedora 32 its processing on a transition between oddjob_t and ipa_helper_t SELinux domains breaks something in underlying libraries loaded by the IPA helper. The helper written in Python and uses bindings to Samba which also internally load libkrb5.

With disabled dontaudit SELinux rules we see following AVCs:

type=AVC msg=audit(1593698019.970:2915): avc:  denied  { noatsecure } for  pid=33476 comm="oddjobd" scontext=system_u:system_r:oddjob_t:s0-s0:c0.c1023 tcontext=system_u:system_r:ipa_helper_t:s0 tclass=process permissive=1
type=AVC msg=audit(1593698019.971:2916): avc:  denied  { rlimitinh } for  pid=33476 comm="com.redhat.idm." scontext=system_u:system_r:oddjob_t:s0-s0:c0.c1023 tcontext=system_u:system_r:ipa_helper_t:s0 tclass=process permissive=1
type=AVC msg=audit(1593698019.971:2917): avc:  denied  { siginh } for  pid=33476 comm="com.redhat.idm." scontext=system_u:system_r:oddjob_t:s0-s0:c0.c1023 tcontext=system_u:system_r:ipa_helper_t:s0 tclass=process permissive=1
type=AVC msg=audit(1593698022.000:2918): avc:  denied  { read } for  pid=33479 comm="ipa-getkeytab" name="config" dev="vda1" ino=156614 scontext=system_u:system_r:ipa_helper_t:s0 tcontext=system_u:object_r:selinux_config_t:s0 tclass=file permissive=1
type=AVC msg=audit(1593698022.001:2919): avc:  denied  { open } for  pid=33479 comm="ipa-getkeytab" path="/etc/selinux/config" dev="vda1" ino=156614 scontext=system_u:system_r:ipa_helper_t:s0 tcontext=system_u:object_r:selinux_config_t:s0 tclass=file permissive=1
type=AVC msg=audit(1593698022.001:2920): avc:  denied  { getattr } for  pid=33479 comm="ipa-getkeytab" path="/etc/selinux/config" dev="vda1" ino=156614 scontext=system_u:system_r:ipa_helper_t:s0 tcontext=system_u:object_r:selinux_config_t:s0 tclass=file permissive=1
Out of these, rlimitinh and siginh can be ignored but noatsecure denial is important. If it is allowed, the helper successfully does it work. If it is denied, Samba Python bindings could not properly initialize Kerberos principal from the current credentials cache. It should be a trusted domain object's principal from an Active Directory domain's realm but it is initialized as a principal from IPA's own realm. The difference might be subtle but the consequence is that the helper would request a cross-realm referral to Active Directory domain, effectively asking for an outgoing trust leg. However, this trust leg will not exist for a one-way trust and the whole processing will fail.

Once noatsecure was allowed, libkrb5 was able to import the Kerberos principal with Active Directory domain's realm and avoid asking for a cross-realm referral. Instead, it talked directly to AD DCs, avoiding the whole problem.

To fix this, we need two changes:

1. An extension of IPA SELinux policy: https://github.com/freeipa/freeipa/pull/4882

2. Use of IPA SElinux policy interface in oddjob SELinux policy: https://github.com/fedora-selinux/selinux-policy-contrib/pull/293

Comment 2 Alexander Bokovoy 2020-07-06 08:25:32 UTC
https://github.com/fedora-selinux/selinux-policy-contrib/pull/293 is merged upstream

Comment 19 Mohammad Rizwan 2020-07-27 11:42:40 UTC
version:
selinux-policy-3.14.3-49.el8.noarch

Based on comment#12, marking the bug as verified.

Comment 35 errata-xmlrpc 2020-11-04 01:56:46 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.