The problem delegation solves

Normally in Kerberos, a user authenticates to a service. The user gets a ticket, presents it to the service, done.
But real apps are rarely one service. A user hits a web server, and that web server needs to call a database, an API, a file share, etc.
The question becomes: when the web server talks to the database, whose identity does it use?

Two naive options, both bad:

  • The web server uses its own identity. Then the database can’t tell who the real user is. No per-user permissions, no per-user auditing.
  • The user logs in again to the database directly. Defeats the whole point of single sign-on.

So we need a third option: the web server impersonates the user when talking to the database - that’s delegation.

Unconstrained Delegation (the old, dangerous way)

In the early days, AD just said: “fine, web server, you can impersonate anyone, anywhere.”
The web server account gets a flag, and it can request service tickets on behalf of any user to any service in the domain.
The problem is obvious - if that web server is compromised, the attacker becomes everyone, everywhere. It’s basically a domain admin. So this is now almost never recommended.

Constrained Delegation (KCD)

AD then added the idea of constraint. Instead of “delegate anywhere,” you list specific targets:

  • Web server can delegate to MSSQL/db01 and CIFS/fileserver01.
  • Nothing else.

This is configured on the web server’s service account, in an attribute called msDS-AllowedToDelegateTo. The web server says: “I am allowed to impersonate users toward these SPNs.”
This is outbound trust - held by the delegator.

Still has issues:

  • Requires domain admin (or delegated rights) to configure.
  • Target list is static.
  • Awkward across domains.

Resource-Based Constrained Delegation (RBCD)

RBCD flips it. Instead of the web server declaring its targets, the resource (e.g. the database) declares who may delegate into it:

  • db01 says: “web01 and api02 may impersonate users toward me.”

Configured on the resource account, in msDS-AllowedToActOnBehalfOfOtherIdentity.

This is inbound trust - held by the resource. Benefits:

  • Resource owner controls it (not domain admin).
  • Cross-domain works better.
  • More natural model.

Downside: a common attack path - if you can write to a computer object’s attributes, you can add yourself and impersonate anyone to that machine.

The three types at a glance

  1. Unconstrained - delegate to anything. Dangerous, avoid.
  2. Constrained (KCD) - delegate to a fixed SPN list. Outbound, on the service.
  3. Resource-based (RBCD) - resource declares allowed delegators. Inbound, on the resource.

Both KCD and RBCD use the same Kerberos protocol extensions (S4U2Self + S4U2Proxy) under the hood. They just differ in who holds and controls the trust list.

Tools

There is raiseChild.py which can be helpful with RBCD - Impacket.