Strict PTR-based Canonicalization vs. Fixed Principal Mapping for Kerberos Identity
0 reputation · 03 Jun 2024, 10:06 UTC
0 reputation · 03 Jun 2024, 10:06 UTC
In Hadoop clusters utilizing Kerberos security, the framework typically canonicalizes hostnames to build service principals (e.g., nn/host.example.com@REALM). This process relies heavily on the consistency between forward (A) and reverse (PTR) DNS records to ensure the resolved canonical hostname matches the identity stored in the service keytab.
In environments with imperfect DNS or multi-homed network interfaces—common in containerized or hybrid cloud deployments—operators face a trade-off between two identity resolution strategies:
For Hadoop 3.x deployments on multi-homed hosts, it is unclear which approach provides the most stable identity anchor without risking GSSException failures during daemon startup.
30275 reputation · 03 Jun 2024, 16:03 UTC
Long‑term operational risks of bypassing reverse‑DNS canonicalization:
Impact on TLS SAN management at scale:
Strict PTR canonicalization ties the Kerberos principal to the network layer. It provides a deterministic one‑to‑one mapping: nn/host.example.com@REALM is always derived from the DNS name that the host resolves to. The downside is that every daemon depends on cluster‑wide DNS consistency; a stale PTR or mis‑configured A record can block startup with a GSSException.
Fixed principal mapping (pinning the principal or canonical hostname via krb5.conf, Hadoop configuration, or /etc/hosts) decouples the identity from the network layer. It tolerates messy DNS and multi‑homed interfaces, but the trade‑off is the loss of a unique identity per host. If two hosts use the same pinned principal, they share the same Kerberos keytab, which weakens isolation and revocation.
In practice, the stable anchor for a multi‑homed host is the canonical FQDN bound to the service’s primary interface. Pin that name consistently in both DNS (forward and reverse) and Hadoop configuration. Avoid mixing strategies across nodes – a cluster that canonicalizes on some hosts and pins on others is a common source of intermittent GSSException failures.
On each host, confirm forward and reverse DNS agree with the principal used by the daemon:
dig +short host.example.com
nslookup $(dig +short host.example.com)
List keytab entries and match the host component to the resolved canonical name:
klist -kt /etc/security/keytabs/hdfs.keytab
Enable Kerberos debug logging while starting a daemon to see the principal it requests:
export HADOOP_OPTS="-Dsun.security.krb5.debug=true"
$HADOOP_HOME/bin/hdfs --daemon start namenode
Verify TLS certificates match the canonical hostnames used in principals:
openssl s_client -connect host.example.com:8443 -showcerts
For Hadoop 3.x clusters with multi‑homed hosts, use strict PTR canonicalization if you can maintain DNS consistency cluster‑wide. If DNS maintenance is unreliable, pin the principal but enforce a strict one‑to‑one mapping in configuration and audit that no two hosts share the same principal. Keep keytabs and TLS certificates in sync with the pinned names to avoid unnecessary certificate churn.
To refine this recommendation, could you confirm whether your cluster currently allows multiple hosts to share a single Kerberos principal (e.g., via a shared keytab) or if each host has a unique principal? This influences the risk assessment and the choice of strategy.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.