1. Resources
  2. Detection rules
  3. Service Keys and Connection Strings Listed Through Azure Resource Manager

Service Keys and Connection Strings Listed Through Azure Resource Manager detection rules

Someone lists the keys, connection strings or stored secrets of Azure services such as Cosmos DB, Service Bus, AI services or API Management through Resource Manager. The values give data access without a Microsoft Entra identity.

Platform
Azure
Severity
High
Log source
Azure Activity log
Last updated
MITRE ATT&CK technique
T1552Unsecured Credentials
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A role that includes the key listing actions on the resource, such as Contributor or the contributor role of the service, and a resource that accepts key authentication.
Impact
Access to the data and functions of the service that does not depend on the attacker's Azure identity and lasts until the keys are regenerated.
Response
Regenerate both keys of every resource the caller listed, rotate the secrets of connected systems that were returned, and contain the caller.
Mitigation
Disable key-based authentication with the disableLocalAuth property where the service supports it, and limit the roles that include the listing actions.
Operations
MICROSOFT.COGNITIVESERVICES/ACCOUNTS/LISTKEYS/ACTIONMICROSOFT.COGNITIVESERVICES/ACCOUNTS/CONNECTIONS/LISTSECRETS/ACTIONMICROSOFT.COGNITIVESERVICES/ACCOUNTS/PROJECTS/CONNECTIONS/LISTSECRETS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/LISTKEYS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/LISTSTORAGEACCOUNTKEYS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/CONNECTIONS/LISTSECRETS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/DATASTORES/LISTSECRETS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/COMPUTES/LISTKEYS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/ONLINEENDPOINTS/LISTKEYS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/ONLINEENDPOINTS/TOKEN/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/BATCHENDPOINTS/LISTKEYS/ACTIONMICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/SERVERLESSENDPOINTS/LISTKEYS/ACTIONand 39 more in the rules below

How the attack works

Many Azure services accept a shared secret next to Microsoft Entra ID: an account key, a shared access key inside a connection string, an API key or a subscription key. Azure Resource Manager returns these values through listing actions on the resource, for example Microsoft.DocumentDB/databaseAccounts/listKeys/action, Microsoft.ServiceBus/namespaces/authorizationRules/listkeys/action, Microsoft.CognitiveServices/accounts/listKeys/action and Microsoft.ApiManagement/service/subscriptions/listSecrets/action. They are actions and not read operations, so they come with Contributor and with the contributor roles of the individual services, and they are recorded in the Azure Activity log, which does not record plain reads.

An attacker who holds such a role uses the listing actions to turn control-plane access into data access that no longer depends on the attacker's identity. A request that is made with a key is authorized by the key alone, with no Microsoft Entra sign-in, and it keeps working until the key is regenerated. Some listing actions also hand out the secrets of other systems: an Azure Machine Learning workspace returns the keys of its storage account and the secrets of its connections and datastores, API Management returns the secrets of named values, and Data Factory returns a GitHub access token. Each call is recorded with its caller. What is done with a key afterwards appears only in the resource logs of the service, where a diagnostic setting collects them.

What an attacker needs

  • A role that includes the listing action on the resource or a scope above it: Owner, Contributor, the contributor role of the service (for example Cognitive Services Contributor, which Microsoft describes as able to manage keys) or a custom role.
  • A resource that still accepts key-based authentication. Cosmos DB accounts, Azure AI services accounts and Service Bus namespaces have a disableLocalAuth property that switches it off.

Impact

Access to the data and functions of the service with the rights of the key: reading and changing a database, sending and receiving messages, calling models and APIs at the organization's cost, or registering a self-hosted integration runtime. The access does not depend on the attacker's Azure identity, so disabling that identity does not end it. Secrets of connected systems that were returned open those systems as well.

Detection rules

Azure AI, Machine Learning or Search Service Keys Listed

Detects a successful listing of the API keys of an Azure AI services (Cognitive Services) account, of the keys and secrets of an Azure Machine Learning workspace, its connections, datastores, computes and endpoints, or of the admin and query keys of an Azure AI Search service, through Azure Resource Manager. The keys authorize calls to the service without a Microsoft Entra identity, and a Machine Learning workspace also returns the secrets of the storage and other services it is connected to. Development tools and deployments read these values as well, so the rule is a starting point for a baseline of expected callers and not an alert on its own.

