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
- Architecture
- The name of an identity
- From realm to principal
- Users and services
- Why Kerberos
- In the TDP editions
See an access happen
Press Play or move forward step by step. The underlined names lead to the Glossary.
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.
In the Glossary: kinit · Authentication Server · Database · TGT · Principal
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Architecture
The KDC brings together the Authentication Server and the Ticket Granting Server, and both read the same database.
What the figure shows:
- The client talks to the KDC in two stages, and only then with the application server.
- The Authentication Server (AS), inside the KDC, is the first stage: the client sends the AS request and receives the AS reply.
- The Ticket Granting Server (TGS), also inside the KDC, is the second stage: the client sends the TGS request and receives the TGS reply.
- The KDC database is the same database that the Authentication Server and the Ticket Granting Server read.
- 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 Glossarynn— 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.
- 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.
- 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.
- 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.
- 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.
Users and services
In both cases there is a principal. What changes is how each one presents it.
Authenticates interactively with kinit, which obtains the TGT and stores it in the credential cache.
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.
When interactive login with kinit is not feasible, programmatic authentication uses the keytab.
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.
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
| Edition | Version | Documentation |
|---|---|---|
| TDP Datacenter | 1.10.3-30 | TDP Datacenter components |
In TDP Datacenter
In TDP Datacenter, Kerberos is the KERBEROS service, enabled by the Kerberos wizard of Ambari.
KERBEROS_CLIENT (client, on every host). Component category.
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.
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.
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.
The realm is set in realm, and the accepted encryption types in encryption_types, in the kerberos-env configuration.
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.
The krb5-conf configuration brings together manage_krb5_conf, domains, conf_dir, content, and force_tcp.
An operational time synchronization service and DNS resolution among all machines. See Minimum requirements and Security in TDP Datacenter.
Next steps
TDP Datacenter
Security in TDP Datacenter
Authentication, authorization, external access, and encryption, and how Kerberos fits in.
TDP Datacenter
TDP Datacenter Architecture
Where security sits in the architecture and what is enabled in Ambari.
