Building the realm's eyes with KDC and client logging, KRB5_TRACE configuration for debugging, analyzing authentication failure patterns, and monitoring tools like ELK, Grafana, and SIEM along with the key metrics to watch.

In episode 21 you closed the gates: AES-only encryption, mandatory preauth, short lifetimes, secured keytabs, and mapped common attacks. But all that defense is blind without sight. Attacks don't knock on the door — they come in through anomalies that are only visible if you monitor logs and metrics.
Episode 22 builds the realm's "eyes": logging on the KDC and client sides, log analysis to read failure signals, monitoring tools like ELK and Grafana, and the metrics that must always be watched. This is where the detection mentioned in episode 21 becomes operational.
The MIT Kerberos KDC writes all activity to fully configurable logs. All messages — authentication, authorization, and errors — gather in one place so they can be analyzed.
Logging is configured in the [logging] section of /etc/krb5.conf (or kdc.conf):
[logging]
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
default = FILE:/var/log/krb5libs.logkdc — the KDC's main activity log: all AS_REQ, TGS_REQ, and their results.admin_server — the log of changes made via kadmin (addprinc, modprinc, delprinc).default — the Kerberos library log on the machine side (client and service).Besides FILE, the destination can be SYSLOG:severity:facility to forward to syslog (e.g. SYSLOG:INFO:LOCAL0), or DEVICE=/dev/null to discard output. Using syslog makes later SIEM integration easier.
The KDC log doesn't have per-module DEBUG/INFO levels selectable like a web application. The detail level is controlled via:
SYSLOG:.KRB5_TRACE (covered in the client section).The KDC log holds three main categories:
The following snippet shows the message patterns you'll often encounter (the format can vary between versions; focus on the content):
AS_REQ alice@EXAMPLE.COM from 10.0.0.50: PREAUTH_FAILED
TGS_REQ alice@EXAMPLE.COM: S_PRINCIPAL_UNKNOWN
AS_REQ 10.0.0.51: CLOCK_SKEW: time is off by 360 seconds
ISSUE: authtime ... alice@EXAMPLE.COM for krbtgt/EXAMPLE.COM@EXAMPLE.COMThe KDC isn't the only log source. The client side often holds answers not visible in server logs — for example when a request never reaches the KDC.
The KRB5_TRACE environment variable makes the client library write a complete trace of every Kerberos step to the specified file. Use KRB5_TRACE=/dev/stdout to watch directly:
export KRB5_TRACE=/dev/stdout
kinit alice@EXAMPLE.COMThis trace shows the whole flow: realm lookup, KDC discovery, the AS_REQ submission, the enctypes offered, up to the final result. It's the number one tool when authentication fails for an unclear reason.
default destination in [logging] (e.g. krb5libs.log).gssapi or kerberos in the application's logging configuration (e.g. Apache module, SSH, NFS)./var/log/sssd/ — when SSSD fails to fetch a ticket, the trace is there, not on the KDC.Good KDC logs will tell the story of a problem before the user gets a chance to report it. Recognize the following patterns:
| Log pattern | Meaning | Action |
|---|---|---|
Repeated PREAUTH_FAILED | Wrong password or preauth problem | Verify the password, check the time |
CLOCK_SKEW | Clock difference beyond the 5-minute tolerance | Synchronize with NTP immediately |
| Enctype mismatch | Client only offers weak encryption | Compare klist -e and the KDC configuration |
Principal not found in Kerberos database | Principal not registered | Check the realm spelling and account |
Ticket expired | Ticket past its validity | Run kinit again, check the lifetime |
PREAUTH_FAILED from one IP or one user is a brute-force or password-spray signal.Note
KDC log patterns can differ between MIT versions and between MIT and AD. Focus on the message content — PREAUTH_FAILED, CLOCK_SKEW, S_PRINCIPAL_UNKNOWN — because the characteristic text is consistent enough to be used in detection rules.
Logs alone aren't enough when they're spread across hundreds of hosts. Combine them with aggregation and visualization tools:
rsyslog or syslog-ng on the KDC side toward Elasticsearch/Loki, or directly to Splunk. This is where the anomaly detection from episode 21 runs as rules.Metrics are the realm's heartbeat. Start with the highest-impact ones:
| Metric | How to measure | Problem indicator |
|---|---|---|
| Auth success/failure rates | Count from AS_REQ/TGS_REQ logs | Failure spike = brute force or misconfig |
| KDC performance | AS_REQ response latency, KDC CPU | Slow KDC = capacity nearing its limit |
| Database load | kdb5_util query time, database size | Swollen DB = retention policy needs an audit |
| Ticket issuance rate | Number of tickets per minute | Sharp rise = new traffic or an anomaly |
| Service response times | Time until a service receives a ticket | Degrading = network or KDC problem |
tail -f /var/log/krb5kdc.log | grep -c "ISSUE" | while read n; do echo "asreq_ok $n"; doneScripts like this are easily wired into a Prometheus textfile collector and visualized in Grafana — from there, alerting is just one step away.
Episode 22 gave you sight: KDC logging configuration in [logging], client traces with KRB5_TRACE, analysis of failure patterns like PREAUTH_FAILED, CLOCK_SKEW, and S_PRINCIPAL_UNKNOWN, and monitoring tools (ELK, Grafana, SIEM) with the key metrics that must be monitored.
Key takeaways:
[logging] in krb5.conf.KRB5_TRACE=/dev/stdout reveals the entire authentication flow from the client side.PREAUTH_FAILED for passwords, CLOCK_SKEW for time, S_PRINCIPAL_UNKNOWN for principals.In episode 23 you'll use all these eyes to heal: Kerberos Troubleshooting — mapping common errors to their solutions, debugging techniques with KRB5_TRACE and klist -e, and network and keytab problems. See you there!