L6. Securing Azure Storage Accounts: Firewalls, Access Policies & Defender for Storage
Video generating
Check back soon for the video lesson on Securing Azure Storage Accounts: Firewalls, Access Policies & Defender for Storage
Course outlineLesson 6 of 18
A storage account defaults to reachable from the internet and authenticated by a shared key that never expires on its own, and the entire security job is turning both of those defaults off.
Baseline Storage Account Hardening
A handful of settings determine most of a storage account's exposure:
- Secure transfer required: forces all requests over HTTPS, rejecting plaintext HTTP
- Minimum TLS version: set to TLS 1.2 (or higher), rejecting older, weaker negotiated connections
- Disable shared key access: shared keys are long-lived, account-wide credentials; disabling them forces all data-plane access through Microsoft Entra ID authentication (Azure RBAC) instead, so access can be scoped per-identity and revoked individually
- Restrict SAS token generation: shared access signatures (SAS) should specify a short expiration, HTTPS-only, and the narrowest possible permission and resource scope; account-level SAS should be avoided in favor of user-delegation SAS (issued using Entra ID credentials, individually revocable) where possible
Configuring the Storage Firewall
Like Key Vault, a storage account's network rules default to accessible from any network unless explicitly restricted:
- Default action: set to Deny, allowing only explicitly listed exceptions
- IP network rules: allow specific public IP ranges
- Virtual network rules (service endpoints): allow traffic only from specified subnets
- Resource instance rules / trusted Microsoft services: allow specific first-party Azure services (e.g., Azure Monitor writing diagnostic logs) to bypass the firewall even when public access is otherwise denied
- Private endpoints: the strongest option, giving the storage account a private IP inside your VNet so traffic never traverses the public internet at all
Defender for Storage Threat Protection
Defender for Storage analyzes activity at the storage account level and flags:- Malware scanning (near-real-time, using Microsoft Defender Antivirus signatures) on blobs as they're uploaded, useful for accounts accepting user-uploaded content
- Sensitive data threat detection, which uses sensitive data discovery to identify when suspicious operations (like unusual bulk downloads) are happening against blobs known to contain sensitive data, elevating the severity of the alert
- Anomalous access alerts: access from a Tor exit node, unusual application accessing the account for the first time, unexpected volume of delete or download operations consistent with data exfiltration or ransomware staging
Access Control Models Compared
| Model | Use case |
|---|---|
| Azure RBAC (Entra ID auth) | Preferred; per-identity, revocable, auditable through standard role assignments |
| Shared Access Signatures (SAS) | Delegated, time-limited access without sharing full account credentials; user-delegation SAS ties the token to an Entra identity |
| Stored access policies | A server-side policy associated with a SAS that lets you revoke or modify permissions for all SAS tokens issued under that policy without needing to invalidate the storage account key |
| Account keys (shared key) | Full, unscoped access; should be disabled where the workload can instead use Entra ID auth |
- ✓Disabling shared key access forces all data-plane requests through Azure RBAC (Entra ID auth), removing a long-lived account-wide credential
- ✓The storage firewall should default-deny with private endpoints as the strongest exception over IP rules or service endpoints
- ✓Defender for Storage performs near-real-time malware scanning on uploaded blobs and flags anomalous access patterns like Tor-exit-node access or bulk downloads of sensitive data
- ✓A stored access policy lets you revoke a single SAS grant without rotating the account key that would otherwise invalidate every SAS issued from it
- ✓User-delegation SAS tokens are tied to an Entra ID identity and are individually revocable, unlike account-key-based SAS
1. A storage account currently authenticates all data access using the account's shared key. What is the recommended change to remove this long-lived, unscoped credential?
2. A SAS token was accidentally leaked in a public code repository. The storage account uses a stored access policy for this SAS. What is the fastest way to revoke just that leaked token without breaking every other SAS issued from the account?
3. Which Defender for Storage capability specifically scans uploaded blobs for malicious content in near-real-time?
Recommended: Pluralsight
This free course covers the theory. Pluralsight adds structured Cloud and AI Security Engineer learning paths, hands-on Azure and Defender for Cloud labs, and timed practice exams to make it stick before exam day.