Domain 2 β€” Module 1 of 8 13%
7 of 28 overall
Domain 2: Secure storage, databases, and networking Free ⏱ ~12 min read

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

Simple explanation

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

Storage firewall options β€” production should be selected networks or Private Endpoint only
Network modeWhat it allowsWhen to pick
Allow access from all networksAny IP on the internetAlmost never for production β€” accept only with Entra-based auth + IP-scoped SAS + extensive Defender alerts
Allow access from selected virtual networks and IP addressesVNet service endpoints (`Microsoft.Storage`) on selected subnets + explicit public IP/CIDR ranges + trusted-services exceptionGood 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 accountHighest 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

Storage access methods β€” Entra + RBAC is the SC-500 default; stored access policies add revocation control
MethodHow it worksWhen to use
Microsoft Entra ID + Azure RBACCaller 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 keyBearer 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 policiesServer-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

  1. Network: Private Endpoint only. Public access disabled. Private endpoint in the banking VNet; privatelink.blob.core.windows.net DNS zone linked.
  2. Authentication: allowSharedKeyAccess: false β€” no key-based access. Microsoft Entra + Azure RBAC only. Banking app’s managed identity has Storage Blob Data Contributor on the specific container.
  3. CMK via Northwind’s HSM-backed Key Vault. Annual rotation policy with 30-day grace.
  4. Data protection: blob versioning + soft delete (30 days). For transaction-archive containers, immutable retention (7 years time-based).
  5. Defender for Storage with malware scanning on upload β€” every uploaded blob scanned. Alerts to Sentinel.
  6. 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

Question

What does setting `allowSharedKeyAccess: false` on an Azure Storage account do?

Click or press Enter to reveal answer

Answer

Blocks ALL storage account key-based access β€” including service SAS (signed with the key). Forces all callers to use Microsoft Entra ID authentication. The strongest version of the no-stored-credential pattern for storage; combined with managed identity on consumers, eliminates the storage key from circulation entirely.

Click to flip back

Question

What is a stored access policy on Azure Storage?

Click or press Enter to reveal answer

Answer

A server-side policy object on a container/share/queue/table that defines a SAS template (permissions, start/expiry). SAS can reference the policy by ID; the policy can be modified or deleted to centrally revoke all SAS using it. Provides a kill switch for delegated access β€” important when SAS is unavoidable.

Click to flip back

Question

What's the difference between user-delegated SAS and service SAS?

Click or press Enter to reveal answer

Answer

Service SAS is signed with the storage account key β€” if the key rotates, the SAS becomes invalid; if the key leaks, all signed SAS leak. User-delegated SAS is signed with an Entra-issued key obtained by the calling user β€” bound to the user's permissions, expires with the delegation key, can be revoked by revoking the user's access. Preferred over service SAS.

Click to flip back

Question

What does Defender for Storage detect?

Click or press Enter to reveal answer

Answer

Anomalous access patterns (atypical geography, volume), suspicious uploads, mass deletions, ransomware patterns, access from anonymous IPs. The next-gen 'malware scanning on upload' plan also scans every uploaded blob with Microsoft anti-malware. Workload protection plan in Microsoft Defender for Cloud; alerts route to Defender XDR and Sentinel.

Click to flip back

Question

What is immutable blob storage?

Click or press Enter to reveal answer

Answer

Write-Once, Read-Many (WORM) policy on a blob container β€” blobs cannot be modified or deleted during the retention period (time-based retention) or until a legal hold is released. Used for compliance, regulatory retention, and ransomware resilience.

Click to flip back

Knowledge check

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?

Knowledge Check

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?

Knowledge Check

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.