How to Restrict User Visibility of File Share, Queue, and Table Storage Service
Scenario
Suppose you have a specific requirement wherein the user should not have access to view the File Share, Queue, and Table Storage Services Data. The user should only be able to access and view the containers within the storage account. In this blog, we will delve into the methods and techniques to fulfil this requirement.
Assessment:
Azure Storage provides several predefined roles built-in roles that can be utilized to restrict users from executing certain operations on the Azure Storage Account. However, in order to fulfil the aforementioned requirement, it is necessary to customize the Role permissions according to the specific needs and constraints.
Steps to be followed:
You can make use of Azure Portal, PowerShell, or Az CLI to create a custom RBAC role.
Pre-requisites:
- Azure Storage account: You can use GPv2 Storage Account
- Ensure that you have enough permissions to create custom roles, such as Owner or User Access Administrator
We will create a custom role named “TestCustomRBACRole” which will restrict the user to view File Share, Queue and Table Storage Service Data by using Azure Portal
Step 1:
- Sign-in to the Azure portal with your credentials
- Go to the resource group where you could like the role to be implemented/ scoped to.
- Select Access Control (IAM)->Add-> Add Custom Role:
Step 2:
We will create a custom role named “TestCustomRBACRole”. The Baseline permission parameters helps with deciding whether you want to create your custom role by cloning and then modifying an existing role or by starting from scratch.
Here, I would be choosing the option of <Start from Scratch >
Step 3:
Click on Add Permission
Step 4:
Search for permissions to add to your custom role. In our case we will search for “Microsoft Storage” to find permissions related to storage account.
Add/Include Permission
After selecting Azure Storage, please search for blob and select below permission. In our scenario we will only select Read, Write delete operation for blob and container.
To obtain information about a specific storage account, we need to add below additional permission as well. If we don't add the "Read: List/Get Storage Account(s)" permission, we won't be able to access the storage account within that resource group.
Step 5:
The finalized format of the Custom Role-Based Access Control (RBAC) role is as follows, with the scope set at the resource group level. This role was created by selecting the "create" option.
Step 6:
Once the role has been created, we can assign it to the user by following the below steps: -
- Azure portal -> Resource group
- Access control (IAM) -> add-> role assignment
- From the role assignment choose the custom role you have created and assign it to the user. In our case Custom Role name is TestCustomRBACRole
Step 7:
The storage account <testforsourabh> was deployed under the resource group where the Custom RBAC role <TestCustomRBACRole> was assigned to user
The below operations were checked by the user to see if the RBAC role was working appropriately:
- User can view the Container
- User is getting Access denied error when click on File Share
- User would not be able to see any data in queue but there would be no error
- User will get Permission denied error for table storage as well
Hope this helps!
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...