azure storage account prevent shared key access

Secure Azure Storage: Block Shared Key Access

By William Lopez
AD

In the dynamic world of cloud storage, security is paramount. Azure Storage Accounts provide robust security features to protect your data, among which is the prevention of shared key access. This measure ensures that only authorized parties can access your account, enhancing your data's confidentiality and integrity.

When you create an Azure Storage Account, you're assigned two access keys by default - primary and secondary. Traditionally, these keys enable access to services and resources. However, having these keys widely distributed can pose significant security risks. This is where preventing shared key access comes into play.

Understanding the Shared Key System

The shared key system in Azure Storage Accounts works on the principle of access keys that are shared among the services and resources making requests to the storage service. Until recently, these keys were sent with requests, which, while secure, could potentially be intercepted in untrusted networks. This led to the necessity of a different approach.

AD
Azure Key Vault Creation, RBAC Setup, User Addition, Secret Management
Azure Key Vault Creation, RBAC Setup, User Addition, Secret Management
How to secure Azure Functions with Azure AD, Key Vault and VNETs | Towards Data Science
How to secure Azure Functions with Azure AD, Key Vault and VNETs | Towards Data Science
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru
How to Access Azure Storage Account File Shares from .NET Applications | CodeGuru

In response to this, Azure introduced a more secure method - the Azure Storage Firewall and IP access control. These features allow you to limit access to your storage account to specified IP addresses or ranges, effectively preventing unauthenticated requests from other IPs.

Azure Storage Firewall

The Azure Storage Firewall is a network security feature that enables you to restrict access to your storage account from specified virtual networks only. It securely filters and allows traffic only from these approved sources. When implemented, only approved IP addresses or ranges can access your storage account and all others are denied access.

Automate Azure Key Vault Key Refresh with Managed Identity
Automate Azure Key Vault Key Refresh with Managed Identity
Create Azure File Share Using Azure Portal
Create Azure File Share Using Azure Portal
Deploying a Storage Account in Azure using Asure Portal
Deploying a Storage Account in Azure using Asure Portal

To use Azure Storage Firewall, you simply need to provide the IP range when configuring your storage account. This ensures that even authenticated requests from unauthorized IPs are rejected, adding an extra layer of security.

IP Access Control

IP Access Control provides fine-grained control over who can access your storage account. In addition to restricting access to approved subscribers and services, you can grant access to specific IP addresses or ranges. This feature uses Azure Active Directory (Azure AD) to authenticate and authorize requests thus adding an additional layer of security.

AD

To set up IP Access Control, you specify the allowed IP addresses or ranges for all network access to your storage account. Once configured, Azure authorizes only these listed IPs and denies access to all other. This ensures that only trusted sources can access your data, bolstering the security of your storage account.

Getting Started with Azure Storage Explorer
Getting Started with Azure Storage Explorer
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
Copy Files From SharePoint To An Azure Blob Storage Using Microsoft Flow
Copy Files From SharePoint To An Azure Blob Storage Using Microsoft Flow
Azure Storage Security Focuses On Five Key Areas
Azure Storage Security Focuses On Five Key Areas

Securing Shared Access Signatures

Another crucial aspect of preventing shared key access is securing shared access signatures (SAS). SAS provides delegated access to data in your Azure Storage account, and securing this access is crucial for maintaining data control and security.

Azure provides several ways to secure SAS, including SAS Tokens and SAS Query Parameters. SAS Tokens are encrypted and signed with your shared key and can only be created by your application. On the other hand, SAS Query Parameters provide a way to add a SAS token to a URL.

AD

SAS Tokens

SAS Tokens are URLs that contain access rights to perform a set of operations on resources in your storage account. They are encrypted, signed, and include the shared key. Thus, only your application, which has access to the shared key, can create a SAS token.

How to build a point-in-time recovery solution for your Azure Data Lake | Towards Data Science
How to build a point-in-time recovery solution for your Azure Data Lake | Towards Data Science
10 Best Key Value Database Reviewed in 2026
10 Best Key Value Database Reviewed in 2026
Data encryption with Customer Managed keys for Azure Event Hubs | Microsoft Community Hub
Data encryption with Customer Managed keys for Azure Event Hubs | Microsoft Community Hub
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
Azure Service Tags tagged as security risk, Microsoft disagrees
Azure Service Tags tagged as security risk, Microsoft disagrees
Mounting & accessing ADLS Gen2 in Azure Databricks using Service Principal and Secret Scopes | Towards Data Science
Mounting & accessing ADLS Gen2 in Azure Databricks using Service Principal and Secret Scopes | Towards Data Science
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
What is Azure role-based access control (Azure RBAC)?
What is Azure role-based access control (Azure RBAC)?
How to Create an Azure Storage Account | CodeGuru
How to Create an Azure Storage Account | CodeGuru
Microsoft Enables Security Defaults in Azure Active Directory
Microsoft Enables Security Defaults in Azure Active Directory
Find hidden malicious OAuth apps in Microsoft 365 using Cazadora
Find hidden malicious OAuth apps in Microsoft 365 using Cazadora
How To Create Azure Key Vault In Microsoft Azure Portal
How To Create Azure Key Vault In Microsoft Azure Portal
Hackers hate when you follow these habits
Hackers hate when you follow these habits
3 Steps To Take To Never Lose Your Keys Again - Ever!
3 Steps To Take To Never Lose Your Keys Again - Ever!

To enhance security further, you can make SAS tokens time-limited, ensuring that they are only valid for a specific duration. This limits the window of opportunity for potential misuse or unauthorized access. Additionally, you can restrict the permissions of a SAS token to specific operations, further containing the potential damage should a token be compromised.

SAS Query Parameters

SAS Query Parameters allow you to add a SAS token directly to a URL. This is particularly useful when you want to grant temporary access to files or containers in your Azure storage account, such as when sharing a file with another user.

AD

Any changes to the URL or its structure will automatically invalidate the SAS token, ensuring that only the intended resource is accessed and only for the specified duration. This offers an added layer of security and allows you to maintain control over the data in your Azure Storage Account.

In the broader context of Azure cloud security, preventing shared key access to your Storage Account is crucial for maintaining the confidentiality and integrity of your data. With Azure's robust security features, including Azure Storage Firewall, IP Access Control, and secure SAS mechanisms, you have powerful tools at your disposal to fortify your data's defenses. Stay proactive, stay secure, and make the most of what Azure has to offer.

AD