| Summary: | mod_auth_openidc could not retrieve metadata from OIDCProviderMetadataURL pointing to keycloak | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Scott Poore <spoore> |
| Component: | mod_auth_openidc | Assignee: | John Dennis <jdennis> |
| Status: | CLOSED NOTABUG | QA Contact: | Namita Soman <nsoman> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.3 | CC: | jhrozek |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-10-21 16:26:05 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: | |
|
Description
Scott Poore
2016-10-19 16:03:32 UTC
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 |