Kerberos Mutual Authentication

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up kerberos mutual authentication, the client requests a server reply during login. The server decrypts the ticket timestamp and sends it back to prove its identity. Teams use this flow so users and apps do not talk to fake servers. Yet once the session starts, wide database or host roles still allow risky actions. How kerberos mutual authentication works step by step In a standard login flow, only the user proves who they are. The user gets a ticket from a central key server and sends

Mutual Authentication Patterns: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

To set up kerberos mutual authentication, the client requests a server reply during login. The server decrypts the ticket timestamp and sends it back to prove its identity. Teams use this flow so users and apps do not talk to fake servers. Yet once the session starts, wide database or host roles still allow risky actions.

How kerberos mutual authentication works step by step

In a standard login flow, only the user proves who they are. The user gets a ticket from a central key server and sends it out. The target server reads the ticket and lets the user in. In this basic mode, the user never checks if the target server is real.

A mutual check fixes this one-way trust problem. First, the user logs into the central key server and gets a session key. Next, the user asks the ticket service for a ticket to the target app. The user then sends this ticket and an encrypted timestamp to the target server. To prove its own identity, the target server must open that ticket.

Only the real target server holds the secret key needed to open that ticket. Inside the ticket, the server finds the shared session key for that user. The server uses that shared key to read the user timestamp. It then changes the timestamp, locks it with the shared key, and sends it back. The client opens the reply and checks the time to confirm the server identity.

Every step relies on strict time sync across all machines on the network. If a clock drifts by a few minutes, the ticket check fails right away. Teams must run network time tools on every client, server, and key controller. They also need a safe way to rotate secret keys stored on each host.

Why mutual ticket checks still leave a session gap

Proving both identities stops attackers from setting up fake database or host endpoints. A rogue machine on the network cannot open the service ticket. Because it lacks the secret key, it cannot send back the right timestamp. The client sees the failed check and drops the link before sending data. This protects your team from man-in-the-middle traps on local networks.

Mutual Authentication Patterns: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, ticket checks only happen at the start of a network session. Once both sides trust each other, the protocol steps out of the way. It does not read the SQL queries or shell commands sent after login. If an engineer logs in with an admin role, they can drop tables.

Managing secret key files across hundreds of servers also takes a lot of work. When a team member leaves, admins must update central directory groups and revoke tickets. Even then, active tickets stay valid until their timer runs out. Teams often share broad service accounts to avoid fixing broken key files on hosts.

Shared accounts make audit logs hard to read during a security review. You can see that a valid ticket opened a database session at noon. You cannot see which person ran a delete command or read private data. Raw results containing emails, phone numbers, and card numbers flow back in plain text. To control live queries, teams must pair login checks with command controls and masking.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

What is the difference between standard and mutual checks in Kerberos?

Standard checks only prove the user identity to the target server. Mutual checks require the server to send back an encrypted timestamp to prove itself.

What happens if system clocks are out of sync during login?

The ticket check fails right away and blocks the login attempt. Kerberos uses short time windows on timestamps to stop attackers from reusing old tickets.

Does mutual login protect data inside an active database session?

No, it only checks identities when the session starts. It does not block bad queries or rewrite card numbers and national IDs in results.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.