Access Control
KeyPolicy, principals, attestation profiles and step-up approvals for Enclave Vaults.
Every key in Enclave Vaults carries a KeyPolicy that controls who can do what, under which attestation conditions, and with which approvals. The policy is part of the sealed state of the vault and is enforced inside the enclave on every call. There is no admin override.
A policy has four parts: principals (who is recognised), operations (what each may do, and on which conditions), mutability (which parts of the policy may change later, and by whom), and lifecycle (how long the key lives, see Key lifecycle).
Principals
The vault recognises two kinds of principal.
| Principal | Authentication | Matched on |
|---|---|---|
| OIDC | A bearer JWT, verified against the vault's configured issuer and audience through JWKS | issuer, and sub, and the token's roles against required_roles. An empty sub matches by role alone |
| TEE | Mutual RA-TLS: the caller's SGX or TDX quote is read from its certificate and verified through an attestation server | an attestation profile |
The policy names them in four slots:
| Slot | Kind | Typical use |
|---|---|---|
owner | OIDC, required | the person or service that owns the key |
managers | OIDC, any number | people who approve sensitive operations or new measurements |
auditors | OIDC, any number | people who read the key's audit log |
tees | TEE, any number | the enclaves allowed to use the key |
A principal that is not listed cannot influence the key in any way. Rules refer to them as Owner, Manager(i), Auditor(i), Tee(i) or AnyTee.
Live human approval does not need a principal of its own: it comes through the identity provider, which issues a short-lived token after a wallet or passkey ceremony (see Step-up).
Operations
These operations are governed by the policy: Sign, Wrap, Unwrap, Mac, ExportKey, DeleteKey, UpdatePolicy and PromoteProfile. Creating a key needs a creation grant from the platform; listing keys, reading the audit log, and staging and revoking a pending profile follow fixed rules described below.
Each rule has the form "these operations are allowed for these principals when these conditions hold":
{
"ops": ["PromoteProfile", "UpdatePolicy", "DeleteKey"],
"principals": ["Owner"],
"requires": [
{ "OidcStepUp": { "required_amr": ["webauthn"], "operation_bound": true, "fresh_for_seconds": 300, "binding": 2 } }
]
}An operation is allowed when any rule lists the operation and the caller, and all of that rule's conditions pass.
| Condition | Meaning |
|---|---|
OidcStepUp { required_amr, operation_bound, fresh_for_seconds, binding } | The caller's token proves a fresh step-up, bound to this operation; see below. |
Step-up
OidcStepUp requires the caller's OIDC token to carry every method in required_amr (for example ["webauthn"]) and to have been issued within fresh_for_seconds. The identity provider issues such a token only after a wallet or passkey ceremony. The token is also bound to this exact operation through its vault_op claim, so an approval for one operation cannot be replayed for another. binding says which binding the key takes, and the key accepts only that one.
Binding 2, the canonical condition {"required_amr":["webauthn"],"operation_bound":true,"fresh_for_seconds":300,"binding":2}, covers every operation that governs a key: create (of a re-created name, see Deleted names), promote, export, update_policy, update_policy_from, delete and delete_after. The approval binds:
- the members of the constellation (each vault checks that it is named);
- the operation and the key handle;
- the target: the measurement being promoted, the digest of the new policy, or the successor of a key being deleted after a move;
- the policy version, so any change to the policy invalidates outstanding approvals;
- the approver, a nonce and an expiry.
The token must be fresh within 300 seconds, its expiry is at most 10 minutes ahead (24 hours for a delete_after, which is presented only once the move has finished), and the vault accepts each approval once. Keys created before binding 2 keep binding 1 (operation_bound with binding absent), which binds the handle, the measurement, the policy version, a nonce and an expiry for promote and export.
Approval by default
A new key's policy must ask for a wallet approval (a passkey step-up bound to the operation) on every rule through which a person can promote, update or delete the key, and export it when it is exportable. A policy without one is refused unless it opts out explicitly with "approval": "none". Rules that name only enclaves (Tee, AnyTee) are exempt: an app fetching its own key is not a governance act. A later update cannot take away the approvals a key has.
Exporting a key you created through the platform always requires an operation-bound WebAuthn step-up no older than 300 seconds.
Attestation profiles
An attestation profile describes what a calling enclave must look like.
| Field | Purpose |
|---|---|
name | A label for the profile. |
measurements | The accepted measurements: Mrenclave (SGX, hex) or Tdx { mrtd, rtmr1, rtmr2 } (all three must match). Any one listed measurement is enough. |
attestation_servers | The attestation servers that may verify the caller's quote. At least one. |
required_oids | (oid, expected_value) pairs that must appear in the caller's RA-TLS certificate, such as the app's code hash. |
acceptable_tcb_statuses | The platform TCB statuses accepted from the attestation server. A Revoked platform always fails. |
A policy usually lists several measurements or profiles (for example, the version running now and the next one) so that operations continue across deploys.
Approving a new measurement
When the app that uses a key is rebuilt, its measurement changes, and the new build has no access to the key until someone allowed to promote it approves. The new measurement waits in a pending slot:
- Stage. The owner, a manager, or the platform stages the new profile (up to 16 pending per key). Staging grants nothing.
- Promote. A caller allowed
PromoteProfileby the policy approves it, typically with a step-up. The profile joins the key's TEE principals and the policy version increases. A promotion only adds:required_oidscan be added or strengthened, never dropped. - Revoke. A pending profile can be withdrawn by whoever the policy's mutability allows; the platform cannot revoke.
A key can opt in to auto_migrate_to_next_attestation_profile. Only then, and only for a profile the platform staged whose change is to the runtime alone (same required OIDs, attestation servers, TCB policy and TEE family), is the promotion automatic. Only the owner can turn this on or off. Retiring an old measurement once the new one runs is a separate step.
Mutability
mutability says which parts of the policy may change after creation, and by whom. It lists fields under owner_can, manager_can and immutable, from Owner, Managers, Auditors, Tees, Operations, Lifecycle, Mutability and PendingProfiles.
- A field in
immutablenever changes for the life of the key. - Auditors and TEE principals can never change the policy.
- Only the owner can switch automatic migration on or off.
- A key's expiry date never moves, whatever the policy allows; see Key lifecycle.
- The owner can always tighten a key: adding the canonical bound passkey step-up to existing rules that people use (and that govern promote, update, delete or export) is allowed even where
owner_candoes not listOperations, unlessOperationsisimmutable. Nothing else may change in the same update. - A rule change on a binding 2 key sends the new policy exactly as
CanonicalisePolicyreturns it (the form the vault stores and returns), so the owner approves the same JSON the vault keeps. Asupdate_policy_from, the approval also binds the digest of the rules it replaces, so the wallet can show both.
Deleted names
Deleting a key leaves a tombstone: the material is gone, and the vault remembers the name until the key's original expiry. Every way of creating a key stops at a tombstone, so a deleted name cannot quietly come back with a new value. Re-creating it is an explicit act: a new handle ending in new-<k>, created only with the owner's bound create approval of the exact policy it will hold. When the original expiry passes, the tombstone and the key's audit log are removed and the name is free again.
How a typical call is evaluated
For a sensitive Sign call by an application enclave:
- The enclave opens a mutual RA-TLS channel to the vault holding the key. The vault verifies its quote and matches it against the key's TEE principals.
- The vault finds a rule that allows
Signfor that principal. - It checks the rule's conditions, if it has any. An enclave's own rules usually have none: the attested channel already proved who is calling.
- It signs inside the enclave and returns the signature. The private key never leaves.
- The call, allowed or denied, is appended to the key's audit log.
Audit log
Every operation on a key, allowed or denied, is recorded in that key's audit log with a sequence number, the time, the operation, the caller and the outcome, plus a reason for a refusal. Any principal of the key can read it (privasys vault key audit). The log is sealed with the vault's storage.
Why this is more than RBAC plus attestation
Classical RBAC says "this user can do this thing". The vault adds two orthogonal axes:
- The calling code's identity must match. Not just the user, but the exact enclave binary acting on their behalf. This removes "a secret leaked from a CI runner" as a threat.
- A fresh act of human consent can be required. Not a long-lived token, but a per-operation wallet or passkey ceremony. This removes "a compromised long-lived credential" as a threat for the operations that matter most.
Architecture
How the Enclave Vaults distributed vHSM is built. Typed key objects, in-enclave operations, RawShare distribution, per-key policy, and a controlled lifecycle for caller-enclave version changes.
Key lifecycle
Vault keys expire after at most 90 days. What that means, how to see it, how keys are renewed, and what happens when the vault itself is upgraded.