Skip to content

Commit ca8743c

Browse files
authored
add support VMware Tanzu(TKGI) Benchmarks v1.2.53 (#1452)
* add Support VMware Tanzu(TKGI) Benchmarks v1.2.53 with this change, we are adding 1. latest kubernetes cis benchmarks for VMware Tanzu1.2.53 2. logic to kube-bench so that kube-bench can auto detect vmware platform, will be able to execute the respective vmware tkgi compliance checks. 3. job-tkgi.yaml file to run the benchmark as a job in tkgi cluster Reference Document for checks: https://network.pivotal.io/products/p-compliance-scanner/#/releases/1248397 * add Support VMware Tanzu(TKGI) Benchmarks v1.2.53 with this change, we are adding 1. latest kubernetes cis benchmarks for VMware Tanzu1.2.53 2. logic to kube-bench so that kube-bench can auto detect vmware platform, will be able to execute the respective vmware tkgi compliance checks. 3. job-tkgi.yaml file to run the benchmark as a job in tkgi cluster Reference Document for checks: https://network.pivotal.io/products/p-compliance-scanner/#/releases/1248397
1 parent 84f80b5 commit ca8743c

File tree

11 files changed

+2073
-1
lines changed

11 files changed

+2073
-1
lines changed

cfg/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ version_mapping:
270270
"aks-1.0": "aks-1.0"
271271
"ack-1.0": "ack-1.0"
272272
"cis-1.6-k3s": "cis-1.6-k3s"
273+
"tkgi-1.2.53": "tkgi-1.2.53"
273274

274275
target_mapping:
275276
"cis-1.5":
@@ -372,3 +373,9 @@ target_mapping:
372373
- "controlplane"
373374
- "policies"
374375
- "managedservices"
376+
"tkgi-1.2.53":
377+
- "master"
378+
- "etcd"
379+
- "controlplane"
380+
- "node"
381+
- "policies"

cfg/tkgi-1.2.53/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
## Version-specific settings that override the values in cfg/config.yaml

cfg/tkgi-1.2.53/controlplane.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
controls:
3+
version: "tkgi-1.2.53"
4+
id: 3
5+
text: "Control Plane Configuration"
6+
type: "controlplane"
7+
groups:
8+
- id: 3.1
9+
text: "Authentication and Authorization"
10+
checks:
11+
- id: 3.1.1
12+
text: "Client certificate authentication should not be used for users"
13+
audit: ps -ef | grep kube-apiserver | grep -- "--oidc-issuer-url="
14+
type: "manual"
15+
remediation: |
16+
Alternative mechanisms provided by Kubernetes such as the use of OIDC should be
17+
implemented in place of client certificates.
18+
Exception
19+
This setting is site-specific. It can be set in the "Configure created clusters to use UAA as the OIDC provider."
20+
section of the "UAA"
21+
scored: false
22+
23+
- id: 3.2
24+
text: "Logging"
25+
checks:
26+
- id: 3.2.1
27+
text: "Ensure that a minimal audit policy is created"
28+
audit: ps -ef | grep kube-apiserver | grep -v tini | grep -- "--audit-policy-file="
29+
tests:
30+
test_items:
31+
- flag: "--audit-policy-file"
32+
remediation: |
33+
Create an audit policy file for your cluster.
34+
scored: true
35+
36+
- id: 3.2.2
37+
text: "Ensure that the audit policy covers key security concerns"
38+
audit: |
39+
diff /var/vcap/jobs/kube-apiserver/config/audit_policy.yml \ <(echo "--- apiVersion: audit.k8s.io/v1beta1 kind:
40+
Policy rules: - level: None resources: - group: '' resources: - endpoints - services - services/status users: -
41+
system:kube-proxy verbs: - watch - level: None resources: - group: '' resources: - nodes - nodes/status users: -
42+
kubelet verbs: - get - level: None resources: - group: '' resources: - nodes - nodes/status userGroups: -
43+
system:nodes verbs: - get - level: None namespaces: - kube-system resources: - group: '' resources: -
44+
endpoints users: - system:kube-controller-manager - system:kube-scheduler - system:serviceaccount:kube-
45+
system:endpoint-controller verbs: - get - update - level: None resources: - group: '' resources: - namespaces -
46+
namespaces/status - namespaces/finalize users: - system:apiserver verbs: - get - level: None resources: -
47+
group: metrics.k8s.io users: - system:kube-controller-manager verbs: - get - list - level: None
48+
nonResourceURLs: - \"/healthz*\" - \"/version\" - \"/swagger*\" - level: None resources: - group: '' resources: -
49+
events - level: Request omitStages: - RequestReceived resources: - group: '' resources: - nodes/status -
50+
pods/status userGroups: - system:nodes verbs: - update - patch - level: Request omitStages: -
51+
RequestReceived users: - system:serviceaccount:kube-system:namespace-controller verbs: - deletecollection -
52+
level: Metadata omitStages: - RequestReceived resources: - group: '' resources: - secrets - configmaps - group:
53+
authentication.k8s.io resources: - tokenreviews - level: Request omitStages: - RequestReceived resources: -
54+
group: '' - group: admissionregistration.k8s.io - group: apiextensions.k8s.io - group: apiregistration.k8s.io -
55+
group: apps - group: authentication.k8s.io - group: authorization.k8s.io - group: autoscaling - group: batch -
56+
group: certificates.k8s.io - group: extensions - group: metrics.k8s.io - group: networking.k8s.io - group: policy -
57+
group: rbac.authorization.k8s.io - group: settings.k8s.io - group: storage.k8s.io verbs: - get - list - watch - level:
58+
RequestResponse omitStages: - RequestReceived resources: - group: '' - group: admissionregistration.k8s.io -
59+
group: apiextensions.k8s.io - group: apiregistration.k8s.io - group: apps - group: authentication.k8s.io - group:
60+
authorization.k8s.io - group: autoscaling - group: batch - group: certificates.k8s.io - group: extensions - group:
61+
metrics.k8s.io - group: networking.k8s.io - group: policy - group: rbac.authorization.k8s.io - group:
62+
settings.k8s.io - group: storage.k8s.io - level: Metadata omitStages: - RequestReceived ")
63+
type: "manual"
64+
remediation: |
65+
Consider modification of the audit policy in use on the cluster to include these items, at a
66+
minimum.
67+
scored: false

cfg/tkgi-1.2.53/etcd.yaml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
controls:
3+
version: "tkgi-1.2.53"
4+
id: 2
5+
text: "Etcd Node Configuration"
6+
type: "etcd"
7+
groups:
8+
- id: 2
9+
text: "Etcd Node Configuration Files"
10+
checks:
11+
- id: 2.1
12+
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate"
13+
audit: ps -ef | grep etcd | grep -- "--cert-file=/var/vcap/jobs/etcd/config/etcd.crt" | grep -- "--key-file=/var/vcap/jobs/etcd/config/etcd.key"
14+
type: manual
15+
tests:
16+
bin_op: and
17+
test_items:
18+
- flag: "--cert-file"
19+
- flag: "--key-file"
20+
remediation: |
21+
Follow the etcd service documentation and configure TLS encryption.
22+
Then, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml
23+
on the master node and set the below parameters.
24+
--cert-file=</path/to/ca-file>
25+
--key-file=</path/to/key-file>
26+
scored: false
27+
28+
- id: 2.2
29+
text: "Ensure that the --client-cert-auth argument is set to true"
30+
audit: ps -ef | grep etcd | grep -- "--client\-cert\-auth"
31+
tests:
32+
test_items:
33+
- flag: "--client-cert-auth"
34+
compare:
35+
op: eq
36+
value: true
37+
remediation: |
38+
Edit the etcd pod specification file etcd config on the master
39+
node and set the below parameter.
40+
--client-cert-auth="true"
41+
scored: true
42+
43+
- id: 2.3
44+
text: "Ensure that the --auto-tls argument is not set to true"
45+
audit: ps -ef | grep etcd | grep -v -- "--auto-tls"
46+
tests:
47+
test_items:
48+
- flag: "--auto-tls"
49+
compare:
50+
op: eq
51+
value: true
52+
set: false
53+
remediation: |
54+
Edit the etcd pod specification file etcd config on the master
55+
node and either remove the --auto-tls parameter or set it to false.
56+
--auto-tls=false
57+
scored: true
58+
59+
- id: 2.4
60+
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate"
61+
audit: ps -ef | grep etcd | grep -- "--peer-cert-file=/var/vcap/jobs/etcd/config/peer.crt" | grep -- "--peer-key-file=/var/vcap/jobs/etcd/config/peer.key"
62+
type: manual
63+
tests:
64+
bin_op: and
65+
test_items:
66+
- flag: "--peer-cert-file"
67+
- flag: "--peer-key-file"
68+
remediation: |
69+
Follow the etcd service documentation and configure peer TLS encryption as appropriate
70+
for your etcd cluster.
71+
Then, edit the etcd pod specification file etcd config on the
72+
master node and set the below parameters.
73+
--peer-client-file=</path/to/peer-cert-file>
74+
--peer-key-file=</path/to/peer-key-file>
75+
scored: false
76+
77+
- id: 2.5
78+
text: "Ensure that the --peer-client-cert-auth argument is set to true"
79+
audit: ps -ef | grep etcd | grep -- "--peer\-client\-cert\-auth"
80+
tests:
81+
test_items:
82+
- flag: "--peer-client-cert-auth"
83+
compare:
84+
op: eq
85+
value: true
86+
remediation: |
87+
Edit the etcd pod specification file etcd config on the master
88+
node and set the below parameter.
89+
--peer-client-cert-auth=true
90+
scored: true
91+
92+
- id: 2.6
93+
text: "Ensure that the --peer-auto-tls argument is not set to true"
94+
audit: ps -ef | grep etcd | grep -v -- "--peer-auto-tls"
95+
tests:
96+
test_items:
97+
- flag: "--peer-auto-tls"
98+
compare:
99+
op: eq
100+
value: true
101+
set: false
102+
remediation: |
103+
Edit the etcd pod specification file etcd config on the master
104+
node and either remove the --peer-auto-tls parameter or set it to false.
105+
--peer-auto-tls=false
106+
scored: true
107+
108+
- id: 2.7
109+
text: "Ensure that a unique Certificate Authority is used for etcd"
110+
audit: diff /var/vcap/jobs/kube-apiserver/config/kubernetes-ca.pem /var/vcap/jobs/etcd/config/etcd-ca.crt | grep -c"^>" | grep -v "^0$"
111+
type: manual
112+
tests:
113+
test_items:
114+
- flag: "--trusted-ca-file"
115+
remediation: |
116+
Follow the etcd documentation and create a dedicated certificate authority setup for the
117+
etcd service.
118+
Then, edit the etcd pod specification file etcd config on the
119+
master node and set the below parameter.
120+
--trusted-ca-file=</path/to/ca-file>
121+
scored: false

0 commit comments

Comments
 (0)