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.
I ran a test with strace watching httpd process and saw this:
1197 10:25:58 connect(15, {sa_family=AF_INET, sin_port=htons(18080), sin_addr=inet_addr("192.168.122.151")}, 16) = -1 EACCES (Permission denied)
I'm not sure why this connect would be failing from httpd when wget/curl works.
So, I thought I'd try hiding the port with a reverse proxy on the Keycloak server like this:
[root@vm1 ~]# cat /etc/httpd/conf.d/openid-proxy.conf
ProxyPass "/openid-configuration" "http://vm1.example.com:18080/auth/realms/test_realm/.well-known/openid-configuration"
Then point to that for the OIDCProviderMetadataURL:
OIDCProviderMetadataURL http://vm1.example.com/openid-configuration
Now, when I go to the /private page from a web browser it works and I'm prompted to login.
So, is there another way to specify the port for that config?
This might be an SELinux issue, httpd is heavily restricted by default. Does the original configuration work if you put the system in permissive mode? Are there any AVC's in the audit log?
I thought I'd checked for AVCs but, apparently missed it somewhere. I do see this:
type=SYSCALL msg=audit(1476921957.945:109): arch=c000003e syscall=42 success=no exit=-13 a0=f a1=7ffe3c564990 a2=10 a3=0 items=0 ppid=2236 pid=2240 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1476921957.945:109): avc: denied { name_connect } for pid=2240 comm="httpd" dest=18080 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
A little more info too. I setup a new env with the IPA server and IdP separated. I configured Keycloak to use port 80 and 443 so no custom ports were needed in urls. This seemed to work. I'm able to login now. So, this is probably just the AVC. I'll setup my combined server tomorrow and confirm it works if I enable a new rule for the port access.
Ok, this is necessary to resolve the issue:
setsebool httpd_can_network_connect=on
Since this is normal httpd behavior, I'm closing this one as NOTABUG.
Thanks for the help