Skip to content

Commit

Permalink
fix(pkg/policies/opa/rego/azure/azurerm_container_registry/containerr…
Browse files Browse the repository at this point in the history
…egistryresourcelock.rego): check correct fields (#858)

check that the azurerm_management_lock has the correct scope by
checking that is scoped to the correct terraform resource id.

Signed-off-by: maxgio92 <[email protected]>
  • Loading branch information
maxgio92 authored Jun 14, 2021
1 parent c642063 commit 2ca5eb1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ resourceLockExist(registry, registry_input) = exists {
registry_name := sprintf("azurerm_container_registry.%s", [registry.name])
resource_lock_exist_set[registry_name]
exists = true
}
} else = exists {
# hcl inspection
resource_lock_exist_set := { resource_lock_id | resource_lock_id := split(input.azurerm_management_lock[i].config.scope, ".")[1] }
resource_lock_exist_set[registry.name]
exists = true
}

0 comments on commit 2ca5eb1

Please sign in to comment.