-
Notifications
You must be signed in to change notification settings - Fork 8
/
managedk8s.yaml
253 lines (253 loc) · 7.58 KB
/
managedk8s.yaml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
providers: # contains information about known providers
- id: managedk8s # unique provider identifier
name: "Managed Kubernetes" # user friendly name of the provider
metadata:
foo: bar
args:
# additionalOpsPodLabels: # pod labels that will be added to diki ops pods
# foo: bar
kubeconfigPath: /tmp/kubeconfig.config # path to cluster admin kubeconfig
rulesets:
- id: disa-kubernetes-stig
name: DISA Kubernetes Security Technical Implementation Guide
version: v2r1
# args:
# maxRetries: 1 # number of maximum rule run retries. Defaults to 1
ruleOptions:
# - ruleID: "242376"
# skip:
# enabled: true
# justification: "the whole rule is accepted for ... reasons"
# - ruleID: "242383"
# args:
# acceptedResources:
# - apiVersion: "v1"
# # if set to "*" match all kinds
# kind: "Pod"
# matchLabels:
# foo: bar
# # only pods in namespaces ["default", "kube-public", "kube-node-lease"] are meaningful to be selected with namespaceMatchLabels
# # since the rule does not perform checks on objects in namespaces different from the listed above
# namespaceMatchLabels:
# kubernetes.io/metadata.name: default
# justification: "justification"
# # relates to the result status in the report
# # can be set to Passed or Accepted. Defaults to Accepted
# status: Passed
# - ruleID: "242393"
# args:
# # Diki will group nodes by the value of this label
# # and perform the rule checks on a single node from each group.
# # Skip these labels if you want diki
# # to perform checks on all nodes in the cluster.
# # Mind that not providing a set of labels to group by
# # can slow down the execution of the ruleset and spawn
# # additional pods in the cluster.
# nodeGroupByLabels:
# - foo
# - ruleID: "242394"
# args:
# nodeGroupByLabels:
# - foo
# - ruleID: "242396"
# args:
# nodeGroupByLabels:
# - foo
# - ruleID: "242400"
# args:
# kubeProxyDisabled: true
# kubeProxyMatchLabels:
# foo: bar
# - ruleID: "242404"
# args:
# nodeGroupByLabels:
# - foo
# - ruleID: "242406"
# args:
# # Node labels used to group nodes by specified
# # label value combinations. Only one node per
# # combination will be tested
# nodeGroupByLabels:
# - foo
# expectedFileOwner:
# users: ["0"]
# groups: ["0"]
# - ruleID: "242407"
# args:
# nodeGroupByLabels:
# - foo
# - ruleID: "242414"
# args:
# acceptedPods:
# - podMatchLabels:
# label: foo
# namespaceMatchLabels:
# label: foo
# justification: "justification"
# ports:
# - 53
# - ruleID: "242415"
# args:
# acceptedPods:
# - podMatchLabels:
# label: foo
# namespaceMatchLabels:
# label: foo
# justification: "justification"
# environmentVariables:
# - FOO_BAR
# - ruleID: "242417"
# args:
# acceptedPods:
# - podMatchLabels:
# foo: bar
# # only pods in namespaces ["kube-system", "kube-public", "kube-node-lease"] are meaningful to be selected with namespaceMatchLabels
# # since the rule does not perform checks on objects in namespaces different from the listed above
# namespaceMatchLabels:
# kubernetes.io/metadata.name: kube-system
# justification: "justification"
# # relates to the result status in the report
# # can be set to Passed or Accepted. Defaults to Accepted
# status: Passed
# - ruleID: "242442"
# args:
# kubeProxyMatchLabels:
# foo: bar
# - ruleID: "242447"
# args:
# kubeProxyMatchLabels:
# foo: bar
# - ruleID: "242448"
# args:
# kubeProxyMatchLabels:
# foo: bar
# expectedFileOwner:
# users: ["0"]
# groups: ["0"]
# - ruleID: "242449"
# args:
# nodeGroupByLabels:
# - foo
# - ruleID: "242450"
# args:
# nodeGroupByLabels:
# - foo
# expectedFileOwner:
# users: ["0"]
# groups: ["0"]
# - ruleID: "242451"
# args:
# kubeProxyDisabled: true
# kubeProxyMatchLabels:
# foo: bar
# nodeGroupByLabels:
# - foo
# expectedFileOwner:
# users: ["0"]
# groups: ["0"]
# - ruleID: "242452"
# args:
# nodeGroupByLabels:
# - foo
# - ruleID: "242453"
# args:
# nodeGroupByLabels:
# - foo
# expectedFileOwner:
# users: ["0"]
# groups: ["0"]
# - ruleID: "242466"
# args:
# kubeProxyDisabled: true # skip kube-proxy check
# kubeProxyMatchLabels:
# foo: bar
# nodeGroupByLabels:
# - foo
# - ruleID: "242467"
# args:
# kubeProxyDisabled: true # skip kube-proxy check
# kubeProxyMatchLabels:
# foo: bar
# nodeGroupByLabels:
# - foo
- id: security-hardened-k8s
name: Security Hardened Kubernetes Cluster
version: v0.1.0
ruleOptions:
# - ruleID: "2000"
# skip:
# enabled: true
# justification: "the whole rule is accepted for ... reasons"
# - ruleID: "2001"
# args:
# acceptedPods:
# - matchLabels:
# foo: bar
# namespaceMatchLabels:
# foo: bar
# justification: "justification"
# - ruleID: "2003"
# args:
# acceptedPods:
# - matchLabels:
# foo: bar
# namespaceMatchLabels:
# foo: bar
# justification: "justification"
# volumeNames:
# - "volume-a"
# - "volume-b"
# - ruleID: "2004"
# args:
# acceptedServices:
# - matchLabels:
# foo: bar
# namespaceMatchLabels:
# foo: bar
# justification: "justification"
# - ruleID: "2005"
# args:
# allowedImages:
# - prefix: "example.foo.repository/organisation/releases/"
# - ruleID: "2006"
# args:
# acceptedRoles:
# - matchLabels:
# foo: bar
# namespaceMatchLabels:
# foo: bar
# justification: "justification"
# acceptedClusterRoles:
# - matchLabels:
# foo: bar
# justification: "justification"
# - ruleID: "2007"
# args:
# acceptedRoles:
# - matchLabels:
# foo: bar
# namespaceMatchLabels:
# foo: bar
# justification: "justification"
# acceptedClusterRoles:
# - matchLabels:
# foo: bar
# justification: "justification"
# - ruleID: "2008"
# args:
# acceptedPods:
# - matchLabels:
# foo: bar
# namespaceMatchLabels:
# foo: bar
# justification: "justification"
# volumeNames:
# - "volume-a"
# - "volume-b"
# metadata: # optional, additional metadata to be added to summary json report
# foo: bar
# bar:
# foo: bar
output:
path: /tmp/test-output.json # optional, path to summary json report. If --output flag is set this configuration is ignored
minStatus: Passed