From f701195d503a80e492b67646f48dad12ed6b73a1 Mon Sep 17 00:00:00 2001 From: jdesouza Date: Tue, 12 Nov 2024 13:52:58 -0300 Subject: [PATCH] Added another chec --- pkg/validator/pod_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/validator/pod_test.go b/pkg/validator/pod_test.go index 8fa0cc1f8..0187a3803 100644 --- a/pkg/validator/pod_test.go +++ b/pkg/validator/pod_test.go @@ -33,7 +33,7 @@ func TestValidatePod(t *testing.T) { "hostPIDSet": conf.SeverityDanger, "hostNetworkSet": conf.SeverityWarning, "hostPortSet": conf.SeverityDanger, - "hostPathSet": conf.SeverityDanger, + "hostPathSet": conf.SeverityWarning, "procMount": conf.SeverityWarning, }, } @@ -51,7 +51,7 @@ func TestValidatePod(t *testing.T) { "hostIPCSet": {ID: "hostIPCSet", Message: "Host IPC is not configured", Success: true, Severity: "danger", Category: "Security"}, "hostNetworkSet": {ID: "hostNetworkSet", Message: "Host network is not configured", Success: true, Severity: "warning", Category: "Security"}, "hostPIDSet": {ID: "hostPIDSet", Message: "Host PID is not configured", Success: true, Severity: "danger", Category: "Security"}, - "hostPathSet": {ID: "hostPathSet", Message: "HostPath volumes are not configured", Success: true, Severity: "danger", Category: "Security"}, + "hostPathSet": {ID: "hostPathSet", Message: "HostPath volumes are not configured", Success: true, Severity: "warning", Category: "Security"}, "procMount": {ID: "procMount", Message: "The default /proc masks are set up to reduce attack surface, and should be required", Success: true, Severity: "warning", Category: "Security"}, } @@ -72,7 +72,7 @@ func TestInvalidIPCPod(t *testing.T) { "hostPIDSet": conf.SeverityDanger, "hostNetworkSet": conf.SeverityWarning, "hostPortSet": conf.SeverityDanger, - "hostPathSet": conf.SeverityDanger, + "hostPathSet": conf.SeverityWarning, "procMount": conf.SeverityWarning, }, } @@ -96,14 +96,14 @@ func TestInvalidIPCPod(t *testing.T) { assert.NoError(t, err) expectedSum := CountSummary{ Successes: uint(3), - Warnings: uint(1), - Dangers: uint(2), + Warnings: uint(2), + Dangers: uint(1), } expectedResults := ResultSet{ "hostIPCSet": {ID: "hostIPCSet", Message: "Host IPC should not be configured", Success: false, Severity: "danger", Category: "Security"}, "hostNetworkSet": {ID: "hostNetworkSet", Message: "Host network is not configured", Success: true, Severity: "warning", Category: "Security"}, "hostPIDSet": {ID: "hostPIDSet", Message: "Host PID is not configured", Success: true, Severity: "danger", Category: "Security"}, - "hostPathSet": {ID: "hostPathSet", Message: "HostPath volumes must be forbidden", Success: false, Severity: "danger", Category: "Security"}, + "hostPathSet": {ID: "hostPathSet", Message: "HostPath volumes must be forbidden", Success: false, Severity: "warning", Category: "Security"}, "procMount": {ID: "procMount", Message: "Proc mount must not be changed from the default", Success: false, Severity: "warning", Category: "Security"}, }