LevelLowStatusExperimentalLog sourceAzure Activity log
title: Azure AI, Machine Learning or Search Service Keys Listed
id: ef0c5f01-dfb5-416b-8ba2-ea01e517172a
status: experimental
description: >-
  Detects a successful listing of the API keys of an Azure AI services
  (Cognitive Services) account, of the keys and secrets of an Azure Machine
  Learning workspace, its connections, datastores, computes and endpoints, or
  of the admin and query keys of an Azure AI Search service, through Azure
  Resource Manager. The keys authorize calls to the service without a
  Microsoft Entra identity, and a Machine Learning workspace also returns the
  secrets of the storage and other services it is connected to. Development
  tools and deployments read these values as well, so the rule is a starting
  point for a baseline of expected callers and not an alert on its own.
references:
  - https://attack.mitre.org/techniques/T1552/
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/ai-machine-learning
  - https://learn.microsoft.com/en-us/azure/ai-services/disable-local-auth
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1552
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.COGNITIVESERVICES/ACCOUNTS/LISTKEYS/ACTION
      - MICROSOFT.COGNITIVESERVICES/ACCOUNTS/CONNECTIONS/LISTSECRETS/ACTION
      - MICROSOFT.COGNITIVESERVICES/ACCOUNTS/PROJECTS/CONNECTIONS/LISTSECRETS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/LISTSTORAGEACCOUNTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/CONNECTIONS/LISTSECRETS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/DATASTORES/LISTSECRETS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/COMPUTES/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/ONLINEENDPOINTS/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/ONLINEENDPOINTS/TOKEN/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/BATCHENDPOINTS/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/SERVERLESSENDPOINTS/LISTKEYS/ACTION
      - MICROSOFT.SEARCH/SEARCHSERVICES/LISTADMINKEYS/ACTION
      - MICROSOFT.SEARCH/SEARCHSERVICES/LISTQUERYKEYS/ACTION
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - Developers, notebooks and deployment pipelines that read an API key or an endpoint key to call a model or a search index. Exclude their identities in a filter_ selection by Caller once confirmed.
  - Machine Learning jobs and tools that read workspace and datastore secrets as part of normal runs. Baseline the callers for each workspace.
level: low

False positives

  • Developers, notebooks and deployment pipelines that read an API key or an endpoint key to call a model or a search index. Exclude their identities in a filter_ selection by Caller once confirmed.
  • Machine Learning jobs and tools that read workspace and datastore secrets as part of normal runs. Baseline the callers for each workspace.

Azure Database, Cache or Messaging Service Keys Listed

Detects a successful listing of the keys or connection strings of an Azure Cosmos DB account, an Azure Cache for Redis instance, or a Service Bus, Event Hubs, Relay or Event Grid resource through Azure Resource Manager. The keys and connection strings are shared secrets that authorize data access on their own, without a Microsoft Entra identity, until they are regenerated. Applications are often wired up by reading these values during a deployment, so the rule is a starting point for a baseline of expected callers for each resource and not an alert on its own.

LevelLowStatusExperimentalLog sourceAzure Activity log
title: Azure Database, Cache or Messaging Service Keys Listed
id: c7a3d084-3010-4d4a-8b1f-5ab385dca029
status: experimental
description: >-
  Detects a successful listing of the keys or connection strings of an Azure
  Cosmos DB account, an Azure Cache for Redis instance, or a Service Bus,
  Event Hubs, Relay or Event Grid resource through Azure Resource Manager.
  The keys and connection strings are shared secrets that authorize data
  access on their own, without a Microsoft Entra identity, until they are
  regenerated. Applications are often wired up by reading these values during
  a deployment, so the rule is a starting point for a baseline of expected
  callers for each resource and not an alert on its own.
