Cloud
Azure Storage: contain an exposed SAS before revoking access
A production runbook for identifying an exposed SAS, bounding revocation, testing consumers and restoring service without reactivating a compromised secret.
A Blob download URL containing a SAS appears in a shared ticket. The link is still valid and a partner job also relies on it. Removing the ticket does not remove copies already made; regenerating an account key without an inventory can interrupt unrelated applications. Containment and restoring legitimate access are separate decisions.
This runbook follows an export in a Blob container. It distinguishes user delegation, service and account SAS, then walks through evidence, revocation and recovery. The names and identifiers below are fictional.
Contain exposure without copying the secret
Remove the URL from accessible material under the incident procedure, restrict further distribution, and notify the security and application owners. A SAS is a bearer secret: do not paste it into a ticket, chat or a command whose arguments or output are logged. Keep sensitive evidence in the approved incident system with restricted access and a defined retention period.
Record the account, container, affected path, UTC window, business owner, known consumers and required permissions separately. Inspect token fields only in a trusted environment; do not retain the signature. Delegation fields, a possible policy identifier, scope and expiry help classify the mechanism, but do not by themselves prove who used the link or which account key signed it. Confirm the issuer and signing method with the issuing system.
incident: INC-STORAGE-EXAMPLE
account: storage-exports-prod
resource: exports / partner-a / synthetic-report
exposure_detected_utc: "2026-11-17T07:00:00Z"
sas_type: unknown
issuer: unknown
account_key_slot: unknown
policy_identifier: none-confirmed
legitimate_consumers:
- partner-a-export
required_operation: read-single-blob
owner: data-platform
evidence: [request_id, utc_time, status, operation, consumer_version]
do_not_record: [sas_url, signature, account_key, connection_string] Missing logs are not evidence of no use. First check Storage data-log collection, time coverage and retention. Correlate available requests by time, operation, result and request ID with application traces; an IP address alone does not necessarily identify a consumer. Treat logs and captures as potentially sensitive too.
Match the revocation lever to the SAS
| Confirmed type | Revocation lever | Blast radius to prepare |
|---|---|---|
| User delegation | Revoke the account’s user delegation keys; dependent SAS tokens cease to work. | Other consumers of the account may lose their SAS tokens and need replacements. Propagation can be delayed. |
| Service with stored access policy | Revoke or expire the associated policy on the resource. | All SAS tokens tied to that policy are affected. Do not recreate it under the same name: unexpired tokens could become valid again. |
| Service without policy or account SAS | Regenerate the account key that signed the SAS. | Other SAS tokens and clients using that key are affected. If the slot is unknown, do not claim that one rotation is sufficient. |
A stored access policy applies to neither user delegation nor account SAS. Changing or removing the issuer’s roles or ACLs can also invalidate a user delegation SAS, but caching requires observation and the change can affect other access. See Microsoft’s guidance on user delegation SAS, service SAS and stored access policies.
During active exploitation or a high-risk exposure, the incident team may revoke immediately before inventory is complete, explicitly accepting the impact. An emergency network change can reduce exposure depending on the actual path, but it is not a substitute for revocation and may also interrupt legitimate clients.
Prepare replacement access and canaries
Identify applications, partners, delayed jobs and recovery procedures sharing the policy, delegation keys or account-key slot. For each consumer, record an owner, a non-secret configuration reference, reload method and test time. Do not infer the signing slot from the URL: if the issuer cannot establish it, prepare for the impact on both keys before rotating.
Prepare replacement access with the minimum scope, HTTPS and a limited lifetime, or use an Entra identity when the consumer supports it. Deliver a new SAS through an approved channel, never in the evidence. Use a new identifier for a replacement policy. Do not distribute a new token signed with a delegation key that is about to be revoked: issue it after revocation and verification.
Before change
Known client + old access: synthetic blob read succeeds
Disallowed operation: expected denial
After revocation and propagation
Exposed old SAS: expected denial on the same path
New SAS or identity: synthetic blob read succeeds
New SAS: write and other resource denied when outside the contract
Other inventoried consumer: test its actual function
Log UTC time, operation, status and request ID, not the signed URL Use a dedicated synthetic object and the client’s real network path. A 403 alone does not prove revocation: compare the error code and logs, check expiry, permissions, network and clock, then make the positive control succeed on the same object. Do not test a compromised token from an unapproved workstation.
Revoke, observe, restore
Freeze the change, record the mechanism and blast radius, and have an authorized identity perform the revocation. Record the actor, UTC time, resource and operation identifier, without secret values. For an account key, move known clients to the other valid key first when the situation allows; prove they have reloaded before regenerating the compromised slot. The other key is a service path, not proof that the exposed SAS is neutralized.
Repeat the canaries during an observation window agreed by the team. Caches can delay invalidation of a user delegation SAS: while old access still succeeds, keep the incident open and containment in place. Check legitimate consumers, including delayed jobs, then distribute and load replacement access in batches. Publishing a secret to a vault does not prove that a process loaded it.
Decide: close, hold or restore another way
Close after validation
Old SAS denied on the test path after propagation
Replacement access works with limited privileges
Critical consumers and jobs verified; monitoring active
Exposure and impact documented without secrets
Hold or escalate
SAS type or signing key unknown; consumers missing
Old SAS still accepted; insufficient telemetry
Positive control fails or negative denial is unexplained
Restore service without restoring the exposed secret
Return to previous application configuration only when it uses
separate, valid and uncompromised access
Otherwise issue bounded new access via an approved channel
Keep containment in place and verify access after each batch A regenerated key cannot be restored to its old valid value. Recreating a policy under its former name can likewise reactivate unexpired SAS tokens: neither is an acceptable rollback after exposure. If recovery fails, keep revocation in place and use separate controlled access, or accept an interruption until it is validated.
Conclusion
The decision is not just about removing a URL: it is about the signing mechanism and every consumer that depends on it. Close the incident when the old access is actually denied, the least-privilege replacement works and critical workloads have been checked. Otherwise, retain containment and record what remains unknown.