Skip to main content
Systems Engineering

Fixing Double-Hop Kerberos With Constrained Delegation

Resource-based constrained delegation replaces SPN-bound trust chains, fixing Kerberos double-hop failures without domain-wide delegation risk.

Fixing Double-Hop Kerberos With Constrained Delegation
KBY Technologies13 min read

In this guide

Share

A front-end IIS server authenticates a user successfully via Kerberos, then makes a call to a back-end SQL Server or SharePoint API on that user’s behalf, and the request silently falls back to anonymous or the application pool identity. No error, no audit trail explaining why. This is the Kerberos double-hop problem, and in any enterprise running multi-tier services, it eventually forces a choice between weakening the trust boundary with unconstrained delegation or correctly implementing constrained delegation at the resource level. Most teams pick the former because it is faster to configure and just as fast to get flagged in a penetration test. This article covers the architecture and implementation of resource-based constrained delegation (RBCD), the mechanism that should have replaced classic delegation models years ago in any domain that still cares about lateral movement risk.

#The Problem: Why Kerberos Breaks on the Second Hop

Kerberos tickets are scoped to a single service principal. When a client authenticates to Service A, the ticket-granting service (TGS) issues a service ticket valid only for A’s SPN. If A then needs to call Service B while impersonating the original user, it has no ticket to present, because the user’s ticket was never issued for B. NTLM cannot solve it either: NTLM has no delegation mechanism, so a server that authenticated a client with NTLM cannot pass that authentication on to a next hop (only Kerberos protocol transition can bridge it), and multi-tier deployments that quietly downgrade to NTLM lose delegation and mutual authentication alike.

Microsoft’s answer, long before RBCD existed, was classic constrained delegation (KCD), configured via the msDS-AllowedToDelegateTo attribute on the front-end service account. This works, but it has two structural weaknesses: configuring the front-end account requires SeEnableDelegationPrivilege (the "Enable computer and user accounts to be trusted for delegation" user right, which only Administrators hold on domain controllers by default), and Microsoft’s constrained delegation overview states that it restricts the account to a single domain. The cross-domain delegation that arrived with Windows Server 2012 is resource-based constrained delegation, configured on the back-end account; it did not extend msDS-AllowedToDelegateTo across domains or forests. In large enterprises running federated AD forests or per-business-unit domains, that second limitation is the one that actually breaks production.

#Architectural Breakdown: S4U2Self and S4U2Proxy

Constrained delegation is built on two Kerberos extensions defined in MS-SFU: Service-for-User-to-Self (S4U2Self) and Service-for-User-to-Proxy (S4U2Proxy).

  • S4U2Self allows a service to request a Kerberos ticket to itself on behalf of a user, without that user presenting credentials directly. This is how the front-end obtains a usable ticket for the user’s identity even when the initial connection came in over NTLM or a non-Kerberos channel (protocol transition). With classic KCD this only works when the front-end account is set to "Use any authentication protocol" (TrustedToAuthForDelegation); otherwise the S4U2Self ticket is not forwardable and the S4U2Proxy step fails. RBCD differs here: MS-SFU specifies that for resource-based constrained delegation the KDC can accept a non-forwardable S4U2Self ticket in the S4U2Proxy request, so protocol transition works without that setting when the back-end’s msDS-AllowedToActOnBehalfOfOtherIdentity lists the front-end. Classic KCD gives no such allowance. With either model, a user marked "Account is sensitive and cannot be delegated", or a member of Protected Users, is never delegated.
  • S4U2Proxy takes that ticket and exchanges it, via the KDC, for a service ticket to the back-end resource, provided the delegation relationship is authorised.

The critical architectural shift with resource-based constrained delegation is where that authorisation lives. Classic KCD stores the allow-list on the front-end account (msDS-AllowedToDelegateTo) — the delegating party controls who it can impersonate to. RBCD stores it on the back-end resource account, via msDS-AllowedToActOnBehalfOfOtherIdentity. The resource owner decides who is allowed to delegate to it. This inversion is what removes the cross-domain and privileged-write dependency: the back-end owner (who may sit in a different domain) can grant the relationship without needing rights over the front-end account at all.

constrained delegation

Rendering diagram...

#
Constrained Delegation vs Unconstrained and Classic KCD