references:
  - https://attack.mitre.org/techniques/T1552/
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/databases
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration
  - https://learn.microsoft.com/en-us/azure/service-bus-messaging/disable-local-authentication
  - https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-connect-role-based-access-control
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1552
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/LISTKEYS/ACTION
      - MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/LISTCONNECTIONSTRINGS/ACTION
      - MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/READONLYKEYS/ACTION
      - MICROSOFT.DOCUMENTDB/MONGOCLUSTERS/LISTCONNECTIONSTRINGS/ACTION
      - MICROSOFT.CACHE/REDIS/LISTKEYS/ACTION
      - MICROSOFT.CACHE/REDISENTERPRISE/DATABASES/LISTKEYS/ACTION
      - MICROSOFT.SERVICEBUS/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.SERVICEBUS/NAMESPACES/QUEUES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.SERVICEBUS/NAMESPACES/TOPICS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.EVENTHUB/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.RELAY/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.RELAY/NAMESPACES/HYBRIDCONNECTIONS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.RELAY/NAMESPACES/WCFRELAYS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.EVENTGRID/TOPICS/LISTKEYS/ACTION
      - MICROSOFT.EVENTGRID/DOMAINS/LISTKEYS/ACTION
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - Deployment pipelines and infrastructure-as-code tools that read a connection string to configure an application, and administrators who open the keys of a resource. Exclude their identities in a filter_ selection by Caller once confirmed, per resource where possible.
  - Key rotation, where the new keys are read after they are regenerated.
level: low

False positives

  • Deployment pipelines and infrastructure-as-code tools that read a connection string to configure an application, and administrators who open the keys of a resource. Exclude their identities in a filter_ selection by Caller once confirmed, per resource where possible.
  • Key rotation, where the new keys are read after they are regenerated.

Azure API Management, Data Factory, Synapse or Log Analytics Secrets Listed

Detects a successful retrieval of secrets from integration and monitoring services through Azure Resource Manager: API Management tenant access secrets, subscription keys, gateway keys and tokens, user tokens, named value secrets and authorization server secrets, the authentication keys of Data Factory and Synapse integration runtimes, a Data Factory GitHub access token, and the shared keys of a Log Analytics workspace. Each of them works without a Microsoft Entra identity. An integration runtime key registers a self-hosted node with the factory, and the workspace shared keys connect agents that send data to the workspace. Administration and onboarding make the same calls, so baseline the callers for each resource.

LevelLowStatusExperimentalLog sourceAzure Activity log
title: Azure API Management, Data Factory, Synapse or Log Analytics Secrets Listed
id: a9be063a-4315-48c2-85b8-9132aae74eb3
status: experimental
description: >-
  Detects a successful retrieval of secrets from integration and monitoring
  services through Azure Resource Manager: API Management tenant access
  secrets, subscription keys, gateway keys and tokens, user tokens, named
  value secrets and authorization server secrets, the authentication keys of
  Data Factory and Synapse integration runtimes, a Data Factory GitHub access
  token, and the shared keys of a Log Analytics workspace. Each of them works
  without a Microsoft Entra identity. An integration runtime key registers a
  self-hosted node with the factory, and the workspace shared keys connect
  agents that send data to the workspace. Administration and onboarding make
  the same calls, so baseline the callers for each resource.
references:
  - https://attack.mitre.org/techniques/T1552/
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/analytics
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/monitor
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1552
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.APIMANAGEMENT/SERVICE/TENANT/LISTSECRETS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/SUBSCRIPTIONS/LISTSECRETS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/GATEWAYS/LISTKEYS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/GATEWAYS/TOKEN/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/USERS/TOKEN/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/NAMEDVALUES/LISTVALUE/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/AUTHORIZATIONSERVERS/LISTSECRETS/ACTION
      - MICROSOFT.DATAFACTORY/FACTORIES/INTEGRATIONRUNTIMES/LISTAUTHKEYS/ACTION
      - MICROSOFT.DATAFACTORY/FACTORIES/GETGITHUBACCESSTOKEN/ACTION
      - MICROSOFT.SYNAPSE/WORKSPACES/INTEGRATIONRUNTIMES/LISTAUTHKEYS/ACTION
      - MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/SHAREDKEYS/ACTION
      - MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/LISTKEYS/ACTION
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - API Management administration and developer onboarding, where subscription keys and named values are read by design.
  - Setup of self-hosted integration runtimes and of monitoring agents, which needs the authentication key or the workspace key. Exclude the onboarding identities in a filter_ selection by Caller once confirmed.
level: low

