Skip to content

Secure Your Data: Advanced Techniques in Azure Storage Security

azure cloud storage account security techniques

Introduction

In today’s digital world, protecting your data is more important than ever. Azure provides powerful tools and features to help you secure your storage and keep your information safe. Adhering to security and compliance guidelines is crucial across all storage tiers. Microsoft offers secure design principles for storage, ensuring your data is well-protected.

This blog post is designed for anyone seeking a comprehensive guide on securely configuring Azure Storage resources. We’ll walk you through advanced security techniques to ensure your data is shielded from threats. Whether you’re a seasoned professional or new to cloud security, you’ll find valuable insights to enhance your security strategy. Let’s dive in and learn how to safeguard your data in Azure.

It covers the following key aspects:

  • Secure Configurations: Identifying the right configurations to achieve compliance and security.
  • Risk Assessment: Understanding the risks associated with each configuration to prioritize and address them effectively.
  • Control Automation: References to Azure policies that can be used as detective, corrective, or preventative controls.

Azure Storage Security Compliance

Cloud infrastructure services, such as storage accounts, come with a baseline set of configurations and provide various options that users must select based on their application needs. Many cloud security issues arise from these configurations being too “open” or insecure. For storage services, users do not have access to the host operating system. Instead, storage can be deployed within a user’s chosen network boundary, and user data is stored at rest.

You may also see below whether an Azure built-in Policy (built-in meaning available via Microsoft) is available to be used. Please note that you are also able to create custom policies via Azure policies in cases where the built-in policy is not available and in cases the risk can be controlled via a policy definition.

Policies can be created as a detective, preventative and corrective control based on the chosen “effect” of the policy (for example: Audit, Deny, Modify, etc.). Once policies have been assigned (built-in) or created (then assigned), you can view the compliance stature of your resources (beyond just storage) via the policy tab within your Azure console/UI:

Here’s the link to the Azure policy documentation Link.

Identity and access management

Ensure storage account access is configured via Azure AD

Requests to your cloud storage should be authorized by default to either use Azure AD or access keys. Please note that it is recommended to use Azure AD for authorization requests since it provides a higher level of security, and it is the recommended Azure path.

Why enable this?Azure AD is used to centrally manage user identities and access privileges and provides a higher level of security than the use of access keys. It’s a one-stop shop to create and manage accounts, and assigning roles and permissions is a much safer alternative than using access keys.
Built–In Azure PolicyStorage accounts should prevent shared key access
Risk levelHigh

Ensure storage account access keys are renewed (decided intervals)

During the creation of a storage service, access keys are auto-generated in the background which can be used for authentication (between storage and applications). Please note that it is recommended to use Azure AD for authorization requests.

Why enable this?Best practice is to renew these keys every 90 days to decrease the likelihood of accidental exposure or sabotage. Renewing in frequent intervals helps you limit that exposure level (in case your keys are compromised) and window and protects your resource against unauthorized access.
Built–In Azure PolicyNot available
Risk levelMedium

Ensure SAS tokens are set with an expiry

SAS tokens are an alternative to using account access keys (for fine-grained access) and are an option when you want to provide limited permissions of your storage, to users or applications. It provides secure delegated access to resources in your storage account. With SAS, you have granular control over how a client can access your data. It’s best practice to provide SAS tokens with a set expiry time, to reduce the risk of exposure and unwanted access (recommended time is an hour). Refer to this link for more info on SAS types Link.

Why enable this?When you provide a SAS token to a client, it allows them to access your resources for a specified amount of time. To make sure the client only has access for that exact time period (to follow the principle of least privilege, you need to make sure someone has access to your resource for only the approved period), it’s important to ensure that the token has an expiry set.
Built–In Azure PolicyStorage accounts should have shared access signature (SAS) policies configured
Risk levelMedium

Prioritize Managed identity over SAS tokens

Managed identities are a safer way to grant access to storage data and it nulls the requirement for you to include shared access signature tokens (SAS) with your source and target container URLs. Managed identities provide an alternate method for you to grant access to your storage data.

