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

Add KV policy management #256

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions terraform/jenkins-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,26 @@ resource "azurerm_key_vault_access_policy" "ssh_remote_build_jenkins_controller"
]
}

# Grant the Jenkins Controller VM's system-assigned managed identity access to the Key Vault
resource "azurerm_key_vault_access_policy" "jenkins_controller_kv_access" {
key_vault_id = data.azurerm_key_vault.ghaf_devenv_ca.id
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = module.jenkins_controller_vm.virtual_machine_identity_principal_id

key_permissions = [
"Get",
"List",
"Sign",
"Verify",
]

certificate_permissions = [
"Get",
"List",
]
}


# Allow the VM to *write* to (and read from) the binary cache bucket
resource "azurerm_role_assignment" "jenkins_controller_access_storage" {
scope = data.azurerm_storage_container.binary_cache_1.resource_manager_id
Expand Down
6 changes: 6 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ data "azurerm_key_vault_secret" "binary_cache_signing_key" {
provider = azurerm
}

# Reference the existing Key Vault
data "azurerm_key_vault" "ghaf_devenv_ca" {
name = "ghaf-devenv-ca"
resource_group_name = "ghaf-devenev-pki"
}

# Data sources to access 'workspace-specific persistent' data
# see: ./persistent/workspace-specific

Expand Down