False positives

  • API Management administration and developer onboarding, where subscription keys and named values are read by design.
  • Setup of self-hosted integration runtimes and of monitoring agents, which needs the authentication key or the workspace key. Exclude the onboarding identities in a filter_ selection by Caller once confirmed.

Keys of Several Azure Services Listed by One Caller

Counts, per Caller, how many different key, connection string and secret listing operations it completed through Azure Resource Manager. Each operation name belongs to one kind of resource, so four or more different operations within 30 minutes mean that one identity collected the credentials of four kinds of services in a short time. That is the pattern of somebody harvesting whatever shared secrets a compromised identity can reach, and it is unusual for a person. The count and the window are starting points to tune.

Fires when one Caller has at least 4 different OperationNameValue values within 30 minutes.

Threshold ruleLevelMediumStatusExperimentalLog sourceAzure Activity log
title: Azure Service Key or Secret Listing (Threshold Base Event)
id: 73395768-f80c-4548-b2bf-ef88d5cdf743
name: azure_service_key_or_secret_listing
status: experimental
description: >-
  Base event of the threshold rule in this file. A successful Azure Resource
  Manager operation that returns keys, connection strings, tokens or stored
  secrets of a service: the operations of the single-event rules on this page,
  and the key and credential listing operations of storage accounts, App
  Service apps, function apps, container registries, Kubernetes clusters and
  Automation accounts.
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/LISTKEYS/ACTION
      - MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/LISTCONNECTIONSTRINGS/ACTION
      - MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/READONLYKEYS/ACTION
      - MICROSOFT.DOCUMENTDB/MONGOCLUSTERS/LISTCONNECTIONSTRINGS/ACTION
      - MICROSOFT.CACHE/REDIS/LISTKEYS/ACTION
      - MICROSOFT.CACHE/REDISENTERPRISE/DATABASES/LISTKEYS/ACTION
      - MICROSOFT.SERVICEBUS/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.SERVICEBUS/NAMESPACES/QUEUES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.SERVICEBUS/NAMESPACES/TOPICS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.EVENTHUB/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.EVENTHUB/NAMESPACES/EVENTHUBS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.RELAY/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.RELAY/NAMESPACES/HYBRIDCONNECTIONS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.RELAY/NAMESPACES/WCFRELAYS/AUTHORIZATIONRULES/LISTKEYS/ACTION
      - MICROSOFT.EVENTGRID/TOPICS/LISTKEYS/ACTION
      - MICROSOFT.EVENTGRID/DOMAINS/LISTKEYS/ACTION
      - MICROSOFT.COGNITIVESERVICES/ACCOUNTS/LISTKEYS/ACTION
      - MICROSOFT.COGNITIVESERVICES/ACCOUNTS/CONNECTIONS/LISTSECRETS/ACTION
      - MICROSOFT.COGNITIVESERVICES/ACCOUNTS/PROJECTS/CONNECTIONS/LISTSECRETS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/LISTSTORAGEACCOUNTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/CONNECTIONS/LISTSECRETS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/DATASTORES/LISTSECRETS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/COMPUTES/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/ONLINEENDPOINTS/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/ONLINEENDPOINTS/TOKEN/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/BATCHENDPOINTS/LISTKEYS/ACTION
      - MICROSOFT.MACHINELEARNINGSERVICES/WORKSPACES/SERVERLESSENDPOINTS/LISTKEYS/ACTION
      - MICROSOFT.SEARCH/SEARCHSERVICES/LISTADMINKEYS/ACTION
      - MICROSOFT.SEARCH/SEARCHSERVICES/LISTQUERYKEYS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/TENANT/LISTSECRETS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/SUBSCRIPTIONS/LISTSECRETS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/GATEWAYS/LISTKEYS/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/GATEWAYS/TOKEN/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/USERS/TOKEN/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/NAMEDVALUES/LISTVALUE/ACTION
      - MICROSOFT.APIMANAGEMENT/SERVICE/AUTHORIZATIONSERVERS/LISTSECRETS/ACTION
      - MICROSOFT.DATAFACTORY/FACTORIES/INTEGRATIONRUNTIMES/LISTAUTHKEYS/ACTION
      - MICROSOFT.DATAFACTORY/FACTORIES/GETGITHUBACCESSTOKEN/ACTION
      - MICROSOFT.SYNAPSE/WORKSPACES/INTEGRATIONRUNTIMES/LISTAUTHKEYS/ACTION
      - MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/SHAREDKEYS/ACTION
      - MICROSOFT.OPERATIONALINSIGHTS/WORKSPACES/LISTKEYS/ACTION
      - MICROSOFT.STORAGE/STORAGEACCOUNTS/LISTKEYS/ACTION
      - MICROSOFT.STORAGE/STORAGEACCOUNTS/LISTACCOUNTSAS/ACTION
      - MICROSOFT.STORAGE/STORAGEACCOUNTS/LISTSERVICESAS/ACTION
      - MICROSOFT.WEB/SITES/PUBLISHXML/ACTION
      - MICROSOFT.WEB/SITES/CONFIG/LIST/ACTION
      - MICROSOFT.WEB/SITES/HOST/LISTKEYS/ACTION
      - MICROSOFT.CONTAINERREGISTRY/REGISTRIES/LISTCREDENTIALS/ACTION
      - MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/LISTCLUSTERADMINCREDENTIAL/ACTION
      - MICROSOFT.AUTOMATION/AUTOMATIONACCOUNTS/LISTKEYS/ACTION
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
level: low
---
title: Keys of Several Azure Services Listed by One Caller
id: 83fede4f-45e3-4605-b3a0-e7ce0e40fdfe
status: experimental
description: >-
  Counts, per Caller, how many different key, connection string and secret
  listing operations it completed through Azure Resource Manager. Each
  operation name belongs to one kind of resource, so four or more different
  operations within 30 minutes mean that one identity collected the
  credentials of four kinds of services in a short time. That is the pattern
  of somebody harvesting whatever shared secrets a compromised identity can
  reach, and it is unusual for a person. The count and the window are
  starting points to tune.
