Inside NLA, in what order do TLS, SPNEGO, the public-key binding and credential delegation run in CredSSP, and what does each step settle?
answer
- encryption first, identity second
- Kerberos preferred, NTLM as the other choice
- TLS key tied to the authentication
- the user's credentials travel last
basics
~20 sCredSSP builds a TLS channel, runs SPNEGO inside it to authenticate with Kerberos or NTLM, has the client prove the server's TLS public key matches that authentication, and only then delegates the user's credentials to the server.
solid answer
~40 sCredSSP (MS-CSSP) works in four steps. First a TLS handshake gives an encrypted channel; the client is still anonymous. Second, SPNEGO runs inside it and selects Kerberos or NTLM, which authenticates user and server and yields a session key. Third, the client sends an encrypted value derived from the server's TLS public key, and the server confirms it; this binds the TLS channel to the authentication so the key presented in TLS belongs to the server that was authenticated. Fourth, the client sends the user's credentials (a password or smart card PIN structure) encrypted under the SPNEGO key. Delegation is deliberately last.
go deeper
Know that CredSSP is TLS plus Kerberos or NTLM, and that the credentials are sent only after authentication succeeds.
Explain the four steps in order, why the public-key binding exists, and that Kerberos is preferred with NTLM used when a side lacks it.
Distinguish versions 2 to 4 from 5 and 6, read an error that surfaces from the server's errorCode, and tell a Kerberos success from an NTLM one in an audit.
State the limit: authenticating a server is not the same as trusting it with credentials, so the policy about where credentials may be delegated matters as much as the protocol.
## The four steps NLA is CredSSP, and MS-CSSP defines its sequence. Every CredSSP message is a `TSRequest` structure carried over the TLS channel, with fields for the negotiation tokens (`negoTokens`), the public-key proof (`pubKeyAuth`), the delegated credentials (`authInfo`) and, from version 5, a client nonce (`clientNonce`). 1. **TLS handshake.** The client and server build an encrypted channel. The server does not ask for a client certificate, so the client is still anonymous, and the protocol does not require the two sides to share a trusted certification authority root: the server certificate may be CA-based or self-signed. Session resumption is not supported. 2. **SPNEGO authentication.** Inside the channel, SPNEGO selects Kerberos or NTLM and the chosen package authenticates the user and the server. Its tokens travel in `negoTokens`. The result is an encryption key: a Kerberos subsession key or an NTLM session key. 3. **Public-key binding.** When the client sends its last authentication token it also sends `pubKeyAuth`, which proves it saw the same server public key that TLS used. The server verifies this and answers with its own proof. The purpose, in the specification's words, is to assure that the public key used by the server in the TLS handshake belongs to the target server and not to a man-in-the-middle. 4. **Credential delegation.** Only after the client has validated the server's answer does it send `authInfo`: a `TSCredentials` structure holding exactly one of `TSPasswordCreds`, `TSSmartCardCreds` or `TSRemoteGuardCreds`, encrypted under the SPNEGO key. ## What each step settles | Step | Settles | Does not settle | |---|---|---| | TLS | Confidentiality and integrity of everything after it | Who the client is | | SPNEGO | Which package (Kerberos or NTLM) authenticates, and a shared key | That the TLS key belongs to the authenticated server | | Binding | That the TLS key is the authenticated server's key | Whether the user may log on remotely | | Delegation | The server now holds what the client chose to send | Anything about what the server does with it | ## Kerberos or NTLM SPNEGO is the selector. In Windows, Kerberos is always preferred, and NTLM is negotiated only when one or both parties do not support Kerberos. The mechanics of the SPNEGO tokens and of Kerberos delegation are covered with Kerberos; for this protocol what matters is that either package ends in a session key that protects the binding and the credential message. ## Two generations of the binding | Version | What `pubKeyAuth` carries | |---|---| | 2, 3, 4 | The server's public key encrypted under the SPNEGO key; the server replies with that key with 1 added to its first byte, so the client's own message cannot be returned to it as the answer | | 5, 6 | A SHA-256 hash over a fixed string, the 32-byte `clientNonce` and the public key, with separate client-to-server and server-to-client strings | MS-CSSP notes that a major revision was applied in version 5 for improved security and advises implementors to support version 5 or higher only. Version 5 is available in Windows Server version 1803 and later, or through an update, and Group Policy sets the minimum version a client accepts. Older Windows releases from Windows XP SP3 through Windows Server 2012 support only version 2. ## Why delegation comes last Because the client sends `authInfo` only after it has validated the server's answer, it has a chance to stop before any credential is sent. The specification says the client validates the server's authenticity, by generating and comparing the server hash for version 5 and higher, and only then encrypts the user's password or smart card PIN. In Windows the CredSSP client takes the credentials from the calling application if one passed them; otherwise from those stored locally for the target server; otherwise from the user's default sign-in credentials. That is why the question of what a connection delegates always starts on the client. ## Reading it as a reviewer - **Ask which package ran.** A connection that ended in NTLM instead of Kerberos tells you that one side lacked or could not use Kerberos, which is a finding worth following up. - **Delegation is a choice of the client.** The fourth step sends whatever credential structure the client built; the modes that send empty or redirected credentials change only this step. - **Errors surface early.** If SPNEGO fails on the server and the client announced version 3 or higher, the server should return a `TSRequest` with an NTSTATUS in `errorCode`, and the client must stop at once. - **Trust in the server is not trust with credentials.** The specification warns that authenticating a server does not mean it is trusted with the user's credentials, and recommends policy about which servers may receive them.
- Why does CredSSP bind the TLS public key into the authentication at all?TLS here runs with an anonymous client and possibly a self-signed certificate, so the key it used proves little by itself. The binding ties that key to the party SPNEGO authenticated, so a different endpoint holding the TLS session cannot pass as the authenticated server.
- Which credential structures can the final message carry?Exactly one of `TSPasswordCreds`, `TSSmartCardCreds` or `TSRemoteGuardCreds`. Restricted Admin mode sends empty credentials in `TSPasswordCreds`; Remote Credential Guard sends a redirected logon buffer in `TSRemoteGuardCreds` and keeps the TLS channel for redirected authentication requests.
- How does a client learn that the server's SPNEGO step failed?If the client announced version 3 or higher, the server should send a `TSRequest` whose `errorCode` holds an unsuccessful NTSTATUS code. On receiving it the client must fail immediately with that status and stop further processing.
- CredSSP always authenticates with NTLM inside TLS.
- The TLS step of CredSSP authenticates the client with a certificate.
- The user's credentials are sent first and verified afterwards.
- Kerberos and NTLM messages travel beside TLS rather than inside it.
- A CA-trusted server certificate alone makes CredSSP safe to delegate to.