# Runbook Exercises - **Status:** Maintained; RFC-0010 and RFC-0036 (release readiness 8o). - **Owner:** Security owner. - **Last updated:** 2026-12-01 RFC-0010 requires the [incident runbooks](../../guide/runbooks.md) to be exercised before a release candidate is promoted. This page records each exercise: how it was run, what it covered, what it did not, and what it changed. ## Exercise 1: executable drills, 2026-12-01 **Method.** Each runbook became a test that follows its steps in order through the public API and checks its verification step (`tests/integration/test_runbooks.py`). In-memory key services stand in for real ones: the HPKE provider as a key service, the quorum provider, and a key service that can be taken down mid-run to simulate an outage. The CloudTrail step of the first runbook runs through the real boto3 client against an in-process KMS (`tests/provider_packages/test_aws_kms_client.py`). The drills run on every change, on Linux, macOS, and Windows, so a runbook step that stops working fails CI. | Runbook | Exercised | Result | | --- | --- | --- | | A key-service key may be compromised | Exposed envelopes found from the encryption context of a suspicious `Decrypt` call; a new primary key with the compromised key kept for opening; rewrap of every envelope, rerun until nothing moves; re-encryption of the exposed envelope; the compromised key removed; verification with a `Protector` that no longer trusts it. | Passed after finding 1. | | The escrow key may be compromised | A new escrow key; rewrap with `replace=` as the runbook shows, on envelopes with the old escrow key and on envelopes with both; rerun; opening on a separate `Protector` with only the new escrow key; the old escrow key no longer opens them. | Passed. | | A quorum custodian leaves or loses a key | A new quorum version without the departed custodian and with a successor; rewrap; the new set opens; the old set, the departed custodian included, no longer does. | Passed. | | The key service is unavailable | Opening falls back to the second region; a reader with only the primary key waits; sealing fails closed; writers switch to the prepared configuration; switching back. | Passed after finding 2. | | Authentication failures rise | Context mismatch and changed bytes: not retryable, the same on every attempt, separated by code and not by message; truncated and extended envelopes; `inspect` on failing and foreign envelopes; failures in the audit trail. | Passed after finding 3. | | The audit trail fails verification | Each of the seven reasons in the runbook's table, produced from the damage it names; verification up to the last checkpoint that still matches; re-signed records that verify one by one but end at no published checkpoint. | Passed after finding 4. | | A vulnerability affects your version | `cryptosuite doctor`; finding envelopes by format version, suite, and provider; rewrap of the affected ones. | Passed. | ### Findings 1. **No way to compute the CloudTrail context from a stored envelope.** The runbook said to compute `binding_context` over stored envelopes, but that function takes an envelope's protected bytes, which no public function returned. `cryptography_suite_aws_kms.envelope_binding_context` now computes it from an envelope, or from its first bytes, and the runbook names it. 2. **Switching back after an outage dropped a recipient.** A rewrap replaces one recipient and cannot add one, so switching back with a rewrap, as the runbook said, left envelopes written during the outage without the second region's recipient. The runbook now says to re-encrypt them with the usual configuration. 3. **Storage damage has codes of its own.** Truncated or extended envelopes fail as `FORMAT_INVALID` or `TRAILING_DATA` before authentication; the runbook mentioned them only under authentication failures. It now names both codes. 4. **"Verify up to the last checkpoint" did not say how.** The runbook now says to pass the lines up to the checkpoint's `sequence`, with the checkpoint as `expected_end`. ### Not exercised These parts need a real deployment, and remain for a rehearsal with a real key service (for example during the external trial, RFC-0036 gate 6): - revoking credentials, restricting a key policy, and disabling and scheduling the deletion of a key at a real key service; - querying real CloudTrail, Cloud Audit Logs, Azure Monitor, or Vault audit logs; - quotas and throttling, and raising a quota; - an offline machine for the escrow key, and custodians as people (the distributed quorum ceremony is tested in `tests/integration/test_quorum_ceremony.py`); - the advisory process itself, from a private report to a published fix.