Review trusted-service exceptions for Azure Storage

Use Azure Storage network exceptions only for required service integrations.

Description

Adding AzureServices to network_acls.bypass lets specific operations by Microsoft’s trusted services pass the Storage firewall. Grant the service’s data permissions separately.

Potential impact

Operations that rely on the exception can fail without it. Enabling it unnecessarily extends network access to the listed services.

Remediation

Check whether the service and operation need the exception. Where supported, use a narrower resource instance rule. Grant only the required data permissions and test the integration’s actual operation.

Examples

Both tasks keep default_action: Deny and the Metrics exception. The second adds the service exception with AzureServices,Metrics. To use the short module name, install azure.azcollection and list it under collections in the play.

Before

yaml
- name: Configure the Storage firewall
  azure_rm_storageaccount:
    resource_group: myResourceGroup
    name: clh0002
    type: Standard_RAGRS
    network_acls:
      bypass: Metrics
      default_action: Deny

After

yaml
- name: Configure the Storage firewall
  azure_rm_storageaccount:
    resource_group: myResourceGroup
    name: clh0002
    type: Standard_RAGRS
    network_acls:
      bypass: AzureServices,Metrics
      default_action: Deny

References