forked from stolostron/policy-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
policy-kyverno-operator.yaml
315 lines (315 loc) · 11.9 KB
/
policy-kyverno-operator.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# This policy installs the Kyverno Admissions Controller Operator.
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: policy-kyverno-operator
annotations:
policy.open-cluster-management.io/standards: NIST SP 800-53
policy.open-cluster-management.io/categories: CM Configuration Management
policy.open-cluster-management.io/controls: CM-2 Baseline Configuration
spec:
remediationAction: inform
disabled: false
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: kyverno-subscription
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: kyverno-operator
namespace: openshift-operators
spec:
channel: alpha
installPlanApproval: Automatic
name: enterprise-kyverno
source: certified-operators
sourceNamespace: openshift-marketplace
startingCSV: enterprise-kyverno.v0.0.2
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
annotations:
policy.open-cluster-management.io/disable-templates: "true"
name: kyverno-example
spec:
remediationAction: inform
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: security.nirmata.io/v1alpha1
kind: EnterpriseKyverno
metadata:
name: enterprisekyverno
namespace: openshift-operators
spec:
antiAffinity:
enable: true
config:
annotations: {}
existingConfig: ''
generateSuccessEvents: false
metricsConfig:
annotations: {}
namespaces:
exclude: []
include: []
resourceFilters:
- '[Event,*,*]'
- '[*,kube-system,*]'
- '[*,kube-public,*]'
- '[*,kube-node-lease,*]'
- '[Node,*,*]'
- '[APIService,*,*]'
- '[TokenReview,*,*]'
- '[SubjectAccessReview,*,*]'
- '[SelfSubjectAccessReview,*,*]'
- '[Binding,*,*]'
- '[ReplicaSet,*,*]'
- '[AdmissionReport,*,*]'
- '[ClusterAdmissionReport,*,*]'
- '[BackgroundScanReport,*,*]'
- '[ClusterBackgroundScanReport,*,*]'
- '[ClusterRole,*,{{ template "kyverno.fullname" . }}:*]'
- '[ClusterRoleBinding,*,{{ template "kyverno.fullname" . }}:*]'
- >-
[ServiceAccount,{{ include "kyverno.namespace" . }},{{ template
"kyverno.serviceAccountName" . }}]
- >-
[ConfigMap,{{ include "kyverno.namespace" . }},{{ template
"kyverno.configMapName" . }}]
- >-
[ConfigMap,{{ include "kyverno.namespace" . }},{{ template
"kyverno.metricsConfigMapName" . }}]
- >-
[Deployment,{{ include "kyverno.namespace" . }},{{ template
"kyverno.fullname" . }}]
- >-
[Job,{{ include "kyverno.namespace" . }},{{ template "kyverno.fullname"
. }}-hook-pre-delete]
- >-
[NetworkPolicy,{{ include "kyverno.namespace" . }},{{ template
"kyverno.fullname" . }}]
- >-
[PodDisruptionBudget,{{ include "kyverno.namespace" . }},{{ template
"kyverno.fullname" . }}]
- >-
[Role,{{ include "kyverno.namespace" . }},{{ template "kyverno.fullname"
. }}:*]
- >-
[RoleBinding,{{ include "kyverno.namespace" . }},{{ template
"kyverno.fullname" . }}:*]
- >-
[Secret,{{ include "kyverno.namespace" . }},{{ template
"kyverno.serviceName" . }}.{{ template "kyverno.namespace" . }}.svc.*]
- >-
[Service,{{ include "kyverno.namespace" . }},{{ template
"kyverno.serviceName" . }}]
- >-
[Service,{{ include "kyverno.namespace" . }},{{ template
"kyverno.serviceName" . }}-metrics]
- >-
[ServiceMonitor,{{ if .Values.serviceMonitor.namespace }}{{
.Values.serviceMonitor.namespace }}{{ else }}{{ template
"kyverno.namespace" . }}{{ end }},{{ template "kyverno.serviceName" .
}}-service-monitor]
- >-
[Pod,{{ include "kyverno.namespace" . }},{{ template "kyverno.fullname"
. }}-test]
createSelfSignedCert: false
customLabels: {}
dnsPolicy: ClusterFirst
envVars: {}
envVarsInit: {}
excludeKyvernoNamespace: true
extraArgs:
- '--autogenInternals=true'
- '--loggingFormat=text'
extraContainers: []
extraInitContainers: []
generatecontrollerExtraResources: []
hostNetwork: false
image:
pullPolicy: IfNotPresent
pullSecrets:
create: false
name: image-pull-secret
registry: ghcr.io
repository: ghcr.io/nirmata/kyverno
tag: v1.8.1-n4kbuild.1
imagePullSecret:
create: false
name: kyverno-operator-image-pull-secret
registry: ghcr.io
imagePullSecrets: {}
initContainer:
extraArgs:
- '--loggingFormat=text'
initImage:
repository: ghcr.io/nirmata/kyvernopre
tag: v1.8.1-n4kbuild.1
initResources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 10m
memory: 64Mi
installCRDs: true
kyvernoOperatorImage: ghcr.io/nirmata/nirmata-kyverno-monitor
kyvernoOperatorImageTag: 0.1.0
livenessProbe:
failureThreshold: 2
httpGet:
path: /health/liveness
port: 9443
scheme: HTTPS
initialDelaySeconds: 15
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 5
metricsService:
annotations: {}
create: true
port: 8000
type: ClusterIP
networkPolicy:
enabled: false
ingressFrom: []
nodeAffinity: {}
nodeSelector: {}
podAffinity: {}
podAnnotations: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- kyverno
topologyKey: kubernetes.io/hostname
weight: 1
podDisruptionBudget:
minAvailable: 1
podLabels: {}
podSecurityContext: {}
priorityClassName: ''
rbac:
create: true
serviceAccount:
annotations: {}
create: true
readinessProbe:
failureThreshold: 6
httpGet:
path: /health/readiness
port: 9443
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resourceFiltersExcludeNamespaces: []
resources:
limits:
memory: 384Mi
requests:
cpu: 100m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
service:
annotations: {}
port: 443
type: ClusterIP
serviceMonitor:
enabled: false
interval: 30s
scrapeTimeout: 25s
secure: false
tlsConfig: {}
startupProbe:
failureThreshold: 12
httpGet:
path: /health/liveness
port: 9443
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 10
testImage:
repository: busybox
testResources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 10m
memory: 64Mi
testSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsGroup: 65534
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
tolerations: []
topologySpreadConstraints: []
tufRootMountPath: /.sigstore
updateStrategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 40%
type: RollingUpdate
validKyvernoImages: >-
ghcr.io/nirmata/kyverno@sha256:3b7bdd7ad2aeddb9b5ab323bb166863cb00c0977c9eede200808b5832c4a2069
webhookEnabled: false
webhooksCleanup:
enable: false
image: 'bitnami/kubectl:latest'
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: binding-policy-kyverno-operator
placementRef:
name: placement-policy-kyverno-operator
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-kyverno-operator
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-policy-kyverno-operator
spec:
clusterSelector:
matchExpressions:
- {key: environment, operator: In, values: ["dev"]}