-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.sh
executable file
·38 lines (32 loc) · 922 Bytes
/
master.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# ------------------------------------------------------------------------------
# Kubenetes CIS benchmark
#
# Neuvector, Inc. (c) 2016-
#
# ------------------------------------------------------------------------------
CIS_APISERVER_CMD=${CIS_APISERVER_CMD:-kube-apiserver}
CIS_MANAGER_CMD=${CIS_MANAGER_CMD:-kube-controller-manager}
CIS_SCHEDULER_CMD=${CIS_SCHEDULER_CMD:-kube-scheduler}
CIS_ETCD_CMD=${CIS_ETCD_CMD:-etcd}
# Load dependencies
. ./helper.sh
ver=$1
if [ -z "$1" ]; then
warn "usage: ./master.sh version"
exit
fi
# Check for required program(s)
req_progs='awk grep pgrep sed kubectl'
for p in $req_progs; do
command -v "$p" >/dev/null 2>&1 || { printf "%s command not found.\n" "$p"; exit 1; }
done
# Load all the tests from master/ and run them
main () {
info "1 - Master Node Security Configuration"
for test in $ver/master/master_*.sh
do
. ./"$test"
done
}
main "$@"