-
Notifications
You must be signed in to change notification settings - Fork 337
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
Fix: Authentication Issue: azure.azcollection.azure_rm_storageblob Fails with Disabled Shared Keys #1564
Fix: Authentication Issue: azure.azcollection.azure_rm_storageblob Fails with Disabled Shared Keys #1564
Conversation
…ils with Disabled Shared Keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paronbol This certainly is not reasonable, you through the client_secret. ClientSecretCredential is not authorized to obtain credentials, cannot manage a blob of resources. Thanks!
Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
Hi @Fred-sun, thank you for your support. I propose to use client_secret.ClientSecretCredential() because is exactly the same method used in the working AzureCLI credentials method for the api rest in get_mgmt_svc_client(). azure/plugins/module_utils/azure_rm_common.py Lines 1505 to 1510 in 5191b94
MS Documentation of the ClientSecretCredential Class I tried on a real blob storage and worked. The class is able to obtain credentials to manage blob resources. MS for security recommends to disable SAS and use login or shared key when it is not possible. This is the importance of supporting this feature. |
@paronbol What you refer to configuring RBAC access, can you be more specific? I don't quite understand the authorization you said, thank you! |
In order to provide access to Service Principal into a Blob Storage you need to provide data access using a role, e.g. Storage Blob Data Contributor role |
@paronbol I assigned the role, but the mistake is still, I am investigating the reason, thank you! |
…ils with Disabled Shared Keys (ansible-collections#1564) * Fix: Authentication Issue: azure.azcollection.azure_rm_storageblob Fails with Disabled Shared Keys * Fix whitespace typo plugins/module_utils/azure_rm_common.py Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com> * Fix visual indent azure_rm_common.py --------- Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
Hi, I am facing an issue when trying to use "auth_source: msi" for downloading the azure storage blob. Looks like it always defaults to storage account key based access and when i use "auth_mode: login", it asks for msgraph module (where I think it will try to login) but msi doesn`t need to do any login. PS: |
@Ratanavery Thank for your feedback! Welcome to submit your problems! |
@Ratanavery Which value did you set for |
SUMMARY
PR in order to fix the feature of accessing storage blobs without SAS/key.
It is related with: #1255
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Now the access without SAS is supported by environment variables and cli