diff options
author | 2019-09-17 17:09:37 +0200 | |
---|---|---|
committer | 2019-09-19 15:14:01 +0200 | |
commit | d515af5c7bddbbe3bebf3a6288fb3e43b234719a (patch) | |
tree | 2a2cc7e5aa9935ade0d10062ebf8d2c454bd6433 /test/security/k8s/src/check/validators/master/api.go | |
parent | a15076ddf4a07a05e03934939112cf011414d514 (diff) |
k8s: Validate API server not excluded authorization mode
This patch verifies if CIS Kubernetes Benchmark v1.3.0 section
regarding master node configuration is satisfied (1.1.19).
Issue-ID: SECCOM-235
Change-Id: I00c9600fd0d351afb7141a5fa16f348eab67b12d
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'test/security/k8s/src/check/validators/master/api.go')
-rw-r--r-- | test/security/k8s/src/check/validators/master/api.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/security/k8s/src/check/validators/master/api.go b/test/security/k8s/src/check/validators/master/api.go index dc22e35f6..47a2a8e01 100644 --- a/test/security/k8s/src/check/validators/master/api.go +++ b/test/security/k8s/src/check/validators/master/api.go @@ -247,3 +247,9 @@ func hasFlagArgumentIncluded(flag string, argument string, params []string) bool } return false } + +// IsAlwaysAllowAuthorizationModeExcluded validates AlwaysAllow is excluded from admission control plugins. +func IsAlwaysAllowAuthorizationModeExcluded(params []string) bool { + return isSingleFlagPresent("--authorization-mode=", params) && + !hasFlagArgumentIncluded("--authorization-mode=", "AlwaysAllow", params) +} |