id: azure-functionapp-system-assigned-missing info: name: System-Assigned Managed Identities for Azure Functions author: princechaddha severity: medium description: | Ensure that functions managed with Azure Function App are using system-assigned managed identities in order to allow secure application access to other Microsoft Azure cloud resources such as SQL databases, storage accounts, and key vaults. Using system-assigned managed identities minimizes risks, simplifies management, and maintains compliance with evolving Azure cloud services. impact: | Not using system-assigned managed identities may expose Azure Function Apps to security risks and compliance issues, complicating resource access management. remediation: | Enable system-assigned managed identities for your Azure Function Apps to enhance security and simplify the management of resource access. 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 --query '[*].{name:name, resourceGroup:resourceGroup}' --output json 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: - "" - "UserAssigned" extractors: - type: dsl dsl: - 'name + " does not use system-assigned managed identity"' # digest: 4a0a0047304502205de3e7aff22b3a8c4f4d108a401ce4f4c48d56be1eff28393319549ca37c0d56022100accce22826592f7a7a92691a3c86a5e18ae4fa9087fd4c3bd6b16231cc3a1b39:922c64590222798bb761d5b6d8e72950