Azure API Management Secrets: How to Inventory What Your Gateway Holds After the Classic-Tier Exposure
Last week Microsoft closed an access path into Azure API Management (APIM) Classic instances that attackers had already used to read customers’ Azure API Management secrets: named values, identity-provider client secrets, subscription keys and management tokens. Norwegian energy companies were among those targeted. The part that matters for defenders is this: according to Microsoft’s customer notice, as reported, the mitigation does not invalidate credentials that may have been accessed before it was deployed. The provider patched the hole. It did not rotate your keys.
This is a practical use-case piece. It covers what your API gateway is quietly storing, how to find it, and how CloudShieldSecure approaches the problem so the next provider-side incident is a short rotation exercise instead of an archaeology project.
Verification note: Microsoft’s notice (Azure Service Health tracking ID MZK9-GH0) is visible only inside affected tenants and has no CVE. The facts below come from multi-source reporting (BleepingComputer, quoting Microsoft’s notice and Norway’s National Security Authority, NSM, plus victim statements), not from a public Microsoft advisory. Check your own Service Health blade for the authoritative text.
What happened, in brief
- Timeline (as reported): Equinor detected an attack on 17 November; Skagerak Energi reported suspicious activity on 18 November. Microsoft identified the APIM issue on 18 November and deployed a mitigation on 19 November. NSM published guidance on 20 November.
- Affected: APIM Classic Developer, Basic, Standard and Premium. Reporting says the v2 tiers and Classic Consumption are not affected.
- Exposed, per Microsoft’s notice as reported: named values (including secrets written inline into policies), identity-provider and OpenID Connect client secrets, subscription keys, and direct management API tokens.
- Victims: Equinor said the attack was stopped and it found no indication of data theft. Skagerak said there was no compromise of operations. NSM said other countries and sectors were also affected and stressed that “no impact on service delivery” does not rule out credential theft.
- Conflict to note: Microsoft has said no customer action is needed for the fix itself. NSM advises customers to verify their gateways are on a patched runtime build and to rotate exposed credentials. Use NSM’s advisory for the current build numbers; we have not reproduced them here because we could not read the primary text.
Why an API gateway becomes a secrets vault by accident
Nobody sets out to build a secrets store in their API gateway. It happens one reasonable decision at a time:
- Backend authentication. The gateway needs to call a backend with an API key or basic-auth password, so someone adds a named value marked “secret”.
- Policy shortcuts. A
set-headerorauthentication-basicpolicy gets the credential pasted straight into the XML “just for testing”, and it ships. - Developer portal sign-in. Configuring Entra ID or another OpenID Connect provider for the portal stores a client secret in the instance.
- Consumer keys. Every product subscription has a primary and secondary key, and those keys are often the only thing protecting a backend.
Each of these is a normal, documented feature. Together they make the gateway one of the densest concentrations of credentials in a cloud estate, and one that rarely appears in secrets inventories, because inventories usually start with Key Vault, CI variables and code repositories.
We saw the same pattern last week with third-party cloud access keys that nobody owned anymore (How to find stale third-party cloud access keys), and with the Entra Connect Health flaw, where a provider-side fix still left customers with questions to answer (tenant metadata explained).
Step 1: Find every Classic instance
Start with scope. Azure Resource Graph lists every APIM instance you can see, with its tier, across subscriptions:
resources
| where type =~ "microsoft.apimanagement/service"
| project name, resourceGroup, subscriptionId, location, tier = tostring(sku.name)
| order by tier asc
Classic tiers show as Developer, Basic, Standard or Premium. The v2 tiers carry a V2 suffix, and Consumption shows as Consumption. Any Classic instance is in scope for the steps below.
Step 2: Inventory what each instance holds
For each Classic instance, build a list of four things:
- Named values. Note which are plain text, which are marked secret, and which are Key Vault references. Secret-typed values stored in the instance are the priority, because they were in scope of the exposure. Key Vault references point at a secret held elsewhere. Rotate the underlying secret if the managed identity that reads it could have been abused, but it is a lower priority.
- Inline secrets in policies. Search exported policy XML (global, product, API and operation scope) for literal credentials in
authentication-basic,set-headerandsend-requestpolicies. These do not appear in the named-values list at all. - Identity-provider configurations. Developer-portal sign-in through Entra ID, Azure AD B2C or another OIDC provider stores a client secret. That secret is valid at the identity provider, not just in APIM.
- Subscriptions. Count active subscriptions and record which backends each product reaches. A subscription key is only as harmless as the backend it unlocks.
Then map reach. For each gateway, list the backends, databases and SaaS APIs it can call. That map sets your rotation priority and tells you where else to look for misuse.
Step 3: Rotate in order of blast radius
Assume anything stored in a Classic instance before 19 November may have been read. A workable order:
- Backend credentials in named values and policies. These grant access beyond the gateway. Rotate at the backend first, then update APIM.
- IdP / OIDC client secrets. Create a new secret at the identity provider, update APIM, then delete the old secret. Deleting it is the step that matters.
- Subscription keys. Regenerate the secondary key, move consumers to it, then regenerate the primary. One at a time avoids an outage.
- Management access. Revoke and reissue any direct management API access. Disable the legacy direct management API if you do not use it.
Step 4: Look back before 19 November
Pull the Azure Activity Log for the APIM resources, gateway resource logs (only available if diagnostic settings were enabled), Entra ID sign-in logs for the service principals involved, and backend logs. The backend is where a stolen key gets used. Look for management-plane operations nobody on your team made, and for backend calls from sources that are not your gateway.
Step 5: Stop storing secrets in the gateway
The durable fix is architectural:
- Convert secret named values to Key Vault references read by a managed identity, so rotation happens in one place and APIM holds no copy.
- Replace static backend keys with managed identity authentication where the backend supports it.
- Front backends with private endpoints or VNet integration so a leaked key is not enough on its own.
- Plan the move from Classic to v2 tiers. It was not a security deadline last month. It is a sensible one now.
The CloudShieldSecure perspective
At CloudKonsult we built CloudShieldSecure on a simple premise: you cannot rotate what you have not inventoried. Incidents like this one are rarely won or lost on the day of disclosure. They are decided by whether you already know which managed services hold credentials, what those credentials unlock, and who owns them.
That is the job CloudShieldSecure is designed for. It treats configuration in managed services, API gateways included, as part of the attack surface. It flags secrets stored in service configuration instead of a vault, surfaces older service tiers that need a migration plan, and watches management-plane activity for changes nobody on the team made. When a provider says “we fixed it, but rotate anything that may have been exposed”, the useful answer is a list, not a search party.
Recommended actions
Today
- Run the Resource Graph query above and list every APIM Classic instance.
- Check Azure Service Health for MZK9-GH0 in each subscription and read Microsoft’s notice in full.
- Compare each gateway’s runtime build with the thresholds in NSM’s advisory.
This week
- Inventory named values, inline policy secrets, IdP client secrets and subscriptions for each Classic instance.
- Rotate in blast-radius order: backend credentials, then IdP secrets, then subscription keys, then management access.
- Review Activity Log, gateway and backend logs for the period before 19 November.
This quarter
- Move every secret named value to a Key Vault reference and adopt managed identities for backends.
- Disable the legacy direct management API where unused, and plan Classic-to-v2 migration.
- Add API gateways to your standing secrets inventory, next to Key Vault, CI/CD and code.
Sources & references
- BleepingComputer, “Microsoft Azure flaw exploited to steal customers’ API credentials” (23 Nov 2026): https://www.bleepingcomputer.com/news/security/microsoft-azure-flaw-exploited-to-steal-customers-api-credentials/
- NSM (Norwegian National Security Authority), advisory on Azure API Management: https://nsm.no/aktuelt/nsm-deler-tiltak-mot-sarbarhet-i-azure-api-management
- Equinor statement: https://www.equinor.com/news/20261711-equinor-detected-cyber-attack
- Skagerak Energi update: https://www.skagerakenergi.no/presse/pressemeldinger/oppdatering-pa-forsok-pa-cyberangrep
- Microsoft Learn, use named values in Azure API Management policies: https://learn.microsoft.com/azure/api-management/api-management-howto-properties
- Microsoft Learn, API Management security baseline: https://learn.microsoft.com/security/benchmark/azure/baselines/api-management-security-baseline
Assess your security posture today
CloudShield Secure scans, validates, and prioritises threats across your entire attack surface.
Explore CloudShield Secure →