From 31eee67066f44293b6e27e635d7a7eb1c0c29511 Mon Sep 17 00:00:00 2001 From: kooomix Date: Mon, 3 Jun 2024 16:33:56 +0300 Subject: [PATCH] feat: Update storage class path in pv-without-encryption rule Signed-off-by: kooomix --- rules/pv-without-encryption/raw.rego | 2 +- .../test/eks/expected.json | 27 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/rules/pv-without-encryption/raw.rego b/rules/pv-without-encryption/raw.rego index 96b62c375..cc9233d9f 100644 --- a/rules/pv-without-encryption/raw.rego +++ b/rules/pv-without-encryption/raw.rego @@ -18,7 +18,7 @@ deny[msga] { "packagename": "armo_builtins", "failedPaths": [], "fixPaths": [{ - "path": "pv.spec.storageClassName", + "path": "spec.storageClassName", "value": "" }], "alertScore": 7, diff --git a/rules/pv-without-encryption/test/eks/expected.json b/rules/pv-without-encryption/test/eks/expected.json index 2654377a9..cfd549621 100644 --- a/rules/pv-without-encryption/test/eks/expected.json +++ b/rules/pv-without-encryption/test/eks/expected.json @@ -1 +1,26 @@ -[{"alertMessage":"Volume 'pvc-0eeeeefe-5193-472c-a81e-104f3919130e' has is using a storage class that does not use encryption","failedPaths":[],"fixPaths":[{"path":"pv.spec.storageClassName","value":"\u003cyour encrypted storage class\u003e"}],"ruleStatus":"","packagename":"armo_builtins","alertScore":7,"alertObject":{"k8sApiObjects":[{"apiVersion":"v1","kind":"PersistentVolume","metadata":{"name":"pvc-0eeeeefe-5193-472c-a81e-104f3919130e"}}]}}] \ No newline at end of file +[ + { + "alertMessage": "Volume 'pvc-0eeeeefe-5193-472c-a81e-104f3919130e' has is using a storage class that does not use encryption", + "failedPaths": [], + "fixPaths": [ + { + "path": "spec.storageClassName", + "value": "\u003cyour encrypted storage class\u003e" + } + ], + "ruleStatus": "", + "packagename": "armo_builtins", + "alertScore": 7, + "alertObject": { + "k8sApiObjects": [ + { + "apiVersion": "v1", + "kind": "PersistentVolume", + "metadata": { + "name": "pvc-0eeeeefe-5193-472c-a81e-104f3919130e" + } + } + ] + } + } +] \ No newline at end of file