For my own reference/sanity while implementing/configuring delegation on linux in java. Likely full of errors, please help...
Client needs to log in to the authentication service without sending their password over the network
We can use this TGT to authorize our user to the service
This new client-service ticket is used to send the service the new session key and proves the user's identity.
Ensure capitalization is correct!
System.setProperty("java.security.auth.login.config", "/tmp/login.conf");
System.setProperty("java.security.krb5.conf","/etc/krb5.conf");
System.setProperty("java.security.krb5.realm","EXAMPLE.COM");
System.setProperty("java.security.krb5.kdc","kerberos.example.com");
System.setProperty("javax.security.auth.useSubjectCredsOnly","false");
KrbLogin {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
storeKey=true
keyTab="file:///etc/krb5.keytab"
useTicketCache=true
principal="HTTP/localhost@EXAMPLE.COM"
debug=true;
};
com.sun.security.jgss.initiate {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
storeKey=true
keyTab="//etc/krb5.keytab"
useTicketCache=true
principal="HTTP/localhost@EXAMPLE.COM"
debug=true;
};
[libdefaults]
default_realm = EXAMPLE.COM
[realms]
EXAMPLE.COM = {
admin_server = kerberos.example.com
kdc = kerberos.example.com
}
[domain_realm]
example.com = EXAMPLE.COM
.example.com = EXAMPLE.com
[logging]
kdc = SYSLOG:NOTICE
admin_server = SYSLOG:NOTICE
default = SYSLOG:NOTICE
In Windows 2000 delegation works by "trusting" a machine for delegation and then allowing that machine to forward a user's TGT to a remote service. Two issues:
So if you have a web server that's only exposed to the internet through a proxy the user accessing your web server can't request that the service on the web server delegates their credentials without the site administrator exposing the KDC to the internet. The solution was to create a series of Service-for-User (S4U) extensions.
Instead of forwarding the user's TGT, this extension presents the user's service ticket to the KDC to prove the user's identity. This works well for establishing trust but still requires that the user is authorized to the service through Kerberos exposing the KDC to the user's network.
This extension defines a "protocol transition" service that allows for interoperability of Kerberos and the authentication protocols between the user and the intermediate web service. The distinction between this and S4U2Proxy is that the web service is required to have a valid TGT. The configuration of the gateway service specifies the SPNs for which delegation is allowed as well as the port and/or protocol.
krbAllowToDelegateTo
to the principal
you want to impersonatekinit -f <principal>
or set forwardable = true
in your krb5.confkadmin.local
you need to add the binddn/bindpwd
options so it uses the root DN(objectClass=krbRealmContainer)
can be something like
dn: cn=ATHENA.ERICLEE.DEV,cn=kerberos,cn=root,dc=ericlee,dc=dev
KrbException: Identifier doesn't match expected value (906)
-
Check the logs for something like:KDC can't fulfill requested option
krb5kdc: ... CONSTRAINED-DELEGATION s4u-client=<unknown>
sfu-client=<unknown>
likely means that you didn't add the correct
krbAllowToDelegate
attribute value in LDAP