Impersonate Kerberos user on HDFS

Russ Allbery eagle at eyrie.org
Thu Apr 11 10:54:39 EDT 2024


Ken Hornstein via Kerberos <kerberos at mit.edu> writes:

> - Have access to to user's key/password and generate a ticket for that
>   user using kinit.  As someone else already noted, this isn't really
>   impersonating a user.
> - Have access to the TGS key and generate a TGT for that user (or any user).
>   This is generally referred to as "ticket printing".  I don't _think_
>   the Kerberos distributions come with a utility to do that, but I
>   believe there are example programs floating around that do that.  I
>   have to say that doing so would require access to the TGS key and
>   having that outside of your Kerberos database would be extremely
>   dangerous as if it was compromised your entire realm would be
>   compromised.

I have in the past written a variation on these two approaches as a
service that runs directly on the KDC.  It accepted authenticated
requests, applied some sort of complex ACL, and, if the authenticated user
making the request passed that ACL, returned a printed ticket (and of
course logged that this was happening).  Since it ran on the KDC, it
already had access to the keys required to do so.  I convinced myself that
this was acceptably secure.

(The actual project was for a former employer and I don't have the source,
and there were some other weird things about that environment that meant I
was able to maintain separate keytabs for each user without worrying about
them being invalidated, so I didn't do the full ticket printing approach
based on the TGS key and just used a bunch of user keytabs since that was
a lot easier to set up without having to work too hard.)

The huge drawback of all variations on this type of approach is that you
lose the ability to distinguish between user accesses based on their own
authentication and third-party accesses via ticket printing.  That can be
a real problem if anything goes wrong and you need to figure out whether
it was really the user or some ticket-printing service, and can be hard to
explain (for good reason) in various audit situations.  So probably best
avoided if you can find a different approach.

-- 
Russ Allbery (eagle at eyrie.org)             <https://www.eyrie.org/~eagle/>


More information about the Kerberos mailing list