Device trust and posture
A device's posture is only useful when it comes from a source the service trusts, is tied to the request it arrives with, and is fresh enough. A rule must also decide what happens when the evidence is missing, which is the case attackers arrange.
What a device can tell you
All names, domains, and identifiers in these examples are fictional. Context, devices, and risk made the case for asking device management, not the browser, whether a laptop is managed, and for proving that answer with a key the device holds. This lesson looks inside that answer. What exactly does device management know about Omar's laptop, how can a server be sure the answer is about this laptop and not a copy of it, and what should a policy do on the many days when there is no answer at all?
Device posture is the set of facts about a device's state that a policy can use. For Omar's newsroom laptop, laptop-0417, device management can report several, and each is a separate fact with its own way of being wrong:
| Fact | How it is known | How it can mislead |
|---|---|---|
| Enrolled in device management | The management service issued the laptop a certificate when it was set up | Enrollment is a past event. A laptop enrolled last year may not have checked in for months. |
| Operating system up to date | The management agent on the laptop reports its version | The report comes from software on the device, so malware with enough control can make it say anything. |
| Disk encrypted, screen lock on | The agent reports the settings it enforces | True when reported, and only as fresh as the last report. |
| Key held in hardware | An attestation signed by the security chip | Proves where a key lives, not that the operating system around it is healthy. |
| Not reported lost | The management service's own records | Changes the moment someone reports the loss, long after any token was issued. |
Management systems usually fold these into one word, compliant, meaning the device met every requirement of the organization's device policy at its last check. That word is convenient for a rule, but the Gazette's decision service also keeps the time of the check and which version of the device policy was applied, because "compliant under last year's policy, as of three weeks ago" is not the evidence the download rule needs.
Attestation: evidence the device cannot simply claim
Most of the facts in the table are reports from software running on the laptop. If that software is compromised, the reports are too. Attestation adds evidence from a part of the device that ordinary software cannot rewrite: a security chip, such as a TPM in a laptop or a secure element in a phone.
When device management enrolls laptop-0417, it asks the security chip to create a new key pairA private key and a public key generated together and mathematically linked. The private key creates signatures and the public key checks them, but the private key cannot practically be worked out from the public one.. The private keyThe half of a key pair that its owner keeps to themselves and uses to create signatures or decrypt data. Anyone who obtains it can act as its owner. never leaves the chip. The chip then signs a statement about that key with its own attestation key, whose certificateA signed statement that a public key belongs to a name, such as a website's hostname, for stated purposes and a limited period. A certificate authority signs it, so software that trusts the authority can connect the key to the name. chains up to the chip's manufacturer. The statement says, in effect: this public keyThe half of a key pair that can be shared freely. It checks signatures made with the matching private key and can encrypt data that only that private key can decrypt. was generated inside genuine hardware of this model, and its private key cannot be exported. The management service checks the signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message. chain against the manufacturer's root, checks that the statement answers a fresh challenge it sent, so an old statement cannot be replayed, and only then issues the laptop a certificate for that key.
Some platforms can also attest to how the device started, such as whether its boot process was the expected one, and some management services include their own signed compliance statement. What attestation does not prove is just as important. It says nothing about who is using the laptop, whether the browser is infected now, or whether the screen lock is on. It proves that a particular key lives in particular hardware, and the rest of the posture still comes from reports and records. The same distinction appears in passkeys, where an authenticatorSomething a person controls and uses to prove control of an account, such as a memorized password, an app that generates one-time codes, or a security key. It counts only after it has been registered to that account.'s attestation describes the authenticator model, not the person or the computer it is plugged into.
Binding the evidence to each request
Suppose device management confirms at 08:10 that laptop-0417 is compliant, and the authorization serverIn OAuth, the service that handles a person's sign-in and approval and decides which tokens to issue to a client. It may belong to the same company as the API, but its job is separate. records that in Omar's access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in.. If the tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. is an ordinary bearer tokenA token that works for whoever presents it: the API checks that the token is genuine and current, not who is holding it. That is why bearer tokens must be kept from being copied., anyone who copies it, from a browser extension, a proxy log or malware on another machine, can present it from anywhere, and the photo APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. will believe the request came from a compliant laptop. The posture was checked once, and the token carried that check away from the device it described.
The fix is to make the token usable only together with the device's hardware key, so that every request proves the key is present. This is proof of possession, and there are two standard ways to do it:
- Mutual TLS (RFC 8705). The laptop connects with its device certificate. The authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. server binds the token to that certificate by putting its thumbprint in the token's
cnfclaim asx5t#S256, and the photo API accepts the token only over a connection authenticated with the same certificate. - DPoP (RFC 9449). The client signs a short proof for every request with its private key. The token's
cnfclaim holds the key's thumbprint asjkt, and the API checks that each proof was signed with that key, for this method and URL, just now.
Here is the relevant part of Omar's token when the photo desk app uses DPoP with the laptop's hardware key, and the header and payload of the proof sent with one download:
Access token payload (excerpt)
{
"sub": "user-1187",
"aud": "https://api.photos.example",
"scope": "photos.read photos.download",
"cnf": { "jkt": "0ZcOCORZNYy-DWpqq30jZyJGHTN0d2HglBV3uiguA4I" }
}
DPoP proof header
{
"typ": "dpop+jwt",
"alg": "ES256",
"jwk": { "kty": "EC", "crv": "P-256",
"x": "l8tFrhx-34tV3hRICRDY9zCkDlpBhF42UQUfWVAWBFs",
"y": "9VE4jf_Ok_o64zbTTlcuNJajHmt6v9TDVrU0CdvGRDA" }
}
DPoP proof payload
{
"htm": "GET",
"htu": "https://api.photos.example/photos/9001/original",
"iat": 1781449200,
"jti": "e1j3V_bKic8-LAEB",
"ath": "fUHyO2r2Z3DZ53EsNrWBb0xWXoaNy59IiKCAqksmQEo"
}The API computes the thumbprint of the jwk in the proof and compares it with cnf.jkt in the token. It checks that htm and htu match this request, that iat is recent and jti has not been seen before, and that ath is the hash of the token presented with it. A copied token is useless without the private key, and the private key is in the laptop's chip.
Binding on its own proves only that the same key is present. It becomes posture evidence when the authorization server knows something about that key, because device management attested it and recorded it as belonging to laptop-0417, and it checked that device's current state before issuing the token. Then "the request was signed with this key" means "the request came from this laptop", and the laptop's compliance applies to every request, not just the sign-in. The later lessons on DPoP and certificate-bound access tokens cover both mechanisms in depth.
Missing evidence is a normal case
On any given day, many requests arrive with no posture at all. Lena, the freelancer, works from her own laptop, which the Gazette does not manage. A new hire's laptop is still enrolling. The device management service is down for an upgrade. None of these is evidence of danger, but none is evidence of compliance either, and the rule has to say what happens.
The trap is in how the rule is written. "Deny when the device is unmanaged" reads like a safe rule, but if the device attribute is missing, "unmanaged" is not true, the deny does not match, and the request is allowed. "Deny unless the device is known to be managed" treats missing evidence as not enough, which is almost always what a device condition means. For Lena, the Gazette pairs that strict rule with a second route, the passkey step-up from Conditional access policies, so missing posture leads to a different requirement rather than a dead end.
Collect only the posture the decision needs. The download rule needs to know whether laptop-0417 was compliant, and when. It does not need the list of applications installed on the laptop, its browsing history, or its location, and none of that belongs in an access token or a log. On a personal device such as Lena's, a full management agent may be unwelcome or inappropriate, which is another reason to offer a route that does not depend on it.
Posture also changes after it has been checked. A laptop reported lost at 14:00 was compliant at 08:10, and a token issued at 08:10 still says so. Short token lifetimes limit how long that stale answer lasts. For anything faster, device management has to tell the services that depend on it, which is the subject of Continuous access evaluation.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Test posture policy without mistaking test values for device evidenceWrite a device rule that refuses an unmanaged device and, just as firmly, a request with no posture at all, then see why the obvious rule lets missing evidence through.