Operate PayeeConfig Encryption & Key Rotation
Use these procedures to rotate keys, investigate failures, and respond to incidents. See the overview for the design and the reference for configuration and error details.
Operational Runbookβ
When to run rotation manuallyβ
Use POST /v1/encryption/key-rotation when:
- a new Key Vault secret version was created but Event Grid delivery is delayed/missed
- you need to force convergence after fixing encryption/config
- you want immediate remediation before a release window closes
Example:
curl -X POST https://<merchant-service-host>/v1/encryption/key-rotation
How to interpret the responseβ
UP_TO_DATE(200): nothing needed rotationROTATED(202): one or more payees were rotated successfullyPARTIAL(202): some payees rotated; some failed (check logs)FAILED(422): processed but none rotated successfullySKIPPED(200): another rotation is already in progress (PostgreSQL advisory lock is held by another instance)
Troubleshootingβ
Rotation didnβt trigger after creating a new secret versionβ
Check:
- Event Grid subscription targets
POST /api/eventgrid/v1.0/keyvault-secret-event. - Subscription validation succeeded (service returns the
validationResponse). data.ObjectNameequals${merchant.payee.encryption.secret-name}.- Logs for
event=KEY_ROTATION_TRIGGERED trigger=EVENT_GRID ...or ignore logs for unrelated secrets.
Rotation ran but payees still show old key versionsβ
Check:
- completion log:
event=KEY_ROTATION_COMPLETED ... rotated=<n> failed=<n> - per-payee failures (
PAYEE_CONFIG_*_FAILED) - downstream consumption of
MERCHANT_UPDATED_EVENTin payment-service