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 2117199

Summary: RHEL8.7 AVC during ipa trust-add
Product: Red Hat Enterprise Linux 8 Reporter: anuja <amore>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.7CC: lvrabec, mmalik, ssekidde
Target Milestone: rcKeywords: Triaged
Target Release: 8.7Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-107.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2114902 Environment:
Last Closed: 2022-11-08 10:44:31 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 anuja 2022-08-10 10:00:13 UTC
Description of problem:
AVC during ipa trust-add

Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-105.el8.noarch
ipa-server-4.9.10-5.module+el8.7.0+16195+c459c321.x86_64

How reproducible:
Always

Steps to Reproduce:
1. install IPA server with 
ipa-server-install -n ipa.test -r IPA.TEST -p Secret.123 -a Secret.123 --domain-level=1 -U --setup-dns --auto-forwarders --auto-reverse
2. configure as trust domain controller with
ipa-adtrust-install -U --enable-compat --netbios-name IPA -a Secret.123 --add-sids
3. obtain an admin  ticket with
kinit admin
4. systemctl restart smb
4. add a trust with AD:
ipa trust-add --type ad ad.test --admin Administrator --password
5. check the credential cache, it contains a ticket for cifs/master.ipa.test instead of admin

Actual results:
[root@master ~]# klist 
Ticket cache: KCM:0
Default principal: cifs/master.ipa.test


Expected results:
[root@master ~]# klist 
Ticket cache: KCM:0
Default principal: admin

Comment 1 Zdenek Pytela 2022-08-10 10:09:17 UTC
Can you please attach

  # ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts today

and audit.log?

Comment 4 Zdenek Pytela 2022-08-19 15:42:20 UTC
Hello,

The reproducing steps do not work completely for me, I keep getting an error in the last step:

# systemctl restart smb
# ipa trust-add --type ad ad.test --admin Administrator --password
Active Directory domain administrator's password: 
ipa: ERROR: Cannot find specified domain or server name
# klist
Ticket cache: KCM:0
Default principal: cifs/hp-z210-01.domain.com

Is there anything else needed to have configured?
Is any particular ipa version required and where we can get it?

Can you also try the following SELinux module if it makes any change?

  # cat local_rpcdlsad_netadmin.cil
(allow winbind_rpcd_t winbind_rpcd_t (capability (net_admin)))
  # semodule -i local_rpcdlsad_netadmin.cil
<then reproduce again>

Comment 7 Zdenek Pytela 2022-08-25 10:00:20 UTC
The install command on a current RHEL 8.7 system fails:

  [16/29]: configure certmonger for renewals
  [error] CalledProcessError: CalledProcessError(Command ['/bin/systemctl', 'start', 'certmonger.service'] returned non-zero exit status 1: 'Job for certmonger.service failed because the control process exited with error code.\nSee "systemctl status certmonger.service" and "journalctl -xe" for details.\n')
CalledProcessError(Command ['/bin/systemctl', 'start', 'certmonger.service'] returned non-zero exit status 1: 'Job for certmonger.service failed because the control process exited with error code.\nSee "systemctl status certmonger.service" and "journalctl -xe" for details.\n')
The ipa-server-install command failed. See /var/log/ipaserver-install.log for more informatio

Is it okay to postpone this bz to the next release?
Can you provide me a configured system?

Possibly one of these modules can resolve the issue:
(allow httpd_t httpd_t (capability (net_admin)))
-or-
(allow chkpwd_t user_devpts_t (chr_file (read write)))

Comment 18 errata-xmlrpc 2022-11-08 10:44:31 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-2022:7691