Why enable this?Managed identity credentials are fully managed, rotated, and protected by Azure. Identities are provided and deleted with storage resources, ensuring end to end life cycle management. Using managed identities you can enable your storage resources to communicate with other services that support Microsoft Entra/Azure AD authentication.
Built–In Azure PolicyNot available
Risk levelHigh

Ensure shared access signature tokens are over HTTPS only

Ensure that your SAS tokens are configured to allow access requests over the HTTPS protocol only. A Shared Access Signature (SAS) is a URI that grants restricted access rights to your Azure Storage resources. A SAS token is the query string that includes all the information required to authenticate the Shared Access Signature, as well as to specify the Azure Storage service and resource, the permissions required for access, and the timeframe for which the signature is valid.

Why enable this?When SAS is transmitted over HTTP it can be intercepted via a man-in-the-middle attack, eventually leading the attacker to be able to get access to the token and use it to read or corrupt sensitive data within your storage.
Built–In Azure PolicyNot available
Risk levelMedium

Ensure overly permissive stored access policies are not present

A stored access policy provides an additional layer of control on top of the service-level shared access signature (SAS). A SAS URI should have limited access rights (based on the principle of least privilege).

Why enable this?To protect your Azure Storage account resources against unapproved access, configure the stored access policies associated with your service SAS tokens to follow the principle of least privilege by giving these policies the minimal set of permissions required to perform their tasks successfully.
Built–In Azure PolicyNot applicable
Risk levelHigh

RBAC

Beyond the IAM secure configurations, it’s also important to understand and use RBAC (Microsoft’s authorization system that controls access to Azure resources) in the correct way to securely configure your storage service. Configuring Azure Storage RBAC involves:

  • Defining who can access your storage resources
  • Defining what actions, they can perform
  • Understanding roles, security principles (plus managed identities) and role assignments

Roles help you define permissions for accessing resources (e.g., Storage Blob Contributor, Storage Account Contributor). Security Principal is the identity requesting access (user, group, application). Role Assignment is the link between a security principal to a role at a specific scope (subscription, resource group, storage account, container).

Note that it is recommended to use Azure RBAC instead of key usage (for example SAS keys).

Network Security

The default network access rule should be set to “Deny” within your storage account

By default, access is open: all network connections are accepted. When set, this will deny access to traffic from all networks including public networks. You can also allow limited networks to access your storage by configuring those specific settings.

Why enable this?The access to your storage account should be granted to specific networks only. When network rules are configured, only applications from allowed networks or IPs can access your storage resources. When requesting access from an allowed network and/or IP address, a client/application should provide proper authorization, i.e. a valid access key or a Shared Access Signatures (SAS) token, to access the storage account.
Built–In Azure PolicyConfigure Storage Accounts to restrict network access through network ACL bypass configuration only.   Storage accounts should restrict network access using virtual network rules
Risk levelHigh

Ensure private endpoints are used:

Azure provides the availability of private endpoints, which essentially is a secure network “tunnel” that provides storage to use private IP addresses. Using a private endpoint, you can connect to a storage service using their private IP: without exposing them to the public. Note that the private link itself is free to use but private endpoints have cost implications. There are also limits to the number of private endpoints you can create in a subscription but there are no specific performance limitations or issues with private endpoints.

Why enable this?A private link enables a secure network interface that enables private access via the use of a private IP. It gives you the option of connecting to other services without exposing them to the internet.
Built–In Azure PolicyStorage accounts should use private link   Configure Azure File Sync with private endpoints
Risk levelHigh

Ensure “trusted access” is enabled for Microsoft-specific services

Enabling firewall rules for your storage account will block access to incoming requests for data, including from other Azure services. To allow these Azure services to work as intended and be able to access your storage account resources, you must add an exception so that the trusted Microsoft Azure services can bypass your network rules.