ModelTrust ScopeCross-Domain SupportPrivilege Required to ConfigurePrimary Risk
Unconstrained delegationAny service, any resourceWithin the forest; across a forest trust only where TGT delegation is enabled on the trust, which Windows blocks by defaultSeEnableDelegationPrivilege (held by Administrators on domain controllers by default)Full TGT theft on front-end compromise; effectively domain-wide impersonation
Classic constrained delegation (KCD)Explicit SPN list on front-endNo: restricted to a single domain; cross-domain delegation from Windows Server 2012 onwards uses RBCD insteadSeEnableDelegationPrivilege plus write access to the front-end objectFront-end account misconfiguration grants broad SPN access
Resource-based constrained delegation (RBCD)Explicit SID list on back-endYes, across domains and forest trusts (requires Windows Server 2012 or later domain controllers)Write access to the back-end object’s delegation attribute onlyMachine account takeover if RBCD combined with weak object ACLs

#Implementation Logic

Deploying resource-based constrained delegation correctly follows a fixed sequence. Skipping the verification step is the single most common cause of “it works from my laptop but not from the load-balanced pool.”

  1. Identify the exact service account run as by the front-end (application pool identity, gMSA, or computer account) and its SID.
  2. Identify the back-end resource’s computer or service account object.
  3. Write the front-end SID into the back-end object’s msDS-AllowedToActOnBehalfOfOtherIdentity attribute as a security descriptor.
  4. Confirm the SPN registered against the back-end service matches exactly what the client requests (case and host-name form matter).
  5. Validate with a live ticket trace, not just a successful HTTP response — a silent NTLM fallback can mask a delegation failure entirely.
1# SQLSVC is the account that holds the back-end MSSQLSvc SPN. This example assumes
2# a gMSA (Get-/Set-ADServiceAccount); use Get-/Set-ADUser for a user account, or
3# Get-/Set-ADComputer if SQL Server runs as its computer account.
4$ErrorActionPreference = 'Stop'   # any failure, including the backup, halts the script
5
6# -PrincipalsAllowedToDelegateToAccount REPLACES the existing list, so save the
7# current value and merge the new principal into it rather than overwriting.
8$backEnd = Get-ADServiceAccount -Identity "SQLSVC" -Properties PrincipalsAllowedToDelegateToAccount
9$before = @($backEnd.PrincipalsAllowedToDelegateToAccount | Where-Object { $_ })
10$before | Export-Clixml -Path .\SQLSVC-rbcd-before.xml
11
12# Add the front-end web server's computer account to the list
13$frontEnd = Get-ADComputer -Identity "WEB01"
14$merged = @($before + $frontEnd.DistinguishedName | Select-Object -Unique)
15Set-ADServiceAccount -Identity "SQLSVC" -PrincipalsAllowedToDelegateToAccount $merged
16
17# Verify the attribute was written correctly
18Get-ADServiceAccount -Identity "SQLSVC" -Properties PrincipalsAllowedToDelegateToAccount |
19    Select-Object -ExpandProperty PrincipalsAllowedToDelegateToAccount
20
21# Rollback: pass the saved $before list back to Set-ADServiceAccount ($null if it was empty)

For gMSA-backed application pools, the front-end principal is the managed service account object rather than the computer account, and the web server’s computer account must already be listed in that gMSA’s PrincipalsAllowedToRetrieveManagedPassword before any of this matters — a separate but frequently confused chain.

1# Validate on the front-end host that a forwardable ticket
2# for the back-end SPN is actually being cached
3klist tickets | findstr /i "MSSQLSvc"
4
5# List failed service ticket requests: Security event 4769 with a non-zero Status
6# (the field the event text displays as Failure Code).
7# 4769 is logged on domain controllers, so run this on a DC (or query your SIEM).
8# It does not prove success or detect NTLM fallback; for that, enable NTLM
9# auditing and check event 4776 on DCs (or 8004 in the NTLM Operational log).
10Get-WinEvent -LogName Security -FilterXPath "*[System[EventID=4769] and EventData[Data[@Name='Status']!='0x0']]" -MaxEvents 20

When troubleshooting event logs across domain boundaries, filter on the result code in event 4769: the event text shows it as Failure Code, and the event XML stores the same value in the Status field, which is what the XPath above matches. 0x20 (KRB_AP_ERR_TKT_EXPIRED) means an expired ticket, which clients normally renew and retry, so it rarely explains a delegation failure. 0xD (KDC_ERR_BADOPTION) is the one to chase: MS-SFU has the KDC return KRB-ERR-BADOPTION when it refuses an S4U2Proxy request, so a 0xD on a request from the front-end account usually means the delegation is not authorised for the requested service, which often traces back to a stale or missing SID in the back-end’s delegation attribute.

#
Structuring the Trust Grant as Code

For teams managing this through infrastructure-as-code rather than ad hoc PowerShell, the delegation relationship should be declared alongside the resource definition, not the front-end. This mirrors the resource-owns-the-trust model of the underlying protocol and keeps the grant auditable in version control.

