Exposed Azure Functions
ID: azure-functionapp-public-exposure
Severity: high
Author: princechaddha
Tags: cloud,devops,azure,microsoft,functionapp,azure-cloud-config
Description
Section titled “Description”To follow Azure cloud security best practices and prevent public exposure, ensure that the functions managed with Microsoft Azure Function App are not publicly accessible. An Azure function is considered publicly accessible when it is configured to allow inbound access through the default (public) endpoint.
YAML Source
Section titled “YAML Source”id: azure-functionapp-public-exposureinfo: name: Exposed Azure Functions author: princechaddha severity: high description: | To follow Azure cloud security best practices and prevent public exposure, ensure that the functions managed with Microsoft Azure Function App are not publicly accessible. An Azure function is considered publicly accessible when it is configured to allow inbound access through the default (public) endpoint. impact: | Allowing public network access to Azure Functions can expose sensitive business logic and data to potential security risks. remediation: | Configure Azure Functions to restrict access from the public network by setting the 'publicNetworkAccess' to 'Disabled'. reference: - https://docs.microsoft.com/en-us/azure/azure-functions/functions-networking-options 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: truecode: - 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 'publicNetworkAccess' --output json
matchers: - type: word words: - "Enabled"
extractors: - type: dsl dsl: - 'name + " is publicly accessible and should restrict network access"'# digest: 4a0a00473045022031031080aeb92e85be7233928cac72599d4bd438e6f71ff75cba383650268d230221009cffe8aaf410c462e3c954a9011753f23d7cb5bce18d4610db5064ae5a404556:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "cloud/azure/functions/azure-functionapp-public-exposure.yaml"