aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-09-30 15:27:43 +0200
committerDaniel Rose <dr695h@att.com>2019-10-01 13:22:20 +0000
commitd52717dc912d26b4dc17ae1563ab994a919f8152 (patch)
treea5fb2f8302a1e93858ffa754274dc75d8a783814 /test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go
parentf8229d0f2249302879225f03a77b54be6cf43e82 (diff)
k8s: Validate controller manager flags requiring specific values
This patch verifies if CIS Kubernetes Benchmark v1.3.0 sections regarding master node configuration are satisfied (1.3.2 - 1.3.3 and 1.3.6). Issue-ID: SECCOM-235 Change-Id: I9c2921faf40ad9445e983f2b9bd0610e556cfe15 Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go')
-rw-r--r--test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go b/test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go
index 85ab28564..f1dd0fe49 100644
--- a/test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go
+++ b/test/security/k8s/src/check/validators/master/controllermanager/controllermanager.go
@@ -5,6 +5,21 @@ import (
"check/validators/master/boolean"
)
+// IsProfilingDisabled validates there is single "--profiling" flag and it is set to "false".
+func IsProfilingDisabled(params []string) bool {
+ return args.HasSingleFlagArgument("--profiling=", "false", params)
+}
+
+// IsUseServiceAccountCredentialsEnabled validates there is single "--use-service-account-credentials" flag and it is set to "true".
+func IsUseServiceAccountCredentialsEnabled(params []string) bool {
+ return args.HasSingleFlagArgument("--use-service-account-credentials=", "true", params)
+}
+
+// IsRotateKubeletServerCertificateIncluded validates RotateKubeletServerCertificate=true is included.
+func IsRotateKubeletServerCertificateIncluded(params []string) bool {
+ return args.HasFlagArgumentIncluded("--feature-gates=", "RotateKubeletServerCertificate=true", params)
+}
+
// IsInsecureBindAddressAbsentOrLoopback validates there is no insecure bind address or it is loopback address.
func IsInsecureBindAddressAbsentOrLoopback(params []string) bool {
return boolean.IsFlagAbsent("--address=", params) ||