Risk Level: Medium (should be achieved)
Ensure that your Microsoft Azure Function Apps are configured to use Network Security Groups (NSGs). NSGs provide an additional layer of security for Azure Function Apps by controlling network traffic. This helps to protect your functions from unauthorized access and potential attacks by limiting inbound and outbound connections.
Using Network Security Groups to control traffic to and from Azure Function Apps is important for the following reasons:
- Traffic Filtering: NSGs act as a virtual firewall, enabling you to filter both inbound and outbound traffic based on defined security rules. This reduces the attack surface by restricting access to only trusted sources or destinations.
- Isolation and Segmentation: NSGs allow you to isolate and segment your Function Apps from other resources in the network, ensuring that only authorized traffic can communicate with them. This improves the overall security posture of your Azure cloud environment.
- Compliance and Security Policies: By using NSGs, you can enforce organizational security policies, ensuring that your applications meet regulatory or compliance requirements by controlling the flow of data and limiting unauthorized access.
- Mitigating Threats: Controlling traffic with NSGs helps prevent common network-based attacks such as Distributed Denial-of-Service (DDoS), port scanning, or unauthorized access attempts, enhancing the app's resilience against external threats.
Overall, Network Security Groups (NSGs) provide robust protection for your Azure Function Apps by effectively shielding them from unauthorized access and malicious attacks.
Audit
To determine if your Azure Function Apps are configured to use Network Security Groups (NSGs), perform the following operations:
Remediation / Resolution
To configure Network Security Groups (NSGs) for your Microsoft Azure Function Apps, perform the following operations:
To be able to control network traffic with Network Security Groups, Virtual Network Integration must be enabled for your Azure Function Apps. Virtual Network (VNet) Integration allows Function Apps to securely access resources within a private virtual network, such as databases or storage accounts, by connecting to the VNet. This integration provides enhanced security by isolating traffic and enabling the use of private endpoints within Azure cloud. This guide assumes that Virtual Network Integration is enabled for your Azure Function Apps.References
- Azure Official Documentation
- Network security groups
- Create, change, or delete a network security group
- Azure best practices for network security
- Integrate your app with an Azure virtual network
- Azure Functions networking options
- Azure Command Line Interface (CLI) Documentation
- az account list
- az account set
- az functionapp list
- az functionapp vnet-integration list
- az resource show
- az network nsg create
- az network nsg rule create
- az network vnet subnet update
Publication date Oct 23, 2023