1{
2  "resourceAccount": "SQLSVC",
3  "allowedDelegators": [
4    {
5      "principal": "WEB01$",
6      "sid": "S-1-5-21-...-1104",
7      "justification": "Tier-2 API fan-out, ticket CHG0041233"
8    }
9  ],
10  "reviewCycleDays": 90
11}

This structure feeds directly into a periodic access-review job — enumerate every account with a non-empty msDS-AllowedToActOnBehalfOfOtherIdentity and reconcile it against the declared manifest. Drift here is exactly the kind of silent privilege accumulation that architectural patterns for zero-trust identity are supposed to eliminate, and constrained delegation grants are one of the most under-audited object attributes in most AD environments precisely because they are invisible in the standard GUI tooling unless you know to look for them.

Fixing Double-Hop Kerberos With Constrained Delegation architecture diagram 2

#Failure Modes and Edge Cases

Resource-based constrained delegation removes the cross-domain write dependency but introduces its own class of failure.

  • Account recreation, migration and renames. The grant stores the front-end account’s SID, so a rename alone changes nothing. If the account is deleted and recreated, the new object has a new SID that the grant does not contain, and S4U2Proxy requests are refused until you grant the new account. If the account is migrated to another domain it gets a new primary SID; SID history may let the old SID still match, but do not rely on that: update the back-end’s grant to the new account as part of the migration and test delegation before SID history is removed.
  • Claims stripping across forest trust. When RBCD spans a forest trust, Active Directory drops user and device claims entering the resource forest unless the trust has a claims transformation policy that allows them. Back-end resources that rely on claims-based authorisation rather than group membership will fail authorisation checks even though the Kerberos exchange itself succeeds.
  • KDC round trips at scale. Every S4U2Proxy exchange is a ticket request to a domain controller. Under high fan-out (a front-end calling dozens of back-end microservices per request), those extra requests add latency per hop and load on the DCs handling them, so measure both in a pilot before rolling out widely.
  • Protocol transition abuse. S4U2Self does not require the user to prove possession of credentials to the requesting service — this is by design, but it means any account granted delegation rights that is also compromised can impersonate any user to the resources it’s authorised against, without that user ever authenticating. This is why the back-end SID list must be reviewed with the same rigor as a privileged group membership, not treated as a low-risk plumbing setting.

#Scaling and Security Trade-offs

Rolling constrained delegation out fleet-wide surfaces trade-offs that don’t appear in a single-server proof of concept.

  • Blast radius vs operational overhead: RBCD’s per-resource SID list is more granular than KCD’s per-front-end SPN list, but at scale (hundreds of back-end services) it means hundreds of individually-managed security descriptors rather than a centralised delegation table — automation is not optional past a handful of services.
  • Cross-forest latency: RBCD across a forest trust uses cross-realm referrals, so each hop can need more KDC requests than same-domain delegation; for latency-sensitive synchronous call chains, measure the added latency in a pilot.
  • Auditability: Unlike group-based access, delegation grants don’t appear in standard AD group membership reports. Security teams need a dedicated LDAP query or SIEM rule against msDS-AllowedToActOnBehalfOfOtherIdentity to maintain visibility, or the grants become effectively invisible shadow trust relationships.
  • Migration risk: Moving from unconstrained to resource-based constrained delegation is not atomic — during the transition window, some front-ends may hold both an unconstrained flag and a resource-scoped grant, and removing the unconstrained flag prematurely breaks any legacy integration that was silently depending on it.

None of this makes RBCD optional in a modern AD estate that still runs multi-tier Windows services. Unconstrained delegation on a front-end account is functionally equivalent to storing a domain-wide impersonation key on whichever server happens to be compromised first, and every red-team engagement treats it as exactly that. Getting constrained delegation right — resource-owned, SID-audited, and reviewed on the same cadence as privileged group membership — is one of the few AD hardening tasks that directly closes a well-understood, frequently exploited lateral-movement path without requiring a platform migration or a new security product to operate it.

Evidence trail

Sources and verification

Primary documentation and external technical references used in this article.

  1. 01MS-SFUlearn.microsoft.com

About this page

Credited to

Dates

Published

Last updated

Corrections

  • : Corrected during a review of published articles. Details
  • : Corrected during a review of published articles. Details
Reader Interaction

Comments

Add a thoughtful note on Fixing Double-Hop Kerberos With Constrained Delegation. Comments are checked for spam and held for moderation before appearing.

Loading comments...

Discover more

Lexicon Definitions

Learn More About KBY

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Engineering insights, direct to you.

Receive the latest Systems Engineering tutorials, production guides, Engineering Labs and operational best practices.