Skip to main content

Users and services authenticated,
even on an open network.

In TDP Datacenter, Kerberos authenticates users and services with tickets issued by a trusted third party. See, step by step, how a user reaches a cluster service.

Kerberos authenticates with tickets: a KDC, the trusted third party, issues the tickets with which each principal, a user or a service, proves its identity to another, on a network where packets can be read by third parties.

In both directions

Client and service verify each other

The client proves its identity to the server and, with the session key, the server can also prove its own. Those who use and those who serve authenticate through a trusted third party.

Only once

The TGT spares the password

After the first login, the initial ticket stays in the credential cache and obtains the tickets for the other services without asking for the password again.

Open network

Designed for readable packets

The protocol assumes that packets on the network can be read, altered, and inserted, and, once authenticated, client and server can encrypt the communication.

On this page

See an access happen​

Press Play or move forward step by step. The underlined names lead to the Glossary.

UserWho wants access
kinitRequests the TGT with the principal
Credential cacheStores the TGT and the tickets
KDCTrusted third party
Authentication ServerIssues the TGT
Ticket Granting ServerIssues the service ticket
DatabasePrincipals and keys
Cluster serviceWho receives the access
ServiceValidates the ticket
KeytabStores the service key
Step 1 of 6

1 The user requests the TGT

With kinit, the user provides their principal and asks the Authentication Server for a ticket-granting ticket. The request travels in clear text, and the server queries the KDC database.

  1. The user requests the TGT. With kinit, the user provides their principal and asks the Authentication Server for a ticket-granting ticket. The request travels in clear text, and the server queries the KDC database.
  2. The TGT comes back and is cached. The Authentication Server replies with credentials encrypted with the client's key, and kinit stores the TGT in the credential cache. From here on, the TGT obtains other credentials without the password.
  3. The TGT is exchanged for the service ticket. To access a service, the client presents the TGT to the Ticket Granting Server and requests a ticket for that service. The request does not need the password, and the server also queries the database.
  4. The service ticket reaches the client. The reply, encrypted with the TGT session key, carries the service ticket and a session key. The ticket holds the client's identity and a copy of the session key, encrypted with the service key.
  5. The client presents the ticket to the service. The client sends the ticket along with an authenticator, which carries a timestamp and is encrypted with the session key. The service opens the ticket with the key it stores in the keytab and checks the authenticator.
  6. The service knows who the client is. With the ticket and the authenticator verified, the service knows the client's identity and serves it. The session key, now shared, can also authenticate the service to the client and encrypt the communication.
Figure 1 - An access with Kerberos. The user obtains the TGT once, exchanges the TGT for the service ticket, and presents the ticket to the service, which uses the key stored in the keytab.

Architecture​

The KDC brings together the Authentication Server and the Ticket Granting Server, and both read the same database.

Kerberos architectureThe client sends the AS request to the Authentication Server (AS), inside the Key Distribution Center (KDC), and receives the AS response. Then it sends the TGS request to the Ticket Granting Server (TGS) and receives the TGS response. The AS and the TGS receive data from the KDC Database. Finally, the client sends the AP request to the Application Server and receives the AP response.Key Distribution Center (KDC)Authentication Server(AS)Ticket Granting Server(TGS)DatabaseClientApplicationServerAS requestAS responseTGS requestTGS responseAP requestAP response
Figure 2 - Kerberos architecture: the client, the KDC with the Authentication Server, the Ticket Granting Server and the database, and the application server. The underlined terms lead to the Glossary.

What the figure shows:

  1. The client talks to the KDC in two stages, and only then with the application server.
  2. The Authentication Server (AS), inside the KDC, is the first stage: the client sends the AS request and receives the AS reply.
  3. The Ticket Granting Server (TGS), also inside the KDC, is the second stage: the client sends the TGS request and receives the TGS reply.
  4. The KDC database is the same database that the Authentication Server and the Ticket Granting Server read.
  5. The application server is the last step: the client sends the AP request and receives the AP reply.

In practice, the Authentication Server and the Ticket Granting Server are different entry points of the same Kerberos server.

The name of an identity​

Every user and every service has a principal, and the realm is part of the name.

Click each part of the name.

Service name

First component of a service principal: the service name, such as host, HTTP, or nfs. In the Hadoop example, nn is the NameNode.

See in the Glossary
nn — Service name
First component of a service principal: the service name, such as host, HTTP, or nfs. In the Hadoop example, nn is the NameNode.
/full.qualified.domain.name — Host
Second component: the hostname of the machine on which the service runs. Hadoop accepts the _HOST wildcard, which each instance replaces with its own fully qualified hostname, so the same set of configuration files serves all machines. The keytabs, however, are different on each one.
@REALM.TLD — Realm
The realm in which the principal is registered. By convention, it repeats the domain name in uppercase letters, such as EXAMPLE.COM.

