-
Notifications
You must be signed in to change notification settings - Fork 242
Add opt-in Key Vault RBAC authorization for CAF/landing zone compliance #2249
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
Open
Michael Flanakin (flanakin)
wants to merge
2
commits into
flanakin/v15-prep
Choose a base branch
from
flanakin/1067-keyvault-rbac
base: flanakin/v15-prep
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What happens on existing deployments? Will it end up with both, rbac and access policies, as we are not removing access policies via bicep I guess.
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.
🤖 [AI][Claude] 💬 Needs discussion
Traced this precisely: no, it will not end up with both.
accessPoliciesis set as a directproperties.accessPoliciesarray on theMicrosoft.KeyVault/vaultsresource itself (hub-app.bicep), not via the separate additiveMicrosoft.KeyVault/vaults/accessPolicieschild resource type. Since thekeyVaultresource is redeclared on every deployment where theRemoteHub/KeyVaultfeature is enabled (not skipped on redeploy), Incremental mode's "don't touch what's absent from the template" guarantee doesn't apply here — it only protects other resources not mentioned in the template, not properties on a resource that is declared. Whatever array the template sends fully replaces the live value.The
keyVaultAccessPoliciesvariable already reflects this: it evaluates to[]wheneverkeyVaultEnableRbacAuthorizationistrue(see the comment already there: "RBAC-authorized vaults must have an empty accessPolicies array; Azure rejects a non-empty array otherwise"). So flipping the flag totrueon a redeploy of an existing hub cleanly replaces the old access policy with an empty array — the vault ends up RBAC-only, not dual-auth. The newkeyVaultRoleAssignmentresource (also gated on the same flag) grants the equivalentKey Vault Secrets Userrole to Data Factory's identity in the same deployment, so access isn't dropped in the process — it's a clean cutover in one apply.No code change needed; the existing-deployment behavior is already correct and non-destructive by construction (Azure itself enforces the empty-array requirement, which is what forces the replace). The real risk here isn't dual-auth, it's the one already called out in the PR description and param docs: if any identity other than Data Factory's happened to rely on an access-policy grant on this vault, it would lose access with no automatic RBAC equivalent — but the PR's own investigation confirmed Data Factory's managed identity is the only data-plane secret reader, so that gap doesn't apply today.