feat: add rule AZ-KV-006 - Key Vault using legacy access policies instead of RBAC - #235
Merged
Merged
Conversation
…tead of RBAC Adds a scan rule that flags Key Vaults where enable_rbac_authorization is false or unset, i.e. still relying on legacy vault access policies instead of Azure RBAC for data-plane authorization. Includes a remediation playbook, compliant/non-compliant/missing-property test cases, and compliance framework mappings (CIS, NIST CSF, ISO27001, SOC2). The CIS mapping is left as TBD-KV-006 pending maintainer input: the real CIS 8.6 control for this check is already assigned to AZ-KV-004 in this repo, a pre-existing mismatch this PR doesn't resolve unilaterally. Closes openshield-org#234 Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>
dipeshrayg
requested review from
SHAURYAKSHARMA24,
TFT444,
Vishnu2707,
parthrohit22,
ritiksah141 and
vogonPrayas
as code owners
August 7, 2026 15:08
Collaborator
|
@dipeshrayg Thanks for working on AZ-KV-006. The rule and test coverage look good, but the PR is not ready to merge yet:
Once these points are addressed, we can review it again. |
- Use ${1:-} / ${2:-} for RESOURCE_GROUP and VAULT_NAME so missing
arguments fall through to the usage message instead of aborting on
the set -u unbound-variable check.
- Move the RBAC migration warning before the az keyvault update call,
so it's seen before the vault is changed, not after.
Addresses review on openshield-org#235.
Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>
Vishnu2707
approved these changes
Aug 8, 2026
Vishnu2707
left a comment
Member
There was a problem hiding this comment.
we don't check authorization model anywhere else in the KV rules. Code and tests look good to me, good job @dipeshrayg . Only thing pending on our end is sorting out the CIS 8.6 collision with AZ-KV-004, we'll get that resolved and update the mapping. Approving this for now.
@TFT444 - can u have a look at the collision.
17 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Adds scan rule AZ-KV-006, which flags Azure Key Vaults still authorizing access through legacy vault access policies instead of Azure RBAC.
Type of change
Rule details
Testing
tests/test_rules_keyvault.py(compliant, non-compliant, and missing-property cases, mocked AzureClient), 18/18 passing locallyazureSDK packages, unrelated to this change), buttests/test_cis_benchmark_mapping.py(duplicate-control-id and rule/mapping-agreement checks) passes for this rule specificallyRelated issue
Closes #234
Note on the CIS mapping
The official CIS Azure Foundations Benchmark control for "Enable Role Based Access Control for Azure Key Vault" is 8.6. In this repo, 8.6 is already assigned to AZ-KV-004 (purge protection) — an unrelated check, and looks like a pre-existing mapping error. I didn't want to unilaterally reassign another rule's control ID in this PR, so AZ-KV-006 is mapped to
TBD-KV-006for now, following the sameTBD-*placeholder convention already used elsewhere incis_azure_benchmark.json(e.g.TBD-IDN-010). Flagged in issue #234 for a maintainer decision.Checklist
Signed-off-bytrailer (git commit -s)