Azure Blob Public Access: The Default Nobody Disables
Overview
Storage accounts deployed with azurerm 3.x Terraform, which defaulted to public, or created before Azure disallowed anonymous access by default in late 2023 can still allow it account-wide. Any container then set to Blob or Container access serves data without authentication.
At a glance
- Symptom
- Developer sets one container's public access level to Blob or Container access
- Likely cause
- allowBlobPublicAccess omitted from IaC templates silently resolves to true at account creation
- Impact
- Anonymous List Blobs calls enumerate entire containers account-wide, exposing backups, config secrets, and customer data to scrapers
- Verification signal
- Re-run the detection test and a controlled negative-path test.
- Safe correction
- Explicitly set allowBlobPublicAccess to false, audit containers for lingering public access, enforce via Azure Policy Deny, use RBAC or SAS
- Rollback or recovery
- Restore the exported configuration if the new control blocks required production traffic, then narrow the policy before redeployment.
The Trap
The allowBlobPublicAccess property on an Azure Storage Account, and the per-container public access level that it gates.
The Default State
Provision a Storage Account through Terraform on azurerm provider 3.x or an early 4.x release without setting allow_nested_items_to_be_public (it defaulted to true there), or through a template or script that sets the property to true, and allowBlobPublicAccess is true at the account level. Azure has disallowed anonymous access by default on new accounts since late 2023, whatever API version is used, but older accounts can still carry true or an unset (null) value, which is treated as allowed. Because the setting is account-wide and container-level access (“Private”, “Blob”, “Container”) sits on top of it, a developer who flips one container to “Blob” access to serve a public asset leaves the door open for any other container to be made public the same way, since nothing at the account level is stopping them.
The Blast Radius
Anonymous access at the “Container” level does not just serve known blob URLs, it permits unauthenticated List Blobs calls against the entire container. Attackers running subdomain enumeration against *.blob.core.windows.net find the account, issue an anonymous LIST, and receive a full manifest of every object inside, including backup exports, application configuration files with embedded connection strings, and customer data dumps that were never meant to be internet-facing. Because the account-level flag permits it silently, this pattern replicates across new containers that CI/CD pipelines create with a public access level in the same Storage Account, turning one forgotten toggle into a standing exfiltration channel that surfaces in a security scan months after the account was created, by which point the blobs have already been indexed by automated scrapers.
The Lead Mechanic Fix
Disable the flag explicitly at account creation and retrofit existing accounts:
az storage account update --name <account> --resource-group <rg> --allow-blob-public-access false
Audit every container for a lingering public access level with az storage container list --account-name <account> --query "[?properties.publicAccess!=null].{name:name,access:properties.publicAccess}" and reset any hits to off. Enforce the setting fleet-wide with the built-in Azure Policy definition “Storage account public access should be disallowed” set to Deny, which denies Microsoft.Storage/storageAccounts deployments where allowBlobPublicAccess is not false. Replace public container access with Azure RBAC roles such as Storage Blob Data Reader, or time-boxed SAS tokens issued through a broker, so every access is authenticated and logged rather than anonymous.
Related reading
- AWS Site-to-Site VPN Tunnel Down After BGP Flap to Azure: Fix
- Federated Credential Audience Mismatch Silently Blocks Azure Workload Identity Token Exchange
- Azure Storage 'Selected Networks' Firewall Still Allows Trusted Azure Services Through
- Azure Key Vault Secret Reads Return 403 After a Workload Identity Change
Apply the safer control
Before you change production
Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.
Fix commands and configuration
az storage account update --name <account> --resource-group <rg> --allow-blob-public-access falseaz storage container list --account-name <account> --query "[?properties.publicAccess!=null].{name:name,access:properties.publicAccess}"offVerify, roll back or escalate
Verify
Re-run the detection test and a controlled negative-path test. Confirm the unsafe behaviour is blocked while approved traffic still succeeds.
Rollback
Restore the exported configuration if the new control blocks required production traffic, then narrow the policy before redeployment.
Escalate
Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Last updated
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