Why enable this?If the “Allow trusted Microsoft services to access this storage account” exception is enabled, specific services are granted access to your storage account.
Built–In Azure PolicyStorage accounts should allow access from trusted Microsoft services
Risk levelMedium

Ensure public access to storage accounts with blob containers is disabled

Disable anonymous access to all the blob containers provisioned within your Azure storage accounts. To follow security best practices and keep your data safe and secure in the Azure cloud, ensure that your blob containers are not publicly exposed. Note: also ensure that the Microsoft Azure storage container where the exported activity log files are saved is not publicly accessible from the Internet, in order to avoid exposing sensitive data and minimize security risks.

Why enable this?In case public access is enabled, a user can access blob containers anonymously and would not require credentials such as shared access signatures leading to your containers being exposed.
Built–In Azure PolicyConfigure your Storage account public access to be disallowed
Risk levelHigh

Configure Minimum TLS Version

Ensure that all your Microsoft Azure Storage accounts are using the latest available version of the TLS protocol in order to enhance the security of the connection between your storage accounts and their clients/applications and comply with industry standards.

Why enable this?TLS 1.0 and 1.1 versions are known to be susceptible to certain CVEs. They don’t support modern encryption methods and cipher suites, which is why it’s always recommended to be using version 1.2 for all requests made to your storage services.
Built–In Azure PolicyStorage accounts should have the specified minimum TLS version
Risk levelMedium

Ensure secure transfer setting is enabled

STS or secure transfer ensures that all data transferred to and from your storage account is encrypted.

Why enable this?When enabled, Azure Storage only allows connections via HTTPS (HTTP over TLS/SSL), ensuring that data exchanged between your application and the storage account is encrypted during transit.
Built–In Azure PolicySecure transfer to storage accounts should be enabled
Risk levelMedium

Asset management

Ensure Enable Blob Storage Lifecycle Management is utilized:

Users can set lifecycle management policies to change data state (for example change data state from hot to archive) or expire data which can be very useful for security, availability and cost optimization reasons.

Why enable this?Blob storage transitions and expires blob data automatically according to the lifecycle management policy that you define at the storage account level. The lifecycle management policy lets you automatically delete blob data at the end of its lifecycle and transition blob data to a cold storage tier (hot to cold, hot to archive or cold to archive) in order to optimize it for security and cost.
Built–In Azure PolicyNot applicable
Risk levelMedium

Ensure Cross-Tenant Object Replication is disabled

This is required to prevent object replication across other Azure tenants. This is usually done to increase redundancy and disaster recovery across tenants (which translates to organization boundaries).

Why enable this?CTOR increases the risk of unauthorized data access, data leakage, and compliance breaches and should be disabled if not required.
Built–In Azure PolicyStorage accounts should prevent cross tenant object replication
Risk levelHigh

Data protection:

Enable Infrastructure Encryption

By default, the data stored within your Microsoft Azure Storage accounts is automatically encrypted at rest using 256-bit AES encryption. When infrastructure encryption is enabled for a storage account or an encryption scope, data is encrypted at two levels: once at the service level and once at the infrastructure level (with two different encryption algorithms and two different keys).

The keys in question here could be either platform or customer-managed (that’s also where the distinction between infra encryption and customer-managed key lies). Note that this leads to a slight performance impact due to the double encryption and decryption. The cost involved is based on the keys being used and type (platform vs customer managed).

Why enable this?This helps mitigate potential risks associated with compromised encryption algorithms or keys. The data is also encrypted prior to network transmission and during all backup processes, ensuring continuous protection.
Built–In Azure PolicyStorage accounts should have infrastructure encryption   Storage account encryption scopes should use double encryption for data at rest (Note that encryption scopes enable you to manage encryption with a key that is scoped to a container or an individual blob. You can use encryption scopes to create secure boundaries between data that resides in the same storage account but belongs to different customers).
Risk levelHigh (but only where it is really required for compliance reasons)

Make use of the immutable blob feature

The immutable blob storage feature helps you store your blob objects in a non-changeable or “immutable” form: making sure that modification or deletion operations cannot be completed. This is mainly used by applications that need to conform to more strict compliance or regulatory requirements.

Why enable this?This feature helps you store your blob objects in an immutable form, providing an additional layer of protection against object modification and deletion. Refer to this documentation for more guidance on application use cases: Link
Built–In Azure PolicyNot applicable
Risk levelHigh (only when required)

Ensure you use customer-managed keys (CMKs) to encrypt data within Azure Storage accounts

When you store data in storage accounts, it is automatically encrypted using platform-managed encryption keys created and maintained by Microsoft Azure. While these keys provide security, they are still controlled by Azure. For stricter compliance or full control over your encryption keys, you should use customer-managed encryption keys. These come in a few varieties:

Customer-managed encryption key  Not applicable  Keys are created and managed via Microsoft
Customer-managed encryption keySoftware backed keysKeys are created and managed by the customer within Azure itself  
Customer-managed encryption keyHSM backed keysKeys are created and managed by the customer – but via the use of a hardware security module (HSM)  

Note that the use of customer-managed keys has cost implications (based on type and storage location).

Why enable this?Regulatory or compliance requirements – this is done to gain full control over who can use the encryption keys and who can use them to access the data.
Built–In Azure PolicyQueue Storage should use customer-managed key for encryption   Table Storage should use customer-managed key for encryption   Storage accounts should use customer-managed key for encryption
Risk levelHigh

Logging and threat detection

Ensure diagnostic settings are enabled for storage types:

Diagnostic settings in Azure are used to collect resource logs. You can also set up metrics and logs are set up to be used via Azure monitor: please reference this official documentation Link.

Why enable this?Diagnostic settings provide detailed information about how a resource is operating. This data can be used for monitoring, troubleshooting, and auditing. This data is very helpful in case of incidents on periodic reviews.
Built–In Azure PolicyConfigure diagnostic settings for Blob Services to Log Analytics workspace   Configure diagnostic settings for File Services to Log Analytics workspace   Configure diagnostic settings for Queue Services to Log Analytics workspace   Configure diagnostic settings for Storage Accounts to Log Analytics workspace   Configure diagnostic settings for Table Services to Log Analytics workspace   Note that it is also possible to send logs to a different location like log analytics or storage, there are multiple built-in policies available for this:   Enable logging by category group for HPC caches (microsoft.storagecache/caches) to Log Analytics
Risk levelMedium

Ensure Defender is deployed for storage accounts:

Azure Defender is a security management tool that helps protect Azure resources and other workloads from threats. Note that enabling a defender has cost implications.

Why enable this?Defender is integrated with Azure Security Center and analyzes signals from the Azure network fabric and service control plane to detect threats. Defender provides constant monitoring of your storage instance and gives you information on current risks.
Built–In Azure PolicyDeploy Defender for Storage (Classic) on storage accounts
Risk levelHigh

Backup and recovery

Ensure blob versioning is enabled

Enable Blob storage versioning to automatically maintain previous versions of an object. With blob versioning enabled, earlier versions of a blob can be accessed, allowing data recovery if it is modified or deleted.

Why enable this?Blob storage versioning automatically maintains previous versions of an object. Once enabled, this enables access to earlier versions of a blob, used to recover lost data (in case of accidental or sabotage modification or deletion).
Built–In Azure PolicyConfigure your Storage account to enable blob versioning
Risk levelMedium

Ensure backup is enabled

Backup can help protect storage data from deletion, ransomware, and other disasters (in accidental or sabotage scenarios).

Why enable this?Backup stores data in the cloud, keeping it safe and accessible even if something happens to the original data. Backups are also needed when organizations need to meet recovery time and recovery point objectives for critical workloads.
Built–In Azure Policy[Preview]: Azure Backup should be enabled for Blobs in Storage Accounts   [Preview]: Configure backup for blobs on storage accounts with a given tag to an existing backup vault in the same region   [Preview]: Configure blob backup for all storage accounts that do not contain a given tag to a backup vault in the same region
Risk levelMedium