Checking access…

Skip to main content
Audience: CCG Platform Engineers

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 rotation
  • ROTATED (202): one or more payees were rotated successfully
  • PARTIAL (202): some payees rotated; some failed (check logs)
  • FAILED (422): processed but none rotated successfully
  • SKIPPED (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:

  1. Event Grid subscription targets POST /api/eventgrid/v1.0/keyvault-secret-event.
  2. Subscription validation succeeded (service returns the validationResponse).
  3. data.ObjectName equals ${merchant.payee.encryption.secret-name}.
  4. 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_EVENT in payment-service