From 8b28919a879a150706fd1898608291ccec14f250 Mon Sep 17 00:00:00 2001 From: Meital Rudnitsky Date: Tue, 3 Oct 2023 12:08:49 +0300 Subject: [PATCH] fix rule naming convention Signed-off-by: Meital Rudnitsky --- ControlID_RuleName.csv | 2 +- controls/C-0077-k8scommonlabelsusage.json | 2 +- .../raw.rego | 0 .../rule.metadata.json | 2 +- .../test/cronjob/expected.json | 0 .../test/cronjob/input/cronjob.yaml | 0 .../test/pod/expected.json | 0 .../test/pod/input/pod.yaml | 0 .../test/workload-fail/expected.json | 0 .../test/workload-fail/input/deployment.yaml | 0 .../test/workload/expected.json | 0 .../test/workload/input/deployment.yaml | 0 12 files changed, 3 insertions(+), 3 deletions(-) rename rules/{K8s common labels usage => k8s-common-labels-usage}/raw.rego (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/rule.metadata.json (97%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/cronjob/expected.json (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/cronjob/input/cronjob.yaml (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/pod/expected.json (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/pod/input/pod.yaml (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/workload-fail/expected.json (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/workload-fail/input/deployment.yaml (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/workload/expected.json (100%) rename rules/{K8s common labels usage => k8s-common-labels-usage}/test/workload/input/deployment.yaml (100%) diff --git a/ControlID_RuleName.csv b/ControlID_RuleName.csv index dee396dae..51235bb80 100644 --- a/ControlID_RuleName.csv +++ b/ControlID_RuleName.csv @@ -69,7 +69,7 @@ C-0073,naked-pods C-0074,containers-mounting-docker-socket C-0075,image-pull-policy-is-not-set-to-always C-0076,label-usage-for-resources -C-0077,K8s common labels usage +C-0077,k8s-common-labels-usage C-0078,container-image-repository C-0079,CVE-2022-0185 C-0081,CVE-2022-24348 diff --git a/controls/C-0077-k8scommonlabelsusage.json b/controls/C-0077-k8scommonlabelsusage.json index a4ed375d9..d3645ac56 100644 --- a/controls/C-0077-k8scommonlabelsusage.json +++ b/controls/C-0077-k8scommonlabelsusage.json @@ -10,7 +10,7 @@ "description": "Kubernetes common labels help manage and monitor Kubernetes cluster using different tools such as kubectl, dashboard and others in an interoperable way. Refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ for more information. This control helps you find objects that don't have any of these labels defined.", "remediation": "Define applicable labels or use the exception mechanism to prevent further notifications.", "rulesNames": [ - "K8s common labels usage" + "k8s-common-labels-usage" ], "long_description": "Kubernetes common labels help manage and monitor Kubernetes cluster using different tools such as kubectl, dashboard and others in an interoperable way. Refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ for more information. This control helps you find objects that don't have any of these labels defined.", "test": "Test will check if the list of label that start with app.kubernetes.io/ are defined.", diff --git a/rules/K8s common labels usage/raw.rego b/rules/k8s-common-labels-usage/raw.rego similarity index 100% rename from rules/K8s common labels usage/raw.rego rename to rules/k8s-common-labels-usage/raw.rego diff --git a/rules/K8s common labels usage/rule.metadata.json b/rules/k8s-common-labels-usage/rule.metadata.json similarity index 97% rename from rules/K8s common labels usage/rule.metadata.json rename to rules/k8s-common-labels-usage/rule.metadata.json index 609c361c7..4dbfbd4a4 100644 --- a/rules/K8s common labels usage/rule.metadata.json +++ b/rules/k8s-common-labels-usage/rule.metadata.json @@ -1,5 +1,5 @@ { - "name": "K8s common labels usage", + "name": "k8s-common-labels-usage", "attributes": { "armoBuiltin": true }, diff --git a/rules/K8s common labels usage/test/cronjob/expected.json b/rules/k8s-common-labels-usage/test/cronjob/expected.json similarity index 100% rename from rules/K8s common labels usage/test/cronjob/expected.json rename to rules/k8s-common-labels-usage/test/cronjob/expected.json diff --git a/rules/K8s common labels usage/test/cronjob/input/cronjob.yaml b/rules/k8s-common-labels-usage/test/cronjob/input/cronjob.yaml similarity index 100% rename from rules/K8s common labels usage/test/cronjob/input/cronjob.yaml rename to rules/k8s-common-labels-usage/test/cronjob/input/cronjob.yaml diff --git a/rules/K8s common labels usage/test/pod/expected.json b/rules/k8s-common-labels-usage/test/pod/expected.json similarity index 100% rename from rules/K8s common labels usage/test/pod/expected.json rename to rules/k8s-common-labels-usage/test/pod/expected.json diff --git a/rules/K8s common labels usage/test/pod/input/pod.yaml b/rules/k8s-common-labels-usage/test/pod/input/pod.yaml similarity index 100% rename from rules/K8s common labels usage/test/pod/input/pod.yaml rename to rules/k8s-common-labels-usage/test/pod/input/pod.yaml diff --git a/rules/K8s common labels usage/test/workload-fail/expected.json b/rules/k8s-common-labels-usage/test/workload-fail/expected.json similarity index 100% rename from rules/K8s common labels usage/test/workload-fail/expected.json rename to rules/k8s-common-labels-usage/test/workload-fail/expected.json diff --git a/rules/K8s common labels usage/test/workload-fail/input/deployment.yaml b/rules/k8s-common-labels-usage/test/workload-fail/input/deployment.yaml similarity index 100% rename from rules/K8s common labels usage/test/workload-fail/input/deployment.yaml rename to rules/k8s-common-labels-usage/test/workload-fail/input/deployment.yaml diff --git a/rules/K8s common labels usage/test/workload/expected.json b/rules/k8s-common-labels-usage/test/workload/expected.json similarity index 100% rename from rules/K8s common labels usage/test/workload/expected.json rename to rules/k8s-common-labels-usage/test/workload/expected.json diff --git a/rules/K8s common labels usage/test/workload/input/deployment.yaml b/rules/k8s-common-labels-usage/test/workload/input/deployment.yaml similarity index 100% rename from rules/K8s common labels usage/test/workload/input/deployment.yaml rename to rules/k8s-common-labels-usage/test/workload/input/deployment.yaml