rules/findings/azure/storage/azure-storage-account-public-network-access-enabled.json

{
    "provider": "Azure",
    "serviceType": "Storage Accounts",
    "serviceName": "Storage",
    "displayName": "Ensure that \u0027Public Network Access\u0027 is \u0027Disabled\u0027 for storage accounts",
    "description": "Disallowing public network access for a storage account overrides the public access settings for individual containers in that storage account for Azure Resource Manager Deployment Model storage accounts. Azure Storage accounts that use the classic deployment model will be retired on August 31, 2024.",
    "rationale": "The default network configuration for a storage account permits a user with appropriate permissions to configure public network access to containers and blobs in a storage account. Keep in mind that public access to a container is always turned off by default and must be explicitly configured to permit anonymous requests. It grants read-only access to these resources without sharing the account key, and without requiring a shared access signature. It is recommended not to provide public network access to storage accounts until, and unless, it is strongly desired. A shared access signature token or Azure AD RBAC should be used for providing controlled and timed access to blob containers.",
    "impact": "Access will have to be managed using shared access signatures or via Azure AD RBAC.",
    "remediation": {
        "text": "\r\n\t\t\t###### Remediate from Azure Portal \r\n\t\t\tFirst, follow Microsoft documentation and create shared access signature tokens for your blob containers. Then, \r\n\t\t\t1. Go to Storage Accounts. \r\n\t\t\t2. For each storage account, under the Security + networking section, click Networking. \r\n\t\t\t3. Set Public network access to Disabled. \r\n\t\t\t4. Click Save. \r\n\t",
        "code": {
            "powerShell": null,
            "iac": null,
            "terraform": null,
            "other": null
        }
    },
    "recommendation": null,
    "references": [
        "https://docs.microsoft.com/en-us/azure/storage/blobs/storage-manage-access-to-resources",
        "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-governance-strategy#gs-2-define-and-implement-enterprise-segmentationseparation-of-duties-strategy",
        "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-network-security#ns-2-secure-cloud-native-services-with-network-controls",
        "https://docs.microsoft.com/en-us/azure/storage/blobs/assign-azure-role-data-access",
        "https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security?tabs=azure-portal"
    ],
    "compliance": [
        {
            "name": "CIS Microsoft Azure Foundations",
            "version": "5.0.0",
            "reference": "9.3.2.2",
            "profile": [
                "Level 1"
            ]
        }
    ],
    "level": "medium",
    "tags": [
         
    ],
    "rule": {
        "path": "az_storage_accounts",
        "subPath": null,
        "selectCondition": {
             
        },
        "query": [
            {
                "filter": [
                    {
                        "conditions": [
                            [
                                "networking.allowAccessFromAllNetworks",
                                "eq",
                                "True"
                            ],
                            [
                                "networking.publicNetworkAccess",
                                "eq",
                                "Enabled"
                            ]
                        ],
                        "operator":"and"
                    }
                ]
            }
        ],
        "shouldExist": null,
        "returnObject": null,
        "removeIfNotExists": null
    },
    "output": {
        "html": {
            "data": {
                "properties": {
                    "id": "Id",
                    "name": "Name",
                    "location": "Location",
                    "ResourceGroupName": "ResourceGroupName",
                    "networking.allowAccessFromAllNetworks": "Access From All Networks",
                    "networking.publicNetworkAccess": "Public Network Access"
                },
                "expandObject": null
            },
            "table": "default",
            "decorate": [
                {
                    "itemName": "Public Network Access",
                    "itemValue": "enabled",
                    "className": "badge badge-danger badge-xl"
                }
            ],
            "emphasis": [
                 
            ],
            "actions": {
                "objectData": {
                    "properties": [
                        "name",
                        "location",
                        "ResourceGroupName",
                        "networking"
                    ],
                    "expandObject": null,
                    "limit": null
                },
                "showGoToButton": "True",
                "showModalButton": "True",
                "directLink": null
            }
        },
        "text": {
            "data": {
                "properties": {
                    "id": "Id",
                    "name": "Name",
                    "location": "Location",
                    "ResourceGroupName": "ResourceGroupName",
                    "networking.allowAccessFromAllNetworks": "Access From All Networks",
                    "networking.publicNetworkAccess": "Public Network Access"
                },
                "expandObject": null
            },
            "status": {
                "keyName": ["name"],
                "message": "Ensure that \u0027Public Network Access\u0027 is \u0027Disabled\u0027 for {name}",
                "defaultMessage": "Ensure that \u0027Public Network Access\u0027 is \u0027Disabled\u0027 for storage accounts"
            },
            "properties": {
                "resourceName": "name",
                "resourceId": "id",
                "resourceType": "AzureStorageAccount"
            },
            "onlyStatus": false
        }
    },
    "idSuffix": "storage_accounts_public_network_access_enabled",
    "notes": [
         
    ],
    "categories": [
         
    ],
    "immutable_properties": [
        "id"
    ],
    "id": "azure_storage_011"
}