forked from open-cluster-management-io/policy-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
policy-integrity-shield.yaml
688 lines (674 loc) · 35 KB
/
policy-integrity-shield.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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
# This policy verifies the installation of Integrity Shield on the managed clusters.
#
# "enforce", it will install Integirty Shield operator
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: policy-integrity-shield
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-5 Access Restrictions for Change
spec:
remediationAction: inform
disabled: false
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-integrity-shield-namespace
spec:
remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction.
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
kind: Namespace
apiVersion: v1
metadata:
name: integrity-shield-operator-system
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-integrity-shield-og
spec:
remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction.
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: integrity-operator-group
namespace: integrity-shield-operator-system
spec:
targetNamespaces:
- integrity-shield-operator-system
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-integrity-shield-sub
spec:
remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction.
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: integrity-shield-operator
namespace: integrity-shield-operator-system
spec:
channel: alpha-0.3.3
name: integrity-shield-operator
source: community-operators
sourceNamespace: openshift-marketplace
startingCSV: integrity-shield-operator.v0.3.3
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-integrity-shield-cr
spec:
remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction.
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: apis.integrityshield.io/v1
kind: IntegrityShield
metadata:
name: integrity-shield
namespace: integrity-shield-operator-system
finalizers:
- cleanup.finalizers.integrityshield.io
spec:
labels:
app: ishield-api
affinity: {}
security:
serviceAccountName: integrity-shield-sa
role: integrity-shield-role
roleBinding: integrity-shield-rolebinding
podSecurityPolicyName: integrity-shield-psp
observerServiceAccountName: integrity-shield-observer-sa
observerRole: integrity-shield-observer-role
observerRoleBinding: integrity-shield-observer-rolebinding
securityContext: {}
shieldApiTlsSecretName: integrity-shield-api-tls
shieldApiServiceName: integrity-shield-api
shieldApiServicePort: 8123
shieldApi:
name: integrity-shield-api
imagePullPolicy: IfNotPresent
image: quay.io/stolostron/integrity-shield-api
port: 8080
selector:
app: integrity-shield-api
resources:
limits:
cpu: 250m
memory: 256Mi
reporter:
name: integrity-shield-reporter
imagePullPolicy: IfNotPresent
image: quay.io/stolostron/integrity-shield-reporter
intervalSeconds: "10"
resources:
limits:
cpu: 100m
memory: 128Mi
requestHandlerConfigKey: config.yaml
requestHandlerConfigName: request-handler-config
requestHandlerConfig: |
defaultConstraintAction:
mode: inform
sideEffect:
createDenyEvent: true
log:
level: info
manifestSigstoreLogLevel: info
format: json
decisionReporterConfig:
enabled: true
requestFilterProfile:
skipObjects:
- kind: ConfigMap
name: kube-root-ca.crt
- kind: ConfigMap
name: openshift-service-ca.crt
ignoreFields:
- fields:
- spec.host
objects:
- kind: Route
- fields:
- metadata.namespace
objects:
- kind: ClusterServiceVersion
- fields:
- metadata.labels.app.kubernetes.io/instance
- metadata.managedFields.*
- metadata.resourceVersion
- metadata.selfLink
- metadata.annotations.control-plane.alpha.kubernetes.io/leader
- metadata.annotations.kubectl.kubernetes.io/last-applied-configuration
- metadata.finalizers*
- metadata.annotations.namespace
- metadata.annotations.deprecated.daemonset.template.generation
- metadata.creationTimestamp
- metadata.uid
- metadata.generation
- status
- metadata.annotations.deployment.kubernetes.io/revision
- metadata.annotations.cosign.sigstore.dev/imageRef
- metadata.annotations.cosign.sigstore.dev/bundle
- metadata.annotations.cosign.sigstore.dev/message
- metadata.annotations.cosign.sigstore.dev/certificate
- metadata.annotations.cosign.sigstore.dev/signature
objects:
- name: '*'
- fields:
- secrets.*.name
- imagePullSecrets.*.name
objects:
- kind: ServiceAccount
- fields:
- spec.ports.*.nodePort
- spec.clusterIP
- spec.clusterIPs.0
objects:
- kind: Service
- fields:
- metadata.labels.olm.api.*
- metadata.labels.operators.coreos.com/*
- metadata.annotations.*
- spec.install.spec.deployments.*.spec.template.spec.containers.*.resources.limits.cpu
- spec.cleanup.enabled
objects:
- kind: ClusterServiceVersion
skipUsers:
- users:
- system:admin
- system:apiserver
- system:kube-scheduler
- system:kube-controller-manager
- system:serviceaccount:kube-system:generic-garbage-collector
- system:serviceaccount:kube-system:attachdetach-controller
- system:serviceaccount:kube-system:certificate-controller
- system:serviceaccount:kube-system:clusterrole-aggregation-controller
- system:serviceaccount:kube-system:cronjob-controller
- system:serviceaccount:kube-system:disruption-controller
- system:serviceaccount:kube-system:endpoint-controller
- system:serviceaccount:kube-system:horizontal-pod-autoscaler
- system:serviceaccount:kube-system:ibm-file-plugin
- system:serviceaccount:kube-system:ibm-keepalived-watcher
- system:serviceaccount:kube-system:ibmcloud-block-storage-plugin
- system:serviceaccount:kube-system:job-controller
- system:serviceaccount:kube-system:namespace-controller
- system:serviceaccount:kube-system:node-controller
- system:serviceaccount:kube-system:job-controller
- system:serviceaccount:kube-system:pod-garbage-collector
- system:serviceaccount:kube-system:pv-protection-controller
- system:serviceaccount:kube-system:pvc-protection-controller
- system:serviceaccount:kube-system:replication-controller
- system:serviceaccount:kube-system:resourcequota-controller
- system:serviceaccount:kube-system:service-account-controller
- system:serviceaccount:kube-system:statefulset-controller
- objects:
- kind: ControllerRevision
- kind: Pod
users:
- system:serviceaccount:kube-system:daemon-set-controller
- objects:
- kind: Pod
- kind: PersistentVolumeClaim
users:
- system:serviceaccount:kube-system:persistent-volume-binder
- objects:
- kind: ReplicaSet
users:
- system:serviceaccount:kube-system:deployment-controller
- objects:
- kind: Pod
users:
- system:serviceaccount:kube-system:replicaset-controller
- objects:
- kind: PersistentVolumeClaim
users:
- system:serviceaccount:kube-system:statefulset-controller
- objects:
- kind: ServiceAccount
users:
- system:kube-controller-manager
- objects:
- kind: EndpointSlice
users:
- system:serviceaccount:kube-system:endpointslice-controller
- objects:
- kind: Secret
users:
- system:kube-controller-manager
- users:
- system:serviceaccount:openshift-marketplace:marketplace-operator
- system:serviceaccount:openshift-monitoring:cluster-monitoring-operator
- system:serviceaccount:openshift-network-operator:default
- system:serviceaccount:openshift-monitoring:prometheus-operator
- system:serviceaccount:openshift-cloud-credential-operator:default
- system:serviceaccount:openshift-machine-config-operator:default
- system:serviceaccount:openshift-infra:namespace-security-allocation-controller
- system:serviceaccount:openshift-cluster-version:default
- system:serviceaccount:openshift-authentication-operator:authentication-operator
- system:serviceaccount:openshift-apiserver-operator:openshift-apiserver-operator
- system:serviceaccount:openshift-kube-scheduler-operator:openshift-kube-scheduler-operator
- system:serviceaccount:openshift-kube-controller-manager-operator:kube-controller-manager-operator
- system:serviceaccount:openshift-controller-manager:openshift-controller-manager-sa
- system:serviceaccount:openshift-controller-manager-operator:openshift-controller-manager-operator
- system:serviceaccount:openshift-kube-apiserver-operator:kube-apiserver-operator
- system:serviceaccount:openshift-sdn:sdn-controller
- system:serviceaccount:openshift-machine-api:cluster-autoscaler-operator
- system:serviceaccount:openshift-machine-api:machine-api-operator
- system:serviceaccount:openshift-machine-config-operator:machine-config-controller
- system:serviceaccount:openshift-machine-api:machine-api-controllers
- system:serviceaccount:openshift-cluster-storage-operator:csi-snapshot-controller-operator
- system:serviceaccount:openshift-kube-controller-manager:localhost-recovery-client
- system:serviceaccount:openshift-kube-storage-version-migrator-operator:kube-storage-version-migrator-operator
- system:serviceaccount:openshift-etcd-operator:etcd-operator
- system:serviceaccount:openshift-service-ca:service-ca
- system:serviceaccount:openshift-config-operator:openshift-config-operator
- system:serviceaccount:openshift-kube-apiserver:localhost-recovery-client
- system:serviceaccount:openshift-cluster-node-tuning-operator:cluster-node-tuning-operator
- objects:
- namespace: openshift-service-ca, openshift-network-operator
kind: ConfigMap
users:
- system:serviceaccount:openshift-service-ca:configmap-cabundle-injector-sa
- objects:
- namespace: openshift-service-ca-operator
kind: ConfigMap
users:
- system:serviceaccount:openshift-service-ca-operator:service-ca-operator
- objects:
- namespace: openshift-service-catalog-controller-manager-operator
kind: ConfigMap
users:
- system:serviceaccount:openshift-service-catalog-controller-manager-operator:openshift-service-catalog-controller-manager-operator
- objects:
- namespace: openshift-console-operator, openshift-console
users:
- system:serviceaccount:openshift-console-operator:console-operator
- objects:
- namespace: openshift-service-ca
kind: ConfigMap
users:
- system:serviceaccount:openshift-service-ca:apiservice-cabundle-injector-sa
- namespace: openshift-service-ca
kind: ConfigMap
users:
- system:serviceaccount:openshift-service-ca:service-serving-cert-signer-sa
- objects:
- namespace: openshift-service-catalog-apiserver-operator
kind: ConfigMap
users:
- system:serviceaccount:openshift-service-catalog-apiserver-operator:openshift-service-catalog-apiserver-operator
- objects:
- namespace: openshift-operator-lifecycle-manager
users:
- system:serviceaccount:openshift-operator-lifecycle-manager:olm-operator-serviceaccount
- objects:
- namespace: openshift-cluster-node-tuning-operator
kind: ConfigMap,DaemonSet
users:
- system:serviceaccount:openshift-cluster-node-tuning-operator:cluster-node-tuning-operator
- objects:
- namespace: openshift
kind: Secret
users:
- system:serviceaccount:openshift-cluster-samples-operator:cluster-samples-operator
- objects:
- namespace: openshift-ingress
kind: Deployment
users:
- system:serviceaccount:openshift-ingress-operator:ingress-operator
- objects:
- kind: ServiceAccount, Secret
users:
- system:serviceaccount:openshift-infra:serviceaccount-pull-secrets-controller
- objects:
- namespace: openshift-marketplace
kind: Pod
users:
- system:node:*
- objects:
- kind: ServiceAccount, InstallPlan, OperatorGroup, Role, RoleBinding, Deployment
users:
- system:serviceaccount:openshift-operator-lifecycle-manager:olm-operator-serviceaccount
- objects:
- kind: InstallPlan, Role, RoleBinding, Deployment
users:
- system:serviceaccount:openshift-operator-lifecycle-manager:olm-operator-serviceaccount
useGatekeeper: true
rego: |
package integrityshieldcheck
violation[{"msg": msg}] {
not is_allowed_kind
not is_excluded
is_create_or_update
ishield_input := {"parameters":input.parameters, "request":input.review}
reqdata := json.marshal(ishield_input)
url := "https://integrity-shield-api.REPLACE_WITH_SERVER_NAMESPSCE.svc:8123/api/request"
resp := http_post(url, reqdata)
should_be_denied(resp)
not is_detect_mode
result := get_result(resp)
msg := sprintf("denied; %v", [result])
}
http_post(url, postdata) = resp {
resp := http.send({
"url": url,
"method": "POST",
"headers": {
"Accept": "application/json",
"Content-type": "application/json",
},
"raw_body": postdata,
"timeout": "2500ms",
"raise_error": false,
"tls_ca_cert": REPLACE_WITH_CA_CERT
})
}
# get decision result from API response
get_result(resp) = result {
raw_body := object.get(resp, "raw_body", null)
not is_null(raw_body)
result := json.unmarshal(raw_body)
}
# if error, return it as result
get_result(resp) = result {
raw_body := object.get(resp, "raw_body", null)
is_null(raw_body)
error_msg := object.get(resp, "error", "")
result := {"http_error":error_msg}
}
# if API response is null, deny
should_be_denied(resp) {
is_null(resp)
}
# if API response has status_code other than 200, deny
should_be_denied(resp) {
not is_null(resp)
resp.status_code != 200
}
# if decision result is "allow == false" or not set, then deny
should_be_denied(resp) {
not is_null(resp)
result := get_result(resp)
allow := object.get(result, "allow", false)
allow == false
}
# request check
is_create_or_update { is_create }
is_create_or_update { is_update }
is_create { input.review.operation == "CREATE" }
is_update { input.review.operation == "UPDATE" }
# shield config: allow
is_allowed_kind { skip_kinds[_].kind == input.review.kind.kind }
# shield config: inScopeNamespaceSelector
is_excluded { exclude_namespaces[_] = input.review.namespace}
# detect mode
is_detect_mode { enforce_mode == "detect" }
###################
# Default setting #
###################
# Mode whether to deny a invalid request [enforce/detect]
enforce_mode = "enforce"
# kinds to be skipped
skip_kinds = [
{
"kind": "Event"
},
{
"kind": "Lease"
},
{
"kind": "Endpoints"
},
{
"kind": "TokenReview"
},
{
"kind": "SubjectAccessReview"
},
{
"kind": "SelfSubjectAccessReview"
}
]
# exclude namespaces
exclude_namespaces = [
"kube-node-lease",
"kube-public",
"kube-storage-version-migrator-operator",
"kube-system",
"open-cluster-management",
"open-cluster-management-hub",
"open-cluster-management-agent",
"open-cluster-management-agent-addon",
"openshift",
"openshift-apiserver",
"openshift-apiserver-operator",
"openshift-authentication",
"openshift-authentication-operator",
"openshift-cloud-credential-operator",
"openshift-cluster-csi-drivers",
"openshift-cluster-machine-approver",
"openshift-cluster-node-tuning-operator",
"openshift-cluster-samples-operator",
"openshift-cluster-storage-operator",
"openshift-cluster-version",
"openshift-compliance",
"openshift-config",
"openshift-config-managed",
"openshift-config-operator",
"openshift-console",
"openshift-console-operator",
"openshift-console-user-settings",
"openshift-controller-manager",
"openshift-controller-manager-operator",
"openshift-dns",
"openshift-dns-operator",
"openshift-etcd",
"openshift-etcd-operator",
"openshift-gatekeeper-system",
"openshift-image-registry",
"openshift-infra",
"openshift-ingress",
"openshift-ingress-canary",
"openshift-ingress-operator",
"openshift-insights",
"openshift-kni-infra",
"openshift-kube-apiserver",
"openshift-kube-apiserver-operator",
"openshift-kube-controller-manager",
"openshift-kube-controller-manager-operator",
"openshift-kube-scheduler",
"openshift-kube-scheduler-operator",
"openshift-kube-storage-version-migrator",
"openshift-kube-storage-version-migrator-operator",
"openshift-kubevirt-infra",
"openshift-machine-api",
"openshift-machine-config-operator",
"openshift-marketplace",
"openshift-monitoring",
"openshift-multus",
"openshift-network-diagnostics",
"openshift-network-operator",
"openshift-node",
"openshift-oauth-apiserver",
"openshift-openstack-infra",
"openshift-operators",
"openshift-operator-lifecycle-manager",
"openshift-ovirt-infra",
"openshift-ovn-kubernetes",
"openshift-sdn",
"openshift-service-ca",
"openshift-service-ca-operator",
"openshift-user-workload-monitoring",
"openshift-vsphere-infra"
]
observer:
enabled: true
name: integrity-shield-observer
imagePullPolicy: IfNotPresent
image: quay.io/stolostron/integrity-shield-observer
selector:
app: integrity-shield-observer
resources:
limits:
cpu: 250m
memory: 256Mi
logLevel: info
interval: "5"
exportDetailResult: false
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-integrity-shield-policy-constraint
spec:
remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction.
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: ManifestIntegrityConstraint
metadata:
name: policy-constraint
spec:
match:
kinds:
- apiGroups:
- policy.open-cluster-management.io
kinds:
- Policy
namespaceSelector:
matchExpressions:
- key: policy.open-cluster-management.io/isClusterNamespace
operator: In
values:
- "true"
parameters:
constraintName: policy-constraint
action:
mode: inform
ignoreFields:
- fields:
- metadata.labels.policy.open-cluster-management.io/root-policy
- metadata.labels.policy.open-cluster-management.io/cluster-name
- metadata.labels.policy.open-cluster-management.io/cluster-namespace
- metadata.annotations.apps.open-cluster-management.io/sync-source
- metadata.annotations.apps.open-cluster-management.io/reconcile-option
- metadata.annotations.apps.open-cluster-management.io/hosting-subscription
- metadata.annotations.apps.open-cluster-management.io/hosting-deployable
- metadata.annotations.apps.open-cluster-management.io/cluster-admin
objects:
- apiGroup: policy.open-cluster-management.io
- fields:
- namespace
objects:
- apiGroup: policy.open-cluster-management.io
kind: Policy
signers:
- "*"
keyConfigs:
- keySecretName: keyring-secret
keySecretNamespace: integrity-shield-operator-system
skipUsers:
- users:
- system:serviceaccount:open-cluster-management-agent:*
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: policy-integrity-shield-sub-policy-constraint
spec:
remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction.
severity: high
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: ManifestIntegrityConstraint
metadata:
name: sub-policy-constraint
spec:
match:
kinds:
- apiGroups:
- policy.open-cluster-management.io
kinds:
- ConfigurationPolicy
- CertificatePolicy
- IamPolicy
namespaceSelector:
matchExpressions:
- key: policy.open-cluster-management.io/isClusterNamespace
operator: In
values:
- "true"
parameters:
constraintName: sub-policy-constraint
action:
mode: inform
admissionOnly: true
ignoreFields:
- fields:
- metadata.labels.policy.open-cluster-management.io/root-policy
- metadata.labels.policy.open-cluster-management.io/cluster-name
- metadata.labels.policy.open-cluster-management.io/cluster-namespace
- metadata.annotations.apps.open-cluster-management.io/sync-source
- metadata.annotations.apps.open-cluster-management.io/reconcile-option
- metadata.annotations.apps.open-cluster-management.io/hosting-subscription
- metadata.annotations.apps.open-cluster-management.io/hosting-deployable
- metadata.annotations.apps.open-cluster-management.io/cluster-admin
objects:
- apiGroup: policy.open-cluster-management.io
signers:
- "*"
keyConfigs:
- keySecretName: keyring-secret
keySecretNamespace: integrity-shield-operator-system
skipUsers:
- users:
- system:serviceaccount:open-cluster-management-agent:*
- system:serviceaccount:open-cluster-management-agent-addon:*
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: binding-policy-integrity-shield
placementRef:
name: placement-policy-integrity-shield
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-integrity-shield
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: placement-policy-integrity-shield
spec:
clusterConditions:
- status: "True"
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- {key: environment, operator: In, values: ["dev"]}