From 36ca6eb2ad5e1625afe32cda5273cb33d2822eda Mon Sep 17 00:00:00 2001 From: Gaurav Gogia <16029099+gaurav-gogia@users.noreply.github.com> Date: Thu, 24 Jun 2021 12:25:23 +0530 Subject: [PATCH] add proper values via metadata (#888) * add proper values via metadata * add name --- .../azure/azurerm_managed_disk/accurics.azure.EKM.156.json | 4 +++- .../rego/azure/azurerm_managed_disk/checkDiskEncryption.rego | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/policies/opa/rego/azure/azurerm_managed_disk/accurics.azure.EKM.156.json b/pkg/policies/opa/rego/azure/azurerm_managed_disk/accurics.azure.EKM.156.json index 617342d39..503f91140 100755 --- a/pkg/policies/opa/rego/azure/azurerm_managed_disk/accurics.azure.EKM.156.json +++ b/pkg/policies/opa/rego/azure/azurerm_managed_disk/accurics.azure.EKM.156.json @@ -4,7 +4,9 @@ "policy_type": "azure", "resource_type": "azurerm_managed_disk", "template_args": { - "prefix": "reme_" + "prefix": "reme_", + "name": "checkDiskEncryption", + "suffix": "" }, "severity": "MEDIUM", "description": "Ensure that 'Unattached disks' are encrypted in Azure Managed Disk", diff --git a/pkg/policies/opa/rego/azure/azurerm_managed_disk/checkDiskEncryption.rego b/pkg/policies/opa/rego/azure/azurerm_managed_disk/checkDiskEncryption.rego index ceb849106..824fbf347 100755 --- a/pkg/policies/opa/rego/azure/azurerm_managed_disk/checkDiskEncryption.rego +++ b/pkg/policies/opa/rego/azure/azurerm_managed_disk/checkDiskEncryption.rego @@ -2,7 +2,7 @@ package accurics {{.prefix}}{{.name}}{{.suffix}}[managed_disk.id] { managed_disk := input.azurerm_managed_disk[_] - encryption_settings = managed_disk.config.encryption_settings[_] + encryption_settings := managed_disk.config.encryption_settings[_] encryption_settings.enabled == false }