Podcast 2x06: How does Kerberos work? authentication and authorization (AA)

Translation of the original in Catalan. Read it in: CatalàCastellano

Part 5 of 5Podcast, season 2
  1. Podcast 2x01: introduction and detailed description of the SOCKS5 protocol
  2. Podcast 2x02: SOCKS5 Bytestreams (XEP-0065)
  3. Podcast 2x03: tools to play with SOCKS5
  4. Podcast 2x04: advanced SSH
  5. Podcast 2x06: How does Kerberos work? authentication and authorization (AA)

The podcast

Listen to the podcast (MP3)

Notes

Standard

RFC1510

for authentication, the highlights are the features of:

  • mutual authentication
  • fast connection times (session tickets)
  • delegation (recursive authentication between services)

Diagrams

my-kerberos-schema
my-kerberos-schema

Simplification of how it works

There are 6 types of messages (5 mandatory + 1 optional), grouped into 3 sub-protocols:

  • AS (Authentication Service) - it happens during the "login" process and it allows the client to request a ticket to access the resources (TGT)
    • KRB_AS_REP
      • Client principal name.
      • Timestamp.
      • Kerberos target principle name (realm).
      • Requested lifetime.
    • KRB_AS_REP
      • The first part is encrypted using the user key, it contains:
        • User-TGS key (generated by the KDC).
        • Kerberos target principle name (realm).
        • Ticket lifetime.
      • The second part is the TGT, it is encrypted using the TGS key generated by the KDC, only the servers can open it, even so it is stored on the client and it contains:
        • Client principal name.
        • Ticket lifetime.
        • KDC timestamp.
        • User-TGS key (which is not retained by the KDC, but its presence within the TGT means it is available when required).
        • Client IP address (taken from the initial KRB_AS_REQ).
  • TGS (Ticket Granting Service) - through the TGT the client can request a "service ticket" (ST) needed to be able to access a service. The TGT works in a similar way to a password (it expires over time and does not require a password), the ST obtained would be similar to an entry visa to a country.
    • KRB_TGS_REQ
      • Service principal name.
      • Requested lifetime.
      • TGT (still encrypted with the TGS key).
      • Authenticator (encrypted with the user-TGS key and containing a client timestamp) - The authenticator guarantees that the request originated from the client.
    • KRB_TGS_REP
      • The first part is encrypted with the user's TGS key (the KDC extracts it from the TGT) and it contains:
        • Service principal name.
        • Ticket lifetime.
        • User service key (encrypted with a user-TGS session key, generated by the KDC).
      • Part two, it is the "service ticket" (ST). Encrypted using the TGS service key. It contains:
        • User service key (encrypted with a user-TGS session key, generated by the KDC).
        • Client principal name.
        • Ticket lifetime.
        • KDC timestamp.
        • Client IP address.
  • Client/Server (AP) Exchange - to access a service the client sends the service a KRB_AP_REQ with the ST obtained. The service may or may not answer the request, sometimes, the service directly starts its session.
    • KRB_AP_REQ
      • ST encrypted with the TGS key of the service
      • Authenticator - encrypted with the user service key
    • KRB_AP_REP

Characteristics

  • 'Realm' is defined as an administration domain
  • All servers and participants in the transactions belong to the same 'Realm'
  • All messages travel encrypted using a symmetric code (no-PKI)
  • The "user key" is generated from the "logon password"
  • The "host key" is generated when the "host" joins the 'Realm'
  • If a client wants to access a service and has not done the TGS it can send the TGT in the "AP exchange" and the service will do the management with the KDC transparently.
  • Important to remember that:
  • only the KDC can read the TGT
  • only the service can read the ST

Glossary of acronyms

  • KDC: Key Distribution Center
  • AS: Authentication Service
  • TGS: Ticket Granting Service
  • SS: Service Server

References:

Known errors

  • Due to a mistake podcast 2x05 does not exist. Sorry about the mistake!