nuclei-templates/cloud/azure/apimanagement/azure-apim-system-assigned-...

57 lines
2.3 KiB
YAML

id: azure-apim-system-assigned-identity-unconfigured
info:
name: Azure API Management Service System-Assigned Managed Identity Not Configured
author: princechaddha
severity: medium
description: |
Ensure that your Azure API Management service instances are using system-assigned managed identities in order to allow secure access to other Microsoft Azure protected resources such as Azure Key Vaults. Using system-assigned managed identities minimizes risks, simplifies management, and maintains compliance with evolving cloud services.
impact: |
If system-assigned managed identities are not enabled for Azure API Management service instances, it may lead to insecure access management and complicates credentials management, increasing the risk of security breaches.
remediation: |
Enable system-assigned managed identities for your Azure API Management service instances through the Azure portal or by configuring the ARM template of your instance to include a system-assigned identity.
reference:
- https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-use-managed-service-identity
tags: cloud,devops,azure,microsoft,api-management,azure-cloud-config
flow: |
code(1);
for (let ApiService of iterate(template.apiServiceList)) {
ApiService = JSON.parse(ApiService);
set("name", ApiService.name);
set("resourceGroup", ApiService.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: apiServiceList
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:
- "UserAssigned"
- "none"
extractors:
- type: dsl
dsl:
- 'name + " in " + resourceGroup + " does not have a system-assigned managed identity enabled"'
# digest: 4a0a004730450221009ab139cee76ef75a5b9d95c0b417a9e0e0c1e97347510debd2121ac2605efcdd02200614db6170562c852763d9ebf398b9879ba4faf2f99ea07db902beaff36c4f37:922c64590222798bb761d5b6d8e72950