The KDC database stores the realm's principals, for users and services, each with its own secret key.

From realm to principal​

Four levels, each inside the other.

Level 1 of 4

Realm

The authentication domain of an organization, managed by its Kerberos server. The realm name is part of the name of every principal registered in it.

  1. Realm. The authentication domain of an organization, managed by its Kerberos server. The realm name is part of the name of every principal registered in it.
  2. KDC. The realm's trusted third party: it brings together the Authentication Server and the Ticket Granting Server and delivers the tickets.
    • Replica KDC. An additional KDC that serves ticket requests when the primary KDC is unreachable. Because each client needs to be able to contact a KDC, the realm can have replicas.
  3. Database. Stores all the realm's principals, with the passwords and the other administrative information for each one. The Authentication Server and the Ticket Granting Server read this database.
  4. Principal. A unique identity, of a user or a service, with its secret key registered in the database.
    • Keytab. The table of long-term keys for one or more principals, usually a file. Services use it to accept authentications from clients.
Figure 3 - Organization of a realm: each level contains the next. The replica KDC and the keytab accompany the level at which they appear.

Users and services​

In both cases there is a principal. What changes is how each one presents it.

User

Authenticates interactively with kinit, which obtains the TGT and stores it in the credential cache.

Service

Each instance of a service is configured with its principal and with the location of the keytab, from which comes the key with which it accepts clients.

Automation

When interactive login with kinit is not feasible, programmatic authentication uses the keytab.

In Hadoop

In secure mode, every Hadoop service and every user is authenticated by Kerberos.

Why Kerberos​

Open standard

Protocol specified in an RFC

The protocol is described in RFC 4120, and MIT maintains a free implementation, distributed as source code. Kerberos is also available in many commercial products.

Availability

Primary KDC and replicas

Replicas serve ticket requests when the primary KDC is down, being updated, or otherwise unreachable.

Across organizations

Realms that communicate

With cross-realm keys, a client authenticated in its own realm proves its identity to services in another.

Sessions

Renewable tickets

Renewable tickets obtain new session keys without the user typing the password again, and the lifetime is defined by each site.

Confidentiality

Encrypted communication

After proving their identity, client and server can encrypt all communication, to ensure data privacy and integrity.

Hadoop

Foundation of secure mode

Hadoop secure mode requires every service and every user to be authenticated by Kerberos.

Where it comes from

Kerberos was created by MIT, in Project Athena, as a solution to network security problems. The model is based on the trusted third-party authentication protocol of Needham and Schroeder, and the protocol is specified in RFC 4120.

In the TDP editions​

Available in the TDP editions
EditionVersionDocumentation
TDP Datacenter1.10.3-30TDP Datacenter components

In TDP Datacenter​

In TDP Datacenter, Kerberos is the KERBEROS service, enabled by the Kerberos wizard of Ambari.

Service components

KERBEROS_CLIENT (client, on every host). Component category.

Enabling

The Ambari Kerberos wizard creates and manages the principals and keytab files for user and service identities, according to manage_identities, in the kerberos-env configuration.

Impact on the cluster

Enabling reaches all cluster services that have a Kerberos descriptor: HDFS, YARN, MapReduce, Tez, Hive, Spark, Flink, HBase, Druid, Solr, Kafka, NiFi, NiFi Registry, Sqoop, Airflow, Trino, Ozone, Superset, Zeppelin, JupyterLab, Atlas, Ranger, Ranger KMS, Knox, Great Expectations, ZooKeeper, Infra Solr, and Ambari Metrics.

KDC type

Defined in kdc_type: mit-kdc, ipa, or active-directory. The KDCs are set in kdc_hosts and master_kdc, and the administration server in admin_server_host.

Realm and encryption

The realm is set in realm, and the accepted encryption types in encryption_types, in the kerberos-env configuration.

Administration identities

The administration principal is set in kadmin_principal_name, the Ambari one in create_ambari_principal, and the service check one in service_check_principal_name.

Configuration on the machines

The krb5-conf configuration brings together manage_krb5_conf, domains, conf_dir, content, and force_tcp.

Environment requirements

An operational time synchronization service and DNS resolution among all machines. See Minimum requirements and Security in TDP Datacenter.

Next steps​

Sources​

MIT Kerberos

MIT Kerberos Documentation

RFC 4120 - The Kerberos Network Authentication Service (V5)

Apache Hadoop - Hadoop in Secure Mode