Pick the operation first
Disable and revoke contain the leak as soon as the change reaches every gateway pod. The control plane writes a change event, and a pod that receives it stops serving the key on the next request, in about 10 seconds.
A pod that cannot reach the control plane serves the cached key for longer: up to the token expiry of 15 minutes, and past it to the hard cap set by
LW_GATEWAY_AUTH_CACHE_HARD_GRACE_SECONDS, six hours by default. Read Step 3 for the three paths and their timings, and report containment against the slowest one that applies.
Rotate leaves the old secret working for a day, so it is a rollover tool rather than a containment tool.
All three keep the key’s id, so its traces, its audit rows and its spend stay attributable.
Step 1: find the key
The first 13 characters of a secret are its display prefix, and the prefix is safe to paste into a ticket. Match it against the key list:Step 2: capture the state before you change anything
Rotation and revocation both write an audit row, but the questions you will be asked afterwards are about what the key was doing before you touched it.- Open the key detail page and read its Audit history, which is the audit log filtered to this key.
-
Read the key’s spend for the window you care about:
- Note the request pattern in Trace Explorer, filtered to this key.
Step 3: stop the traffic
Revoke when the secret is public:What happens to traffic already in flight
A request that has already been authenticated runs to completion. The three operations do not cancel it. New requests stop as each gateway pod learns about the change:
The third row is the case worth planning for. While the control plane is reachable, a revoked key is refused within seconds, because a
403 from the control plane evicts the cached entry at once with no grace. The grace window only covers a control plane the pod cannot reach, and during such an outage a key revoked just before it can keep serving to the cap.
If you need every pod to forget the key immediately, restart the gateway Deployment. Every new pod starts with an empty cache and resolves each key from the control plane on its first request.
Step 4: rotate and roll the callers over
Rotation mints a new secret and keeps the old one valid for 24 hours, so callers can pick up the new value without a break.401 invalid_api_key.
Step 5: read the audit trail
Every create, update, rotate, disable, enable and revoke is an audit row carrying the actor, the time, and the before and after state. Filter the audit log in the app toTarget = virtual_key and the key’s id, then export it for the ticket. For a scripted export, read the log through the API. See Audit log for the row shape and the query.
Three questions to answer from it:
- When did the leak start? Look for a configuration change that widened the key, a scope added or a limit raised, next to a change in the spend pattern.
- Who could act on the key? The actor column on every row, and the key’s permissions. See RBAC.
- What did it reach? The key’s traces for the suspect window, and the spend for the same window.
What not to do
- Do not delete the key. Revocation keeps the row, so the traces and the spend stay attributable. A deletion loses the record you need for the review.
- Do not assume the provider credential is safe. If the same leak could have exposed the upstream API key, rotate that one in the provider’s console as well.
- Do not rotate when the secret is public. Rotation leaves the old secret working for 24 hours. Revoke instead.
- Do not paste the new secret into chat. Put it in the secret store first.
See also
- Virtual keys: the rotate, disable and revoke operations in full.
- Audit log: what is recorded and how to query it.
- RBAC: who can act on which keys.
- Troubleshooting: what callers see after each operation.