references:
  - https://attack.mitre.org/techniques/T1552/
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/databases
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/ai-machine-learning
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/analytics
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/monitor
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/storage
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/web-and-mobile
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/containers
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/management-and-governance
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1552
correlation:
  type: value_count
  rules:
    - azure_service_key_or_secret_listing
  group-by:
    - Caller
  timespan: 30m
  condition:
    field: OperationNameValue
    gte: 4
falsepositives:
  - Infrastructure-as-code tools that refresh the state of many resources in one run and read their keys, and deployment pipelines for applications that use several services. Exclude those identities by Caller.
  - The values of 4 different operations and 30 minutes are starting points, not tested limits. Measure what your own pipelines produce and adjust both.
level: medium

False positives

  • Infrastructure-as-code tools that refresh the state of many resources in one run and read their keys, and deployment pipelines for applications that use several services. Exclude those identities by Caller.
  • The values of 4 different operations and 30 minutes are starting points, not tested limits. Measure what your own pipelines produce and adjust both.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Resource updated and its keys listed by the same caller shortly after

Detection hypothesisSequence of events

On a resource with key authentication switched off, listed keys are useless, so an attacker first updates the resource to allow keys again and then lists them. A write to the resource followed by a key listing on the same resource by the same caller is that preparation and collection in order.

  1. In the Azure Activity log, the resource is updated with status Success: for example MICROSOFT.COGNITIVESERVICES/ACCOUNTS/WRITE, MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/WRITE or MICROSOFT.SERVICEBUS/NAMESPACES/WRITE. Keep the Caller and the resource ID.
  2. Within 60 minutes the same Caller runs a key listing action on the same resource ID, such as MICROSOFT.COGNITIVESERVICES/ACCOUNTS/LISTKEYS/ACTION, MICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/LISTKEYS/ACTION or MICROSOFT.SERVICEBUS/NAMESPACES/AUTHORIZATIONRULES/LISTKEYS/ACTION.
  3. Read the current disableLocalAuth value of the resource, because the write event does not say which property changed.

EventsMICROSOFT.COGNITIVESERVICES/ACCOUNTS/WRITEMICROSOFT.COGNITIVESERVICES/ACCOUNTS/LISTKEYS/ACTIONMICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/WRITEMICROSOFT.DOCUMENTDB/DATABASEACCOUNTS/LISTKEYS/ACTION

