Chapter 2. Configuring Kerberos authentication for the Apache HTTP web server
To use the mod_auth_gssapi Apache module on Red Hat Enterprise Linux (RHEL), configure Kerberos authentication for the Apache HTTP web server. The Generic Security Services API (GSSAPI) is an interface for applications that make requests to use Kerberos security libraries.
2.1. Setting up gss-proxy in an IdM environment Copy linkLink copied to clipboard!
To enable secure and authenticated access to Kerberos-protected resources across various services and applications, you can set up the Generic Security Services Proxy (GSS-Proxy) on the Apache HTTP web server. You can implement the gssproxy service to enable privilege separation for the httpd server. gssproxy provides security optimization to this process. Note that the mod_auth_gssapi module replaces the mod_auth_kerb module, which is no longer available in the current version of Red Hat Enterprise Linux (RHEL).
Prerequisites
-
You have installed the
httpd,mod_auth_gssapiandgssproxypackages. -
You have set up and started the
httpdservice.
Procedure
Enable access to the
keytabfile of theHTTP/<SERVER_NAME>@realmprincipal by creating the service principal:ipa service-add HTTP/<SERVER_NAME>
# ipa service-add HTTP/<SERVER_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the
keytabfor the principal stored in the/etc/gssproxy/http.keytabfile:ipa-getkeytab -s $(awk '/^server =/ {print $3}' /etc/ipa/default.conf) -k /etc/gssproxy/http.keytab -p HTTP/$(hostname -f)# ipa-getkeytab -s $(awk '/^server =/ {print $3}' /etc/ipa/default.conf) -k /etc/gssproxy/http.keytab -p HTTP/$(hostname -f)Copy to Clipboard Copied! Toggle word wrap Toggle overflow This step sets permissions to 400, therefore only the
rootuser has access to thekeytabfile. Theapacheuser does not.Create the
/etc/gssproxy/80-httpd.conffile with the following content:[service/HTTP] mechs = krb5 cred_store = keytab:/etc/gssproxy/http.keytab cred_store = ccache:/var/lib/gssproxy/clients/krb5cc_%U euid = apache
[service/HTTP] mechs = krb5 cred_store = keytab:/etc/gssproxy/http.keytab cred_store = ccache:/var/lib/gssproxy/clients/krb5cc_%U euid = apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart and enable the
gssproxyservice:systemctl restart gssproxy.service systemctl enable gssproxy.service
# systemctl restart gssproxy.service # systemctl enable gssproxy.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Obtain a Kerberos ticket:
kinit
# kinitCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the URL to the protected directory in a browser.
For details, see gssproxy(8), gssproxy-mech(8), gssproxy.conf(5) man pages on your system.