Privasys
Enclave Vaults

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.

PrincipalAuthenticationMatched on
OIDCA bearer JWT, verified against the vault's configured issuer and audience through JWKSissuer, and sub, and the token's roles against required_roles. An empty sub matches by role alone
TEEMutual RA-TLS: the caller's SGX or TDX quote is read from its certificate and verified through an attestation serveran attestation profile

The policy names them in four slots:

SlotKindTypical use
ownerOIDC, requiredthe person or service that owns the key
managersOIDC, any numberpeople who approve sensitive operations or new measurements
auditorsOIDC, any numberpeople who read the key's audit log
teesTEE, any numberthe 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.

ConditionMeaning
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.

FieldPurpose
nameA label for the profile.
measurementsThe accepted measurements: Mrenclave (SGX, hex) or Tdx { mrtd, rtmr1, rtmr2 } (all three must match). Any one listed measurement is enough.
attestation_serversThe 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_statusesThe 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:

  1. Stage. The owner, a manager, or the platform stages the new profile (up to 16 pending per key). Staging grants nothing.
  2. Promote. A caller allowed PromoteProfile by 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_oids can be added or strengthened, never dropped.
  3. 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 immutable never 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_can does not list Operations, unless Operations is immutable. Nothing else may change in the same update.
  • A rule change on a binding 2 key sends the new policy exactly as CanonicalisePolicy returns it (the form the vault stores and returns), so the owner approves the same JSON the vault keeps. As update_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:

  1. 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.
  2. The vault finds a rule that allows Sign for that principal.
  3. 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.
  4. It signs inside the enclave and returns the signature. The private key never leaves.
  5. 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.
Edit on GitHub