nuclei-templates/cloud/azure/apimanagement/azure-apim-user-assigned-id...

57 lines
2.0 KiB
YAML

id: azure-apim-user-assigned-id-not-used
info:
name: Azure API Management User-Assigned Managed Identity Not Configured
author: princechaddha
severity: medium
description: |
Ensure that your Azure API Management service instances are using user-assigned managed identities for fine-grained control over access permissions. This helps in maintaining proper security practices by providing specific identities for applications.
impact: |
Using system-assigned managed identities may result in broader than necessary permissions, potentially leading to security risks if the identity is compromised.
remediation: |
Configure user-assigned managed identities for your Azure API Management service instances to ensure only the necessary permissions are granted to each service.
reference:
- https://docs.microsoft.com/en-us/azure/api-management/how-to-use-managed-service-identity
tags: cloud,devops,azure,microsoft,apim,azure-cloud-config
flow: |
code(1);
for (let APIMData of iterate(template.apimList)) {
APIMData = JSON.parse(APIMData);
set("name", APIMData.name);
set("resourceGroup", APIMData.resourceGroup);
code(2);
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
az apim list --output json --query '[*].{name:name, resourceGroup:resourceGroup}'
extractors:
- type: json
name: apimList
internal: true
json:
- '.[]'
- engine:
- sh
- bash
source: |
az apim show --name "$name" --resource-group "$resourceGroup" --query 'identity.type'
matchers-condition: and
matchers:
- type: word
words:
- 'SystemAssigned'
- 'none'
extractors:
- type: dsl
dsl:
- 'name + " in " + resourceGroup + " does not use user-assigned managed identities"'
# digest: 490a0046304402205b8b97c1f8d0d79b473361611f009fff298c17590b4f6479443c63314c09dca802207344dc9308b7d88a0ab6440d7e615295720332aba0ae9685a02306ec9ad2bd6c:922c64590222798bb761d5b6d8e72950