Skip to content
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

feat(terraform): Ensure RBAC for Azure Key Vault is enabled #6175

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

tdefise
Copy link
Contributor

@tdefise tdefise commented Apr 16, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Fixes #6164

New/Edited policies (Delete if not relevant)

Description

Azure Key Vault offers two authorization systems: Azure role-based access control (Azure RBAC), which operates on Azure's control and data planes, and the access policy model, which operates on the data plane alone.

Azure RBAC is built on Azure Resource Manager and provides centralized access management of Azure resources. With Azure RBAC you control access to resources by creating role assignments, which consist of three elements: a security principal, a role definition (predefined set of permissions), and a scope (group of resources or individual resource).

The access policy model is a legacy authorization system, native to Key Vault, which provides access to keys, secrets, and certificates. You can control access by assigning individual permissions to security principals (users, groups, service principals, and managed identities) at Key Vault scope.

Azure RBAC is the recommended authorization system for the Azure Key Vault data plane. It offers several advantages over Key Vault access policies:

Azure RBAC provides a unified access control model for Azure resources — the same APIs are used across all Azure services.
Access management is centralized, providing administrators with a consistent view of access granted to Azure resources.
The right to grant access to keys, secrets, and certificates is better controlled, requiring Owner or User Access Administrator role membership.
Azure RBAC is integrated with Privileged Identity Management, ensuring that privileged access rights are time-limited and expire automatically.
Security principals' access can be excluded at given scope(s) through the use of Deny assignments.

Source: https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-access-policy

Fix

Change "enable_rbac_authorization" to "true"

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@tdefise tdefise changed the title Created check feat(Terraform): Ensure RBAC for Azure Key Vault is enabled Apr 16, 2024
@tdefise tdefise changed the title feat(Terraform): Ensure RBAC for Azure Key Vault is enabled feat(terraform): Ensure RBAC for Azure Key Vault is enabled Apr 16, 2024
Copy link
Contributor

@bo156 bo156 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!
Please fix your tests so we can push it :)


class TestKeyVaultEnablesRBAC(unittest.TestCase):

def test(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this test is currently not catching everything correctly based on the last unit-tests run, please fix it and update us :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi,

Is it possible to get the logs please ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure Key Vault - Ensure RBAC for Azure Key Vault is enabled
3 participants