Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Mar 27, 2025

Description

KeyVaultAdministrator is too high of a priviledge role to use by default in applications. By default apps should not need to manage key vault settings, but instead just be able to read secrets. So instead, by default apps will get KeyVaultSecretsUser role and if an application needs a higher role, it can be configured easily by using WithRoleAssignments.

Fix #8218

Checklist

KeyVaultAdministrator is too high of a priviledge role to use by default in applications. By default apps should need to manage key vault settings, but instead just be able to read secrets. So instead, by default apps will get KeyVaultSecretsUser role and if an application needs a higher role, it can be configured easily by using WithRoleAssignments.

Fix dotnet#8218
Copilot AI review requested due to automatic review settings March 27, 2025 15:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to lower the default KeyVault role for applications from KeyVaultAdministrator to KeyVaultSecretsUser to reduce privilege levels.

  • Updated test resource definitions in AzureBicepResourceTests.cs to assign the KeyVaultSecretsUser role.
  • Modified default role assignment in AzureKeyVaultResourceExtensions.cs to use KeyVaultSecretsUser by default.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/Aspire.Hosting.Azure.Tests/AzureBicepResourceTests.cs Changed role assignments from KeyVaultAdministrator to KeyVaultSecretsUser to match reduced privilege requirements
src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResourceExtensions.cs Updated default role in the role assignment method to use KeyVaultSecretsUser

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 27, 2025
@eerhardt eerhardt added area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure azure-keyvault and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Mar 27, 2025
@eerhardt eerhardt merged commit 053bb02 into dotnet:main Mar 27, 2025
167 checks passed
@eerhardt eerhardt deleted the KeyVaultAdmin branch March 27, 2025 19:05
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure azure-keyvault

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the default role for KeyVault references to Key Vault Secrets User

3 participants