This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2151600 - SELinux is preventing /usr/libexec/certmonger/ipa-submit from name_connect access on tcp_socket port 443
Summary: SELinux is preventing /usr/libexec/certmonger/ipa-submit from name_connect ac...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: cockpit
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Martin Pitt
QA Contact: Jan Ščotka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-07 15:38 UTC by Carlos Mogas da Silva
Modified: 2024-01-14 04:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-15 13:23:59 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-3997 0 None Migrated None 2023-09-15 13:23:56 UTC
Red Hat Issue Tracker RHELPLAN-141568 0 None None None 2022-12-07 15:44:38 UTC

Description Carlos Mogas da Silva 2022-12-07 15:38:21 UTC
Description of problem:

I was following this guide to set up SSL for cockpit based on the FreeIPA host, and issuing the `ipa-getcert request` command, the request status says CA_UNAVAILABLE.
While debugging the problem, I stumbled across SELinux complaining about ipa-submit (which is not able to talk to the CA Server).


Version-Release number of selected component (if applicable): 0.79.14-5.el9


How reproducible: Always


Steps to Reproduce:
1. Install ipa-client
2. Try to request a certificate using ipa-getcert to a host on the IPA server

Actual results:
certmonger/ipa-submit can't talk to the IPA server


Expected results:
Certificate should be issued and TRACKED by certmonger.

Additional info:
FreeIPA server is living on another host.

Comment 1 Rob Crittenden 2022-12-07 16:05:24 UTC
Following what guide?

Can you provide the full AVC output? Perhaps ausearch -m AVC for full context.

Comment 2 Carlos Mogas da Silva 2022-12-07 16:09:44 UTC
> Following what guide?
Oops... forgot to link to it (sorry): https://100things.wzzrd.com/2021/06/10/Proper-SSL-certs-in-cockpit.html(In reply to Rob Crittenden from comment #1)


> Can you provide the full AVC output? Perhaps ausearch -m AVC for full
> context.
time->Wed Dec  7 15:11:19 2022
type=PROCTITLE msg=audit(1670425879.796:148): proctitle="/usr/libexec/certmonger/ipa-submit"
type=SYSCALL msg=audit(1670425879.796:148): arch=c000003e syscall=42 success=no exit=-13 a0=4 a1=7ffe53573ab0 a2=10 a3=7ffe53599080 items=0 ppid=1797 pid=2015 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ipa-submit" exe="/usr/libexec/certmonger/ipa-submit" subj=system_u:system_r:certmonger_t:s0 key=(null)
type=AVC msg=audit(1670425879.796:148): avc:  denied  { name_connect } for  pid=2015 comm="ipa-submit" dest=443 scontext=system_u:system_r:certmonger_t:s0 tcontext=system_u:object_r:websm_port_t:s0 tclass=tcp_socket permissive=0


Have a bunch of this, but the "content" is always the same. It's just the retries I made trying to understand what was going on.

Comment 3 Rob Crittenden 2022-12-07 16:41:05 UTC
It is failing due to changing the context of the port, per the guide:

$ sudo semanage port -m -t websm_port_t -p tcp 443

certmonger does not manage its own SELinux policy. Overriding a port like this seems like it may break a lot of tools. Trying to install a custom policy to override http_port_t will fail because of policy priority differences so it may not be as simple as a custom policy.

Re-assigning to selinux-policy for review.

Comment 4 Carlos Mogas da Silva 2022-12-07 18:30:54 UTC
thx Rob. Since that was the problem, I've reverted the change and just made a local port forward using firewalld to be able to access :433 and keep all the selinux stuff intact. I really don't wanna mess with that.

Anyway, I'll leave this open for the selinux folks just in case anyone wants some more info or test a way to do this. If anyone wants to close this as NOTABUG, not a problem for me.

Comment 6 Nikola Knazekova 2023-01-11 12:36:39 UTC
Hi Carlos,

can you post here the guide where it was suggested to change the port?

Thanks,
Nikola

Comment 7 Carlos Mogas da Silva 2023-01-11 15:37:03 UTC
(In reply to nknazeko from comment #6)
> Hi Carlos,
> 
> can you post here the guide where it was suggested to change the port?
> 

It's on comment #2 ;) But I'll leave it here anyway

https://100things.wzzrd.com/2021/06/10/Proper-SSL-certs-in-cockpit.html

Comment 9 Martin Pitt 2023-01-17 05:50:57 UTC
I have some trouble understanding this. `ipa-submit` has no business talking to Cockpit -- it needs to talk to the FreeIPA server. Are you saying you moved cockpit to FreeIPA's port, and ipa-submit tries to talk to Cockpit instead?

Also, admittedly I don't know ipa-submit -- normally you'd use ipa-getcert request, see https://cockpit-project.org/guide/latest/https.html#https-certificates

What exactly are you doing? Please describe step by step what you did.

Note that current cockpit versions don't care about the permissions and ownership of the files in /etc/cockpit/ws-certs.d/, so you don't normally need to fumble around with SELinux contexts there. If you change cockpit's port away from 9090, you need a command like in https://cockpit-project.org/guide/latest/listen.html, but you already figured that out. However, that has nothing to do with FreeIPA.

Thanks!

Comment 11 RHEL Program Management 2023-09-15 13:22:05 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 12 RHEL Program Management 2023-09-15 13:23:59 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.

Comment 13 Red Hat Bugzilla 2024-01-14 04:25:09 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


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