id: azure-functionapp-user-assigned-id-missing info: name: User-Assigned Managed Identities for Azure Functions author: princechaddha severity: medium description: | Ensure that functions managed with Azure Function App are using user-assigned managed identities for fine-grained control over access permissions. impact: | Using default or system-assigned identities can limit the granularity of access control, potentially allowing broader than necessary access to resources. remediation: | Configure user-assigned managed identities for your Azure Function Apps to gain more granular control over permissions and reduce potential security risks. reference: - https://docs.microsoft.com/en-us/azure/app-service/overview-managed-identity tags: cloud,devops,azure,microsoft,functionapp,azure-cloud-config flow: | code(1); for (let AppData of iterate(template.functionApps)) { AppData = JSON.parse(AppData) set("name", AppData.name); set("resourceGroup", AppData.resourceGroup); code(2); } self-contained: true code: - engine: - sh - bash source: | az functionapp list --output json --query '[*].{name:name, resourceGroup:resourceGroup}' extractors: - type: json name: functionApps internal: true json: - '.[]' - engine: - sh - bash source: | az functionapp show --name $name --resource-group $resourceGroup --query 'identity.type' --output json matchers: - type: word words: - "SystemAssigned" - "" extractors: - type: dsl dsl: - 'name + " does not use user-assigned managed identity"' # digest: 4a0a0047304502201c59a405f37a5ce477e4dd3a794d0e260023fc120535f87583fc5c6b9533ace2022100cb83928f51e238087025e2caf8a685f7684fc20b6a47647e76afc6f00dd41a2a:922c64590222798bb761d5b6d8e72950