Storage Account Security: Firewall, Access Policies, Defender for Storage
Securing Azure Storage accounts end-to-end β network firewall and Private Endpoint, identity-based access via Entra + RBAC vs key-based, shared access signatures (SAS), stored access policies, immutability and soft delete, and Microsoft Defender for Storage threat protection.
Storage security, end to end
Azure Storage is the foundation under most Azure workloads β blob containers for application data, file shares, queues, tables. Locking it down on SC-500 means controlling four things:
- Network β public access, selected networks, or Private Endpoint only
- Authentication β Microsoft Entra ID + Azure RBAC (preferred) vs storage account key (legacy) vs Shared Access Signatures
- Data protection β encryption at rest with platform or customer-managed keys, soft delete + versioning + immutability
- Threat protection β Microsoft Defender for Storage detects anomalous access, malicious uploads (malware scanning), data exfiltration patterns
Storage firewall and network access
| Network mode | What it allows | When to pick |
|---|---|---|
| Allow access from all networks | Any IP on the internet | Almost never for production β accept only with Entra-based auth + IP-scoped SAS + extensive Defender alerts |
| Allow access from selected virtual networks and IP addresses | VNet service endpoints (`Microsoft.Storage`) on selected subnets + explicit public IP/CIDR ranges + trusted-services exception | Good middle ground when consumers are mixed (some VNets, some specific external services) |
| Disabled (Private Endpoint only) | Only resources with a private endpoint can reach the storage account | Highest assurance β public surface fully closed, all access via private DNS |
Trusted Microsoft services
When the firewall is set to βselected networksβ, a separate toggle controls whether trusted Microsoft services (Backup, Defender for Cloud, Azure Monitor, Site Recovery, etc.) can bypass the firewall using their first-party identities. The exam pattern: regulated workloads disable public access entirely AND disable trusted services bypass, requiring those services to use a Private Endpoint route.
Authentication: RBAC vs storage key vs SAS
| Method | How it works | When to use |
|---|---|---|
| Microsoft Entra ID + Azure RBAC | Caller authenticates with Entra token; Azure RBAC data-plane roles (`Storage Blob Data Contributor`, etc.) authorise. Audit per-caller in storage logs. | Default for production β combined with managed identity gives the no-stored-credential pattern |
| Storage account key | Bearer key (two per account β primary and secondary) granting full access to all data planes. No identity, no audit attribution beyond 'the key'. | Only legacy compatibility β disable account-key access where possible |
| Shared Access Signature (SAS) | Signed URL with embedded permissions, scope, and expiry. Service SAS (account-key-signed), user-delegated SAS (Entra-signed β much better), account SAS (account-level scope). | Time-bounded delegated access to a specific resource β user-delegated SAS preferred |
| Stored access policies | Server-side policy referenced by SAS β lets you centrally revoke SAS by removing the policy. | Whenever SAS is unavoidable β gives you a server-side kill switch |
The βdisable account key accessβ switch
A modern storage account has a defaultToOAuthAuthentication and allowSharedKeyAccess set of switches at the account level. Setting allowSharedKeyAccess: false blocks ALL key-based access (including service SAS, which is signed with the key) at the storage layer β forcing all callers to use Entra. This is the strongest version of the no-stored-credential pattern for storage.
Encryption and data protection
- Encryption at rest β always on with Microsoft-managed keys by default. Customer-managed keys (CMK) via Key Vault for customer key custody; rotation policies supported. Infrastructure encryption adds a second encryption layer for double protection.
- Soft delete for blob and container (configurable retention period). Recovers from accidental deletes.
- Blob versioning β every overwrite or delete creates a new version; rollback by promoting an older version.
- Immutable blob storage β write-once, read-many policy via time-based retention or legal hold. Used for compliance / WORM (Write Once Read Many) workloads.
Microsoft Defender for Storage
Two tiers:
- Defender for Storage (per-storage-account or per-transaction) β alerts on anomalous access patterns, atypical geography, mass-delete, ransomware patterns, suspicious access from anonymous IPs.
- Defender for Storage β malware scanning on upload (next-gen plan) β scans every uploaded blob with Microsoft anti-malware at the moment of upload; quarantines/alerts on detection.
Plan enabled per subscription or per storage account. Alerts surface in Defender for Cloud and route to Defender XDR + Sentinel via connectors.
Scenario: Esme locks down Northwind Bankβs customer-data storage
- Network: Private Endpoint only. Public access disabled. Private endpoint in the banking VNet;
privatelink.blob.core.windows.netDNS zone linked. - Authentication:
allowSharedKeyAccess: falseβ no key-based access. Microsoft Entra + Azure RBAC only. Banking appβs managed identity hasStorage Blob Data Contributoron the specific container. - CMK via Northwindβs HSM-backed Key Vault. Annual rotation policy with 30-day grace.
- Data protection: blob versioning + soft delete (30 days). For transaction-archive containers, immutable retention (7 years time-based).
- Defender for Storage with malware scanning on upload β every uploaded blob scanned. Alerts to Sentinel.
- Stored access policies β for the one SAS use case (a third-party fraud-screening service that canβt use Entra yet), Esme creates a stored access policy with 1-hour validity and read-only on a single container. She can revoke by deleting the policy.
Audit closes. Customer-data storage is reachable only from the banking VNet, only by Entra-authenticated callers, with HSM-protected keys, malware-scanned uploads, and a revocable SAS for the legacy integration.
Key terms
Knowledge check
Esme at Northwind Bank wants to ensure the banking customer-data storage account cannot be accessed via storage account key (even by an admin who has the key). Which configuration does this?
Ravi at Maple Genomics needs to give a third-party fraud-screening vendor read-only access to one specific blob container for 1 hour. The vendor can't use Entra. Which approach is most operationally clean?
Asha at Aurora Health Service wants every uploaded blob to be scanned for malware in real-time. Which Defender for Storage configuration fits?
Whatβs next
Next module: Azure SQL Security + Defender for Databases β platform-level SQL hardening (TLS, network, auditing), Entra-only authentication, database auditing, and the Defender for Databases workload protection plan across Azure SQL DB, Managed Instance, SQL on VM/Arc, and open-source databases.