Fwd: Krb5LoginModule verify TGT?
cneberg
cneberg at gmail.com
Tue Mar 15 20:25:21 UTC 2011
Forwarding Henry's reply to the list
---------- Forwarded message ----------
From: Henry B. Hotz
Sorry I can't post this back to the list directly. My "From" address
doesn't match my subscription address.
It's probably possible to use the existing, public, stable JGSS API to
create a connection to yourself. The "transport" would be simply
referencing the tokens from one end/context in the calls made to the other
end/context. If such an internal connection could be established, that
should be equivalent to verifying the tgt against the keys for the "server"
end of the self-connection.
Actually doing all that in application code seems really ugly, but it might
be nice to put some sample code in the 1.4/1.5/1.6 docs if you don't
back-port the new "verify" options.
Just to be explicit: I second "cneberg"s request, and your proposed config
options to control a built-in capability look good. You could give them
default values of "host/`localhost`@DEFAULT-REALM" for
verifyInitCredsService, and the default system keytab file for
verifyInitCredsKeytab, but then you would need to consider if you want the
check on by default.
I think I would vote for having the check done by default in 1.7, but left
off in 1.6- if it's backported there.
Feel free to forward my reply to the list if you want.
On Mar 11, 2011, at 8:46 AM, cneberg wrote:
> Yes, thank you that should work nicely. Is this a feature you would
consider back porting, even to Oracle's vanilla jdk 1.6 (or even 1.5)?
Since the warning against its improper usage isn't in the documentation for
the module, it may not have been heard by developers.
>
> Documentation for module
>
http://www.docjar.com/docs/api/com/sun/security/auth/module/Krb5LoginModule.html
>
> Thanks
> Christopher
>
> On Thu, Mar 10, 2011 at 7:43 PM, Weijun Wang <weijun.wang at oracle.com>
wrote:
> Cool. We may look at this, possibly adding more lines into the JAAS login
file, something like
>
> com.sun.security.jgss.krb5.initiate {
>
> com.sun.security.auth.module.Krb5LoginModule
> required
> verifyInitCredsService=service/host at REALM
> verifyInitCredsKeytab=service.ktab
> };
>
> We've always warned users that simply passing the Krb5LoginModule doesn't
mean anything and you should always uses this subject in JGSS but not
regarding itself as some kind of authenticity (say, use it in a java policy
file). This new function might change that.
>
> Thanks
> Max
>
>
>
> On 03/11/2011 10:19 AM, cneberg wrote:
> >> So it reads the user's secret key from a keytab and try to decrypt
> the TGT to see if it can successfully get the session key inside
>
> No, it uses the user's TGT to obtain a service ticket for a known valid
> key in the keytab file (any valid service key would work usually
> HOST/hostname keys, or HTTP/hostname keys are used). When you do a
> successful kinit (AS request) you are validating that the user and the
> KDC agree that the user's key was correct, but until you actually try to
> use the TGT to get a service ticket for a known service you have not
> validated that the KDC you are talking to is not spoofed. In other
> words, if this extra step is not performed inside the Krb5LoginModule
> then it is not secure for validating passwords. Doing this extra step
> is standard in mod_auth_kerb, pam_krb5, etc. If it is not supported it
> will require a change in the openjdk code.
>
> -Christopher
>
> On Thu, Mar 10, 2011 at 6:36 PM, Weijun Wang <weijun.wang at oracle.com
> <mailto:weijun.wang at oracle.com>> wrote:
>
> Hi Christopher
>
> I'm not familiar with that function. So it reads the user's secret
> key from a keytab and try to decrypt the TGT to see if it can
> successfully get the session key inside?
>
> This is a part of the Krb5LoginModule login process: it receives a
> TGT from the KDC and use either the password or keytab (depending on
> your JAAS config file) to decrypt it. After the commit() method is
> called, the credentials (containing both the TGT and the session
> key) are stored as private credentials in the JAAS subject.
>
> All public methods we have around Kerberos are APIs defined in JAAS
> and JGSS.
>
> BTW, this mailing list is used to discuss the development of OpenJDK
> security libraries itself. For API usage or general technical
> support, it would be better to post a question in the forum. There
> are much more experts on application programming there.
>
> http://forums.oracle.com/forums/forum.jspa?forumID=963
>
> Thanks
> Max
>
>
>
> On 03/11/2011 01:49 AM, cneberg wrote:
>
> How do I get the com.sun.security.auth.module.Krb5LoginModule login
> module to verify the TGT against a key in the keytab like is done
in
> krb5_verify_init_creds() which is part of C Krb5 API?
>
> Notes on that API
>
> http://www.daemon-systems.org/man/krb5_verify_init_creds.3.html
>
> Thanks,
> Christopher
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/security-dev/attachments/20110315/97e9c2a5/attachment.htm>
More information about the security-dev
mailing list