LimitsA deployment that creates or updates a resource and reads its connection string in the same run looks the same, so pipeline identities have to be excluded by name. The 60 minutes are a starting point. An attacker who uses two identities for the two steps does not match.

Keys of a resource listed by an identity that never listed them before

Detection hypothesisNeeds a baseline

For most resources the set of identities that read the keys is small and stable: a pipeline, a few administrators. A listing by an identity that is new for that resource is the simplest sign that somebody is collecting credentials outside the normal process.

  1. From the Azure Activity log of the last 30 days, build the list of Caller values per resource ID for the key and secret listing operations of the rules on this page.
  2. For each new successful listing, check whether the Caller is in the list for that resource ID.
  3. Review the listings by a new caller, and give priority to resources that hold production data and to callers that are new for several resources on the same day.

LimitsNew pipelines, new team members and renamed service principals are new callers as well. A resource that was created recently has no history. The 30 days are a starting point, and an attacker who uses an identity that already lists the keys is not seen.

Triage

  • Identify the Caller, the caller's IP address and the resource, and whether this identity lists keys for this resource routinely. Deployment pipelines and infrastructure-as-code tools do.
  • Check whether the resource accepts key-based authentication. Keys of a resource with disableLocalAuth set to true are not accepted.
  • Find out what the resource holds and which other systems its connections, named values or datastores reach.
  • Look at the other listing operations of the same caller in the same period. Keys of several kinds of services within minutes are the pattern of the threshold rule on this page.
  • Review how the caller holds its role, and whether the resource was updated shortly before the listing, which can mean that key authentication was switched back on.

Response

Once the attack is confirmed:

  1. Regenerate both keys of every resource the caller listed, and update the applications that depend on them.
  2. Contain the caller. Revoke its sessions, rotate its credentials and remove the role that carries the listing actions until the listing is explained.
  3. Rotate the secrets of connected systems that the listing returned, such as the secrets of Machine Learning connections and datastores, API Management named values and source control tokens.
  4. Review the resource logs of the affected services from the time of the listing for requests made with a key. If the logs were not collected, treat the data as read.
  5. Switch the affected resources to Microsoft Entra authentication only, where their clients allow it.

Mitigation

  • Disable key-based (local) authentication on every resource whose clients can use Microsoft Entra ID, with the disableLocalAuth property that Microsoft documents for Cosmos DB, Azure AI services and Service Bus, and let applications authenticate with managed identities.
  • Enforce that setting with Azure Policy, so that a resource cannot be created with key authentication or switched back to it unnoticed.
  • Limit Owner, Contributor and the service contributor roles, and give people and applications data roles in Microsoft Entra ID in place of roles that include the listing actions.
  • Where keys must stay in use, rotate both keys on a schedule and keep them in Azure Key Vault.
  • Create diagnostic settings for the resource logs of the services that hold sensitive data, so that requests made with a key can be traced.

Frequently asked questions

Does the Activity log show what was done with the keys?

No. The Activity log records the Azure Resource Manager call that returned the keys, with its caller. Requests made with a key go to the service itself, for example to the database or the messaging namespace. They appear only in the resource logs of that service, and only when a diagnostic setting collects those logs.

Why are the single-event rules low and the threshold rule medium?

Reading a connection string is part of deploying an application, so one listing by a pipeline or an administrator is routine. The single-event rules are meant for a baseline of expected callers for each resource. One caller that lists the keys of four or more different kinds of services within 30 minutes is unusual for a person, which is why the counting rule has a higher level. Both values are starting points.

Does disabling the attacker's account stop access that was gained with the keys?

No. A key authorizes requests on its own, with no Microsoft Entra sign-in, and it stays valid until it is regenerated. Regenerate both keys of each affected resource and update the applications that use them. Where the service supports it, disabling key-based authentication with the disableLocalAuth property makes listed keys useless.

Are storage account keys and Key Vault secrets covered by these rules?

Storage account keys have their own attack page in this library. The threshold rule on this page counts the storage key listing and the App Service publishing profile among its operations, so that harvesting across services is seen as one pattern. Secrets inside a key vault are read through the data plane of the vault, which is not in the Azure Activity log.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.