Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-AzRoleAssignment returns assignment for soft deleted storage containers #25375

Open
ztrhgf opened this issue Jun 25, 2024 · 6 comments
Open
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Resource Authorization AzRole* in Az.Resources Service Attention This issue is responsible by Azure service team.

Comments

@ztrhgf
Copy link

ztrhgf commented Jun 25, 2024

Description

Follow the steps below to simulate this issue

  • create a new Storage Account Container named SSS
  • assign role RRR to group GGG
  • remove this Container
  • create again a new Storage Account Container named SSS
  • list assigned roles via Get-AzRoleAssignment

You will receive various inherited role assignments but also assignments for role RRR and group GGG which are actually assigned at the deleted container, not this one newly created!

Issue script & Debug output

Get-AzRoleAssignment

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1, 6.0, 7.0}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.15.0                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault, Connect-AzAc…
Script     6.4.1                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeploy…
Script     3.0.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Ad

Error output

No error
@ztrhgf ztrhgf added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Jun 25, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Jun 25, 2024
@isra-fel isra-fel added Resource Authorization AzRole* in Az.Resources Service Attention This issue is responsible by Azure service team. labels Jun 26, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kenieva, @AshishGargMicrosoft.

@isra-fel
Copy link
Member

Thanks for reporting @ztrhgf let me loop in the RBAC (role based access control) team
Also cc @blueww although I guess this is not specific to Storage Account

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kenieva, @AshishGargMicrosoft.

@blueww
Copy link
Member

blueww commented Jun 27, 2024

This looks like a server side behavior, instead of Azure Powershell issue.
It might be better to raise a help ticket to get support from server side.

Besides that, I don't see Storage Powershell cmdlets related with this issue.
Feel free to give the detail of the action needed from Powershell Storage side.

@ztrhgf
Copy link
Author

ztrhgf commented Jun 27, 2024

This looks like a server side behavior, instead of Azure Powershell issue. It might be better to raise a help ticket to get support from server side.

Besides that, I don't see Storage Powershell cmdlets related with this issue. Feel free to give the detail of the action needed from Powershell Storage side.

I've no idea (and I don't care) whether this is cmdlet issue or what. I am just saying that the behavior of this particular cmdlet is unexpected to say it politely :)

I also don't know whether this applies to other Azure resources besides Storage Account.

Anyway I had to create a custom function that calls the same API as Azure GUI a.k.a. GET request on "https://management.azure.com/$scope/providers/Microsoft.Authorization/roleAssignments?`$filter=atScope()&api-version=2020-04-01-preview"

@blueww
Copy link
Member

blueww commented Jun 27, 2024

@ztrhgf

We work on Powershell (client side), not on Azure server side, so we might not be the best person to help you for server issue.
To get the help more efficiently for server issue, please raise a help ticket in Azure Portal with: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request#go-to-help--support-from-the-global-header

Besides that, I would suggest sharing more details of this issue in the help ticket (and here), like:

  1. details repro script (hide credential)
  2. When you assign the role RRR to group GGG, which scope do you use?
  3. Why do you think "role RRR and group GGG which are actually assigned at the deleted container, not this one newly created"? Please give the actually result and the expect result.

It's a little confuse, since normally when do token validation, will validate the container name (path), but not care about the container creation time. So the old/new container with same name should be equally in token validation.

However, the issue looks not related with storage cmdlets, but role assignment cmdlets, this is not owned by storage team. @isra-fel Would you please help to follow up if any support of role assignment cmdlets needed for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Resource Authorization AzRole* in Az.Resources Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants