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

Use built in Azure role to reduce required permissions for terraform #59

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ots22
Copy link
Member

@ots22 ots22 commented Oct 21, 2024

This PR removes the requirement for the user applying the terraform configuration to have the Microsoft.Authorization/roleDefinitions/write permission.

The aim is to make it possible to run terraform as a user with minimal additional permissions over those of a Contributer (and ideally less than a full Administrator).

Currently, running the terraform configuration requires the following permissions that a 'Contributor' does not already have:

  • Microsoft.Authorization/roleAssignments/write (and maybe delete)
  • Microsoft.Authorization/roleDefinitions/write (and maybe delete)

A Role Based Access Administrator has the first of these, but still would not be able to create a custom role. It can be further limited by a condition.

The "app_data_read" role is equivalent to the built-in role "Storage Blob Data Reader", except for the former's limited scope, so one solution is to use this to avoid needing roleDefinitions/write. The scope is specified when the role is applied, so the permission granted to the app is the same.

To do

  • Check that the terraform generates the expected plan
  • Check terraform apply (I'm unable to do this currently as I am only a Contributor to the subscription I have access to)

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.

1 participant