Skip to content

Commit 76804bf

Browse files
authored
feat: add cis benchmark for gke v1.8.0 (#1958)
* add cis benchmark for gke v1.8.0 * fix linter error * fix checks for managed services
1 parent 014ac45 commit 76804bf

File tree

9 files changed

+1302
-1
lines changed

9 files changed

+1302
-1
lines changed

cfg/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ version_mapping:
295295
"gke-1.0": "gke-1.0"
296296
"gke-1.2.0": "gke-1.2.0"
297297
"gke-1.6.0": "gke-1.6.0"
298+
"gke-1.8.0": "gke-1.8.0"
298299
"ocp-3.10": "rh-0.7"
299300
"ocp-3.11": "rh-0.7"
300301
"ocp-4.0": "rh-1.0"
@@ -408,6 +409,12 @@ target_mapping:
408409
- "controlplane"
409410
- "policies"
410411
- "managedservices"
412+
"gke-1.8.0":
413+
- "master"
414+
- "node"
415+
- "controlplane"
416+
- "policies"
417+
- "managedservices"
411418
"eks-1.0.1":
412419
- "master"
413420
- "node"

cfg/gke-1.8.0/config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
## Version-specific settings that override the values in cfg/config.yaml
3+
4+
node:
5+
proxy:
6+
defaultkubeconfig: "/var/lib/kubelet/kubeconfig"
7+
8+
kubelet:
9+
defaultconf: "/etc/kubernetes/kubelet-config.yaml"

cfg/gke-1.8.0/controlplane.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
controls:
3+
version: "gke-1.8.0"
4+
id: 2
5+
text: "Control Plane Configuration"
6+
type: "controlplane"

cfg/gke-1.8.0/managedservices.yaml

Lines changed: 719 additions & 0 deletions
Large diffs are not rendered by default.

cfg/gke-1.8.0/master.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
controls:
3+
version: "gke-1.8.0"
4+
id: 1
5+
text: "Control Plane Components"
6+
type: "master"

cfg/gke-1.8.0/node.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
controls:
3+
version: "gke-1.8.0"
4+
id: 3
5+
text: "Worker Nodes"
6+
type: "node"
7+
groups:
8+
- id: 3.1
9+
text: "Worker Node Configuration Files"
10+
checks:
11+
- id: 3.1.1
12+
text: "Ensure that the kubeconfig file permissions are set to 644 or more restrictive (Automated)"
13+
audit: '/bin/sh -c ''if test -e $proxykubeconfig; then stat -c permissions=%a $proxykubeconfig; fi'' '
14+
tests:
15+
test_items:
16+
- flag: "permissions"
17+
compare:
18+
op: bitmask
19+
value: "644"
20+
remediation: |
21+
Run the below command (based on the file location on your system) on each worker node.
22+
For example,
23+
24+
chmod 644 $proxykubeconfig
25+
scored: true
26+
27+
- id: 3.1.2
28+
text: "Ensure that the kubelet kubeconfig file ownership is set to root:root (Automated)"
29+
audit: '/bin/sh -c ''if test -e $proxykubeconfig; then stat -c %U:%G $proxykubeconfig; fi'' '
30+
tests:
31+
test_items:
32+
- flag: root:root
33+
remediation: |
34+
Run the below command (based on the file location on your system) on each worker node.
35+
For example:
36+
37+
chown root:root $proxykubeconfig
38+
scored: true
39+
40+
- id: 3.1.3
41+
text: "Ensure that the kubelet configuration file has permissions set to 644 (Automated)"
42+
audit: '/bin/sh -c ''if test -e $kubeletconf; then stat -c permissions=%a $kubeletconf; fi'' '
43+
tests:
44+
test_items:
45+
- flag: "permissions"
46+
compare:
47+
op: bitmask
48+
value: "644"
49+
remediation: |
50+
Run the following command (using the kubelet config file location)
51+
52+
chmod 644 $kubeletconf
53+
scored: true
54+
55+
- id: 3.1.4
56+
text: "Ensure that the kubelet configuration file ownership is set to root:root (Automated)"
57+
audit: '/bin/sh -c ''if test -e $kubeletconf; then stat -c %U:%G $kubeletconf; fi'' '
58+
tests:
59+
test_items:
60+
- flag: root:root
61+
remediation: |
62+
Run the following command (using the config file location identied in the Audit step)
63+
64+
chown root:root $kubeletconf
65+
scored: true

0 commit comments

Comments
 (0)