BYOK rotation and lifecycle runbook
This runbook walks a real key rotation end to end: what to verify in your KMS before you start, the exact API sequence, what your traffic sees while you rotate, the failure modes that abort a rotation, and how to recover from a revoked key. The Customer-Managed Keys (BYOK) reference documents the state machine, the endpoint surface, and the provider grammar; this page is the operational procedure you follow during a rotation window.1. Lifecycle refresher
A registered key moves through three states; rotation is available frompending and active alike and never changes the state it finds:
Two rules shape every procedure below:
- A live key is rotated, never replaced.
PUT /compliance/byokonly accepts a new reference when no key exists or the previous one isrevoked; against apendingoractivekey it returns409 BYOK_KEY_ALREADY_REGISTEREDand points you at rotate. - A revoked key is never rotated. Rotate on a revoked key returns
409 BYOK_REVOKED; re-register afresh withPUTinstead.
2. Pre-rotation checklist
Complete all three checks before calling rotate. The rotation endpoint never calls your KMS; every check here is on your side of the boundary.-
The new key exists and matches the expected pattern. Copy the
canonical reference for your provider and confirm it is the same
shape, region, and account your policy expects. An ARN from a
different AWS region or account is a different key reference; a
mistyped one fails validation with
409 BYOK_INVALID_KEY_REFERENCE. - Orbit’s service identity has decrypt access on the new key. Grant the same access you granted at activation (an AWS key policy statement, a Google Cloud IAM binding on the CryptoKey, an Azure Key Vault access policy, or a Vault policy) before you rotate, not after.
-
Know your
enforceposition. If the current key is enforced, rotation re-asserts enforcement by unwrapping the internal data-encryption key under the old reference and re-wrapping it under the new one in the same call. That unwrap needs the old key to still be usable, so keep the old key enabled and the grant in place until rotate returns success.
3. Rotation, step by step
All endpoints are rooted athttps://api.orbit.devotel.io/api/v1/compliance/byok.
Step 1 — Read the current state (GET /compliance/byok).
config.state, config.enforced, and config.rotation_count so you
can confirm the change afterwards. If config is null, no key is
registered: use the register path in the worked GCP sequence below
instead of rotate.
Step 2 — Rotate to the new reference.
active key stays active; a pending key stays pending. The
response returns the updated view with the new fingerprint.
Step 3 — Activate, only if the key is pending and you are ready.
Pass enforce: true only after checklist item 2 is verified for this
key; see What enforce is.
GET from step 1 and check that
rotation_count incremented by one, rotated_at moved, and the
fingerprint changed. Then, and only then, retire the old key in your KMS.
Worked sequence: rotating an active AWS KMS key
active and preserved
enforcement.
Worked sequence: re-registering a Google Cloud KMS key after revoke
4. What enforce is (and is not)
enforce is a compliance-evidence assertion recorded at activation:
“this customer key governs our organization’s key-management policy.” It
is not a runtime data re-encryption. Tenant data at rest stays under
platform-managed encryption in every state, and activation, rotation, and
revocation all complete without touching stored data or in-flight
traffic.
What enforcement does change is the failure posture of BYOK-consulting
field-encryption calls: with enforce on they fail closed with
409 BYOK_KEY_UNAVAILABLE when the key is revoked, unprovisioned, or its
wrapped key is unrecoverable, instead of falling back silently to the
platform key.
Two operating rules follow:
- Do not set
enforceunless your KMS access policy is verified. Enforcement turns a KMS misconfiguration into a hard refusal by design; confirm the service-identity grant first. - Rotation is not the way to clear enforcement. Enforcement survives rotation (that is the re-wrap in checklist item 3). The only exit that clears it is revocation, below.
5. Failure modes
Rotated key orphaned. If the new reference passes validation but the
key it points at is already scheduled for deletion or lives in a recycled
region, rotation succeeds at the control plane and fails later at the
enforcement seam. Verify the new key is live in your KMS (checklist item
- before rotating; the fingerprint Orbit records identifies only the reference, not the key’s health.
POST /compliance/byok/revoke clears enforcement
and destroys the wrapped data-encryption key. It is irreversible for that
registration, and it does not re-encrypt or otherwise affect stored
tenant data. Re-register afresh when you are ready.
6. Revocation and recovery
Revoke withdraws the customer key: it clears enforcement from your recorded policy and destroys the wrapped data-encryption key so it can never be unwrapped again.PUT a new key (the revoked
config no longer blocks registration), run the pre-rotation checklist,
and activate. Revoking an already-revoked key returns
409 BYOK_ALREADY_REVOKED.
Roles and visibility
Writes (PUT, and the activate / rotate / revoke posts) require the
owner or admin role, in the dashboard and via the API. GET is
available to any authenticated member of the organization, and read views
echo a truncated fingerprint, never the raw ARN or vault path, so a
viewer cannot learn the exact key reference.
See also
- Customer-Managed Keys (BYOK) reference — state machine, endpoint surface, and provider grammar.
- BYOK dashboard walkthrough — the same lifecycle from Settings → Compliance.
- Error codes reference — every
409 BYOK_*conflict code. - Audit log — filter by fingerprint to reconstruct the rotation window.
- Compliance evidence binder — cite the resolved posture as evidence.