You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/benchmark/gke/v1.1.0/4.0_policies.yml
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ categories:
12
12
environment and should be used only where and when needed.
13
13
profile_applicability: Master
14
14
audit:
15
-
- tf=/dev/stdout && kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].name
16
-
|grep cluster-admin > tf && awk '{ print $3 }' tf
15
+
- kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].name
16
+
|grep cluster-admin | awk '{ print $3 }'
17
17
remediation: |-
18
18
Identify all clusterrolebindings to the cluster-admin role. Check if they are used and if they need this role or if they could use a role with fewer privileges.
19
19
Where possible, first bind users to a lower privileged role and then remove the clusterrolebinding to the cluster-admin role :
@@ -36,8 +36,8 @@ categories:
36
36
of users to reduce the risk of privilege escalation.
37
37
profile_applicability: Master
38
38
audit:
39
-
- tf=/dev/stdout && kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].kind
40
-
|grep User > tf && awk '{ print $1 }' tf
39
+
- kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].kind
40
+
|grep User | awk '{ print $1 }'
41
41
- 'kubectl auth can-i get secrets --all-namespaces --as #0'
42
42
- kubectl auth can-i list secrets --all-namespaces --as=#0
remediation: Where possible, remove create access to pod objects in the cluster.
84
84
check_type: multi_param
@@ -141,7 +141,7 @@ categories:
141
141
flag set to true.
142
142
profile_applicability: Master
143
143
audit:
144
-
- kubectl get psp -o=custom-columns=:.metadata.name
144
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
145
145
- 'kubectl get psp #0 -o=jsonpath=''{.spec.privileged}'''
146
146
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
147
147
that the .spec.privileged field is omitted or set to false.
@@ -160,7 +160,7 @@ categories:
160
160
set to true.
161
161
profile_applicability: Master
162
162
audit:
163
-
- kubectl get psp -o=custom-columns=:.metadata.name
163
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
164
164
- 'kubectl get psp #0 -o=jsonpath=''{.spec.hostPID}'''
165
165
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
166
166
that the .spec.hostPID field is omitted or set to false.
@@ -178,7 +178,7 @@ categories:
178
178
set to true.
179
179
profile_applicability: Master
180
180
audit:
181
-
- kubectl get psp -o=custom-columns=:.metadata.name
181
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
182
182
- 'kubectl get psp #0 -o=jsonpath=''{.spec.hostIPC}'''
183
183
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
184
184
that the .spec.hostIPC field is omitted or set to false.
@@ -196,7 +196,7 @@ categories:
196
196
flag set to true.
197
197
profile_applicability: Level 1 - Master Node
198
198
audit:
199
-
- kubectl get psp -o=custom-columns=:.metadata.name
199
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
200
200
- 'kubectl get psp #0 -o=jsonpath=''{.spec.hostNetwork}'''
201
201
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
202
202
that the .spec.hostNetwork field is omitted or set to false.
@@ -214,7 +214,7 @@ categories:
214
214
flag set to true.
215
215
profile_applicability: Level 1 - Master Node
216
216
audit:
217
-
- kubectl get psp -o=custom-columns=:.metadata.name
217
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
218
218
- 'kubectl get psp #0 -o=jsonpath=''{.spec.allowPrivilegeEscalation}'''
219
219
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
220
220
that the .spec.allowPrivilegeEscalation field is omitted or set to false.
@@ -230,7 +230,7 @@ categories:
230
230
description: Do not generally permit containers to be run as the root user.
231
231
profile_applicability: Level 1 - Master Node
232
232
audit:
233
-
- kubectl get psp -o=custom-columns=:.metadata.name
233
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
234
234
- 'kubectl get psp #0 -o=jsonpath=''{.spec.runAsUser.rule}'''
235
235
remediation: Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.runAsUser.rule is set to either MustRunAsNonRoot or MustRunAs with the range of UIDs not including 0.
236
236
check_type: multi_param
@@ -244,7 +244,7 @@ categories:
244
244
description: Do not generally permit containers with the potentially dangerous NET_RAW capability.
245
245
profile_applicability: Level 1 - Master Node
246
246
audit:
247
-
- 'tfr=/dev/stdout && kubectl get psp -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
247
+
- 'tfr=/dev/stdout && kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
248
248
- 'kubectl get psp #0 -o=jsonpath=''{.spec.requiredDropCapabilities}'''
249
249
remediation: Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.requiredDropCapabilities is set to include either NET_RAW or ALL.
250
250
check_type: multi_param
@@ -259,7 +259,7 @@ categories:
259
259
description: Do not generally permit containers with capabilities assigned beyond the default set.
260
260
profile_applicability: Level 1 - Master Node
261
261
audit:
262
-
- kubectl get psp -o=custom-columns=:.metadata.name
262
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
263
263
- 'tfr3=/dev/stdout && tfr2=/dev/stdout && kubectl get psp #0 -o=jsonpath=''{.spec.allowedCapabilities}'' > tfr3 && sed ''s/"/ /g'' tfr3 > tfr2 && sed ''s/[][]//g'' tfr2'
264
264
remediation: Ensure that allowedCapabilities is not present in PSPs for the cluster unless it is set to an empty array.
265
265
check_type: multi_param
@@ -274,7 +274,7 @@ categories:
274
274
description: Do not generally permit containers with capabilities
275
275
profile_applicability: Level 1 - Master Node
276
276
audit:
277
-
- 'tfr=/dev/stdout && kubectl get psp -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
277
+
- 'tfr=/dev/stdout && kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
278
278
- 'kubectl get psp #0 -o=jsonpath=''{.spec.requiredDropCapabilities}'''
279
279
remediation: Review the use of capabilites in applications runnning on your cluster. Where a namespace contains applicaions which do not require any Linux capabities to operate consider adding a PSP which forbids the admission of containers which do not drop all capabilities.
Copy file name to clipboardExpand all lines: internal/benchmark/k8s/v1.6.0/5.0_policies.yml
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ categories:
12
12
environment and should be used only where and when needed.
13
13
profile_applicability: Master
14
14
audit:
15
-
- tf=/dev/stdout && kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].name
16
-
|grep cluster-admin > tf && awk '{ print $3 }' tf
15
+
- kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].name
16
+
|grep cluster-admin | awk '{ print $3 }'
17
17
remediation: |-
18
18
Identify all clusterrolebindings to the cluster-admin role. Check if they are used and if they need this role or if they could use a role with fewer privileges.
19
19
Where possible, first bind users to a lower privileged role and then remove the clusterrolebinding to the cluster-admin role :
@@ -36,8 +36,8 @@ categories:
36
36
of users to reduce the risk of privilege escalation.
37
37
profile_applicability: Master
38
38
audit:
39
-
- tf=/dev/stdout && kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].kind
40
-
|grep User > tf && awk '{ print $1 }' tf
39
+
- kubectl get clusterrolebindings -o=custom-columns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].kind
40
+
|grep User | awk '{ print $1 }'
41
41
- 'kubectl auth can-i get secrets --all-namespaces --as #0'
42
42
- kubectl auth can-i list secrets --all-namespaces --as=#0
remediation: Where possible, remove create access to pod objects in the cluster.
82
82
check_type: multi_param
@@ -138,7 +138,7 @@ categories:
138
138
flag set to true.
139
139
profile_applicability: Master
140
140
audit:
141
-
- kubectl get psp -o=custom-columns=:.metadata.name
141
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
142
142
- 'kubectl get psp #0 -o=jsonpath=''{.spec.privileged}'''
143
143
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
144
144
that the .spec.privileged field is omitted or set to false.
@@ -157,7 +157,7 @@ categories:
157
157
set to true.
158
158
profile_applicability: Master
159
159
audit:
160
-
- kubectl get psp -o=custom-columns=:.metadata.name
160
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
161
161
- 'kubectl get psp #0 -o=jsonpath=''{.spec.hostPID}'''
162
162
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
163
163
that the .spec.hostPID field is omitted or set to false.
@@ -175,7 +175,7 @@ categories:
175
175
set to true.
176
176
profile_applicability: Master
177
177
audit:
178
-
- kubectl get psp -o=custom-columns=:.metadata.name
178
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
179
179
- 'kubectl get psp #0 -o=jsonpath=''{.spec.hostIPC}'''
180
180
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
181
181
that the .spec.hostIPC field is omitted or set to false.
@@ -193,7 +193,7 @@ categories:
193
193
flag set to true.
194
194
profile_applicability: Level 1 - Master Node
195
195
audit:
196
-
- kubectl get psp -o=custom-columns=:.metadata.name
196
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
197
197
- 'kubectl get psp #0 -o=jsonpath=''{.spec.hostNetwork}'''
198
198
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
199
199
that the .spec.hostNetwork field is omitted or set to false.
@@ -210,7 +210,7 @@ categories:
210
210
flag set to true.
211
211
profile_applicability: Level 1 - Master Node
212
212
audit:
213
-
- kubectl get psp -o=custom-columns=:.metadata.name
213
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
214
214
- 'kubectl get psp #0 -o=jsonpath=''{.spec.allowPrivilegeEscalation}'''
215
215
remediation: Create a PSP as described in the Kubernetes documentation, ensuring
216
216
that the .spec.allowPrivilegeEscalation field is omitted or set to false.
@@ -226,7 +226,7 @@ categories:
226
226
description: Do not generally permit containers to be run as the root user.
227
227
profile_applicability: Level 1 - Master Node
228
228
audit:
229
-
- kubectl get psp -o=custom-columns=:.metadata.name
229
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
230
230
- 'kubectl get psp #0 -o=jsonpath=''{.spec.runAsUser.rule}'''
231
231
remediation: Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.runAsUser.rule is set to either MustRunAsNonRoot or MustRunAs with the range of UIDs not including 0.
232
232
check_type: multi_param
@@ -240,7 +240,7 @@ categories:
240
240
description: Do not generally permit containers with the potentially dangerous NET_RAW capability.
241
241
profile_applicability: Level 1 - Master Node
242
242
audit:
243
-
- 'tfr=/dev/stdout && kubectl get psp -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
243
+
- 'tfr=/dev/stdout && kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
244
244
- 'kubectl get psp #0 -o=jsonpath=''{.spec.requiredDropCapabilities}'''
245
245
remediation: Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.requiredDropCapabilities is set to include either NET_RAW or ALL.
246
246
check_type: multi_param
@@ -255,7 +255,7 @@ categories:
255
255
description: Do not generally permit containers with capabilities assigned beyond the default set.
256
256
profile_applicability: Level 1 - Master Node
257
257
audit:
258
-
- kubectl get psp -o=custom-columns=:.metadata.name
258
+
- kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name
259
259
- 'tfr3=/dev/stdout && tfr2=/dev/stdout && kubectl get psp #0 -o=jsonpath=''{.spec.allowedCapabilities}'' > tfr3 && sed ''s/"/ /g'' tfr3 > tfr2 && sed ''s/[][]//g'' tfr2'
260
260
remediation: Ensure that allowedCapabilities is not present in PSPs for the cluster unless it is set to an empty array.
261
261
check_type: multi_param
@@ -270,7 +270,7 @@ categories:
270
270
description: Do not generally permit containers with capabilities
271
271
profile_applicability: Level 1 - Master Node
272
272
audit:
273
-
- 'tfr=/dev/stdout && kubectl get psp -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
273
+
- 'tfr=/dev/stdout && kubectl get psp 2> /dev/null -o=custom-columns=:.metadata.name > tfr && sed '':a;N;$!ba;s/\n/ /g'' tfr'
274
274
- 'kubectl get psp #0 -o=jsonpath=''{.spec.requiredDropCapabilities}'''
275
275
remediation: Review the use of capabilites in applications runnning on your cluster. Where a namespace contains applicaions which do not require any Linux capabities to operate consider adding a PSP which forbids the admission of containers which do not drop all capabilities.
0 commit comments