diff --git a/pkg/policies/opa/rego/azure/azurerm_container_registry/containerRegistryResourceLock.rego b/pkg/policies/opa/rego/azure/azurerm_container_registry/containerRegistryResourceLock.rego index 1f2a4074a..ad869328e 100755 --- a/pkg/policies/opa/rego/azure/azurerm_container_registry/containerRegistryResourceLock.rego +++ b/pkg/policies/opa/rego/azure/azurerm_container_registry/containerRegistryResourceLock.rego @@ -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 -} \ No newline at end of file +} 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 +}