Skip to content

[New Rules] Azure API Management legacy-access post-compromise detections - #7270

Draft
terrancedejesus wants to merge 1 commit into
mainfrom
apim-legacy-access-detections
Draft

terrancedejesus wants to merge 1 commit into
mainfrom
apim-legacy-access-detections

Conversation

@terrancedejesus

Copy link
Copy Markdown
Contributor

Summary

5 new rules covering a post-compromise behavior chain: APIM-stored secrets (named values, the legacy tenant access key, subscription keys) listed via the control plane and then reused directly against Key Vault, Entra ID, and the APIM gateway, bypassing normal APIM-fronted access paths. Reproduced and validated end-to-end against live telemetry in an authorized lab emulation.

Source: https://anderskristiansen.com/post/2026/apim-legacy-access/ (post-incident advisory on the NSM/Equinor/Skagerak Azure APIM incident, Nov 2026)

Rules

  • Azure API Management Control-Plane Secret Listing - catches ARM control-plane actions that return live secret material from an APIM instance (named-value resolved value, tenant access key, subscription keys, identity-provider secrets). Caller-identity fields were found to be null for service-principal callers on these exact operations, so this is scoped to operation_name + resource rather than an attributed actor.
  • Azure Key Vault Denied Secret List Followed by Allowed Secret Get - ES|QL rule catching the "probe-then-grab" pattern: a denied SecretList/SecretListVersions (403) followed by an allowed SecretGet (200) from the same application identity and vault within 15 minutes. Reaches into the nested flattened properties.httpStatusCode field via ES|QL's KQL() function, since top-level event.outcome reads "success" for both the allowed and denied request.
  • Entra ID Sign-in with Unusual Application and Source Address - first-seen source IP for a service-principal sign-in, scoped to a curated watchlist of applications whose credentials are stored in APIM. Requires the engineer to fill in the real application IDs before enabling.
  • Azure API Management Gateway Request Tracing Requested - catches a gateway request that explicitly requests diagnostic tracing (isTraceRequested), the path that can reveal Key Vault-backed named-value secrets straight out of the gateway response.
  • Azure API Management Gateway Access with Unusual Subscription and Source Address - new_terms rule on the APIM subscription key + source IP, catching a stolen subscription key reused from infrastructure it has never used before, independent of whether tracing is also requested.

Validation

  • All 5 rules are grounded in fields confirmed present via execute-esql against a real lab emulation (not assumed from the source article).
  • Confirmed the legacy Direct Management API is genuinely invisible to AzureActivity (zero entries despite the underlying calls succeeding) - documented as an acknowledged blind spot; no rule is possible there without a different signal (e.g. network-level monitoring).
  • Confirmed a real attribution gap: azure.activitylogs caller/identity_name/identity.claims.appid are null for service-principal "action"-type operations in this environment, which directly shaped rule 1's scoping.
  • APIM GatewayLogs cold-start latency validated separately: a fresh diagnostic setting took ~25 minutes to start producing events, within Microsoft's documented up-to-90-minute SLA.
  • One non-ECS schema addition: 7 azure.platformlogs.properties.* fields (isTraceRequested, isTraceAllowed, apimSubscriptionId, apiId, productId, userAgent, operationId).
  • python -m detection_rules toml-lint passes clean for all 5 rules.

…ions

5 new rules covering APIM-stored secrets (named values, tenant key,
subscription keys) listed via the control plane and reused directly
against Key Vault, Entra ID, and the APIM gateway, bypassing normal
APIM-fronted access paths.

- Azure API Management Control-Plane Secret Listing
- Azure Key Vault Denied Secret List Followed by Allowed Secret Get
- Entra ID Sign-in with Unusual Application and Source Address
- Azure API Management Gateway Request Tracing Requested
- Azure API Management Gateway Access with Unusual Subscription and Source Address

Adds 7 azure.platformlogs.properties.* fields to non-ecs-schema.json.

Source: https://anderskristiansen.com/post/2026/apim-legacy-access/
@terrancedejesus terrancedejesus added Integration: Azure azure related rules Rule: New Proposal for new rule Domain: Cloud labels Nov 28, 2026
@terrancedejesus terrancedejesus self-assigned this Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Domain: Cloud Integration: Azure azure related rules Rule: New Proposal for new rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant