-
Notifications
You must be signed in to change notification settings - Fork 96
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
Support RBAC access control for cosmosDb #313
Comments
Hi @harsimranmaan, apologies as I am a little confused by the request. For quite some time now, all new deployments of Azure IPAM use RBAC access for Cosmos DB and no longer use Access Keys. If you review the Bicep deployment for the Cosmos DB component, you can see that it is deployed exactly as you have described above: https://github.com/Azure/ipam/blob/main/deploy/modules/cosmos.bicep Is there something I'm missing perhaps? |
Please see ipam/engine/app/routers/common/helper.py Line 27 in 4919aeb
|
@harsimranmaan, this is in place for legacy customers who were originally using Shared Key credentials so the product continues to work until they migrate. All net-new deployments use Managed Identity w/ RBAC. Does this make sense? |
I see what you're saying, this is the section that needs to be commented out: https://github.com/Azure/ipam/blob/main/deploy/modules/cosmos.bicep#L93 That is what you were referring to, correct? While you are correct that this DOES write the Key to KeyVault (which I will fix), the environment variable is no longer created in the App Service Bicep file, so the Shared Key is actually not used as the code you highlighted is looking for the environment variable, which it will not find. |
The cosmosdb setting to not use local auth would also need to be set per the recommendations. Combined with dropping the key, it should be enough I think |
Understood, will add both in the next release. Thanks @harsimranmaan 👍 |
This has been addressed in the latest release. Feel free to close it @DCMattyG |
Hi @harsimranmaan, it is partially implemented. I haven't added the Local Auth component just yet as I'd prefer have an associated document explaining how to gain Data Plane access should users need to view the Cosmos DB contents within the Azure Portal. Today this can only be done via PowerShell or CLI, so I don't want anyone to get stuck once this flag gets added to future deployments. |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Azure reports the following best practice when checking CosmosDb usage for IPAM
Azure Cosmos DB accounts should use Azure Active Directory as the only authentication method
Describe the solution you'd like
Manual remediation:
Change your resource authentication method to RBAC. After RBAC is enabled, edit the configuration settings to enforce RBAC as the only authentication method.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
This'll likely require minor code tweaks to move from using the primary key to AAD in the application.
The text was updated successfully, but these errors were encountered: