Ensure that Storage accounts disallow public access
Description
As a best practice, do not allow anonymous/public access to storage accounts unless you have a very good reason. The all networks option includes the internet.
Fix - Runtime
In Azure Console
- Log in to the Azure portal
- Navigate to 'Storage Accounts'
- Select the reported storage account
- Under 'Security + networking section' section, Select 'Networking'
- Under Firewall and virtual networks
- Click on 'Change access level'
- Set 'Public networks access' to 'anything but 'Enabled from all networks'
- Click on Save'
Fix - Buildtime
Terraform
- Resource: azurerm_storage_account
- Argument: public_network_access_enabled
go azurerm_storage_account.pike.tf
resource "azurerm_storage_account" "pike" {
...
+ public_network_access_enabled = false
...
}