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

[Storage] Bug: Updating Default Access Control Lists does not work #22144

Closed
YoshicoppensE61 opened this issue Dec 13, 2021 · 4 comments
Closed
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Lake Storage Gen2 needs-team-attention This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)

Comments

@YoshicoppensE61
Copy link

YoshicoppensE61 commented Dec 13, 2021

  • Package Name: azure-storage-file-datalake
  • Package Version: 12.5.0
  • Operating System: Windows
  • Python Version: 3.7.7

Describe the bug
Using the function update_access_control_recursive or set_access_control works well to update regular ACL for files and folders. However, normally to update Default Access Control Lists, it should suffice to add "default:" as a prefix, but here errors pop up. I can add a default Access Control List for the standard options (owning group [default:group::r-x], owner[default:user::r-x], other[default:other::---]), but when I try to add an actual aad_id from a different AD group (using default:user:xxx..xxxx:r-x) I get an error.

(InvalidNamedUserOrNamedGroup) The named user or named group in the access control list is not valid.
RequestId:d216f552-d01f-003e-2e3f-f0a57a000000
Time:2021-12-13T16:39:14.8081970Z

For the same AD group, I do succeed in updating the Access ACL, so not sure why this is going wrong, maybe there is some kind of filter on it?

To Reproduce
Steps to reproduce the behavior:

  1. Create an Azure Data Lake Gen 2
  2. Create a container in the storage account
  3. Create a folder in the container
  4. credential = ClientSecretCredential(tenant_id, client_id, client_secret)
    service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format(
    "https", storage_account_name), credential=credential)
    file_system_client = service_client.get_file_system_client(file_system=)
    directory_client = file_system_client.get_directory_client()
    acl = 'default:user:{<aad_id>}:r-x'
    directory_client.update_access_control_recursive(acl=acl)

Expected behavior
If I just add a default ACL rule via the Azure Portal for the same AD Group, it just immediately works when I try to save it. So I would expect no error here and the group to be added to the ACL rules.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 13, 2021
@YoshicoppensE61 YoshicoppensE61 changed the title Trying to update Default Access Control Lists does not work Updating Default Access Control Lists does not work Dec 13, 2021
@YoshicoppensE61 YoshicoppensE61 changed the title Updating Default Access Control Lists does not work [Storage] Bug: Updating Default Access Control Lists does not work Dec 13, 2021
@yunhaoling yunhaoling added bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Data Lake Storage Gen2 and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 14, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 14, 2021
@yunhaoling
Copy link
Contributor

thanks @YoshicoppensE61 for reaching out, we'll investigate ASAP.

@ghost ghost added the needs-team-attention This issue needs attention from Azure service team or SDK team label Dec 14, 2021
@jalauzon-msft jalauzon-msft added the Storage Storage Service (Queues, Blobs, Files) label May 21, 2022
@jalauzon-msft
Copy link
Member

Hi @YoshicoppensE61, apologies for this never getting looked at. It seems it fell off the radar. Are you still experiencing the issue? I was not able to repro this in local testing so it seems the SDK should support this scenario just fine.

My one suspicion is your use of ClientSecretCredential here which means you are using AAD Auth to attempt to update the ACLs. Have you configured your RBAC roles for that identity correctly to update ACLs? To update ACLs you must have the "Storage Blob Data Owner" (or equivalent) role assigned to your identity. See more details here. If this is not configured correctly it could explain why the request is saying it can't find the user you specified. This could also explain why it works for you in the Azure Portal because there you are authenticated as yourself.

If you are flexible in your credential type, you could also try using Shared Key auth to make the update or DefaultAzureCredential.

@jalauzon-msft jalauzon-msft added the needs-author-feedback More information is needed from author to address the issue. label Aug 31, 2022
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Sep 8, 2022
@ghost
Copy link

ghost commented Sep 8, 2022

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@YoshicoppensE61
Copy link
Author

@jalauzon-msft Hi, I think I worked around it or maybe I managed to fix it somehow, but in any case, the setup I was going for, works now, so you can close this ticket!

@ghost ghost removed needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. labels Sep 12, 2022
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-python that referenced this issue Jan 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Data Lake Storage Gen2 needs-team-attention This issue needs attention from Azure service team or SDK team Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

6 participants