How to control access to identity-specific folders in Azure Blob Storage using ABAC
An example use case:
I have an Azure Blob Container named "my-org-documents"; a specific folder should be shared across all the identities. However, each identity can only write into their subfolders.
I will use the below identities as example:
[email protected] (AD user)
ExampleMI12 (managed identity)
I have created a path called test, managedidentity and sharedfolder under the container, so the structure is as below:
my-org-documents/test
my-org-documents/managedidentity
my-org-documents/sharedfolder
My task is completed when:
- Active Directory user "test" is able to read/write into sharedfolder
- Active Directory user "test" is able to read/write into test folder but not into managedidentity folder.
- Managed Identity "ExampleMI12" is able to read/write into sharedfolder
- Managed Identity "ExampleMI12" is able to read/write into "ExampleMI12" folder but not into test folder.
Scoping the role assignment:
In such scenario, you can achieve the target by assigning "Storage Blob Data Contributor" to the required identity while applying ABAC conditions to add more control over folder access.
Configuring the user permissions:
- Assigning "Storage Data Contributor role" to user "test" on the storage account level.
-Then, in the conditions tab, I will add the below policy:
The above ABAC policy will only allow read/write access to "test" and "sharedfolder" paths, while it will deny access to all the other folders inside the "my-org-document" container or any other container inside the storage account.
Configuring the managed identity permissions:
- Assigning "Storage Data Contributor role" to managed identity "ExampleMI12" on the storage account level.
- Then, in the conditions tab, I will add the below policy:
Conclusion:
In this scenario, I was able to control folder level access for AD identities by assigning a role to each identity while adding specific ABAC conditions that will add more granularity over the wide role access.
Note: For ADLS endpoint, the ABAC policy should be modified to remove the ending slash from the blob path. Similar to the below example:
Note:
Please add "microsoft.storage/storageAccounts/blobServices/containers/blobs/runAsSuperUser/action" action on all conditions if:
1- The role definition contains this action, such as "Storage blob data owner"
2- The storage accounts included in this condition have hierarchical namespace enabled or might be enabled in the future.
Published on:
Learn moreRelated posts
Azure Storage - TLS 1.0 and 1.1 retirement
Overview TLS 1.0 and 1.1 retirement on Azure Storage was previously announced for Nov 1st, 2024, and it was postponed recently to 1 year later...
Efficient Management of Append and Page Blobs Using Azure Storage Actions
Overview In Azure Storage, Blob Lifecycle Management (BLM) allows you to automate the management of your data based on rules defined by...
[Azure AI Search] Internal Server Error when creating CMK encrypted objects
Scenario Customers follow the Microsoft doc to create CMK encrypted objects (data source, index etc.), but get the 500 Internal Serv...
Optimizing Azure Table Storage: Automated Data Cleanup using a PowerShell script with Azure Automate
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Optimizing Azure Table Storage: Automated Data Clean-up using a PowerShell script with Azure Automat
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Restoring Soft-Deleted Blobs with multithreading in Azure Storage Using C#
Blob soft delete is an essential feature that safeguards your data against accidental deletions or overwrites. By retaining deleted data for a...
Performing simple Azure Table Storage REST API operations using curl command.
The blog provides guidance to perform simple Table Storage REST API operations such as Create table, Delete Table, Insert entity, Delete entit...
Bulk delete all the old jobs from the batch account
Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task dat...
Utilizing Azure Storage and Runbooks for scheduled automated backups of Azure SQL Databases
In this article, we are going to provide detailed steps to create a scheduled Azure SQL Database backup to storage account using automation. T...
[Azure Service Bus] JMS messages getting dead-lettered
The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to th...