-
Notifications
You must be signed in to change notification settings - Fork 1
/
policygenerator-reference.yaml
299 lines (295 loc) · 17.3 KB
/
policygenerator-reference.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
apiVersion: policy.open-cluster-management.io/v1
kind: PolicyGenerator
metadata:
# Required. Used to uniquely identify the configuration file.
name: ""
# Required if multiple policies are consolidated in a PlacementBinding so that the generator can
# create unique PlacementBinding names using the name given here.
placementBindingDefaults:
# Set an explicit placement binding name to use rather than rely on the default.
name: ""
# Required. Any default value listed here can be overridden under an entry in the policies array
# except for "namespace".
policyDefaults:
# Optional. Array of categories to be used in the policy.open-cluster-management.io/categories
# annotation. This defaults to ["CM Configuration Management"].
categories:
- "CM Configuration Management"
# Optional. Determines the policy controller behavior when comparing the manifest to objects on
# the cluster ("musthave", "mustonlyhave", or "mustnothave"). Defaults to "musthave".
complianceType: "musthave"
# Optional. Key-value pairs of annotations to set on generated configuration policies. For
# example, to disable policy templates, you can set this to:
# {"policy.open-cluster-management.io/disable-templates": "true"}. This defaults to {}.
configurationPolicyAnnotations: {}
# Optional. Array of controls to be used in the policy.open-cluster-management.io/controls
# annotation. This defaults to ["CM-2 Baseline Configuration"].
controls:
- "CM-2 Baseline Configuration"
# Optional. This determines if a single configuration policy should be generated for all the
# manifests being wrapped in the policy. If set to false, a configuration policy per manifest will
# be generated. This defaults to true.
consolidateManifests: true
# Optional. A list of objects that should be in specific compliance states before this policy is
# applied. Cannot be specified when policyDefaults.orderPolicies is set to true.
dependencies:
# Required. The name of the object being depended on.
- name: ""
# Optional. The namespace of the object being depended on. Will default to the namespace of
# policies from this generator.
namespace: ""
# Optional. The compliance state the object should be in. Defaults to "Compliant"
compliance: "Compliant"
# Optional. The kind of the object. Defaults to "Policy", but can also be things like
# ConfigurationPolicy.
kind: "Policy"
# Optional. The APIVersion of the object. Defaults to "policy.open-cluster-management.io/v1"
apiVersion: "policy.open-cluster-management.io/v1"
# Optional. Determines whether the policy is enabled or disabled. A disabled policy will not be
# propagated to any managed clusters and will show no status as a result.
disabled: false
# Optional. This is how often a policy should be evaluated when in a particular compliance state.
# When managed clusters have low CPU resources, the evaluation interval can be increased to
# to reduce CPU usage on the Kubernetes API.
evaluationInterval:
# These are in the format of durations (e.g. "1h25m3s"). These can also be set to "never" to
# avoid evaluating the policy after it has become a particular compliance state.
compliant: 30m
noncompliant: 45s
# Optional. A list of objects that should be in specific compliance states before this policy is
# applied. These are added to each policy template (eg ConfigurationPolicy) separately from the
# dependencies list. Cannot be specified when policyDefaults.orderManifests is set to true.
extraDependencies:
# Required. (See policyDefaults.dependencies.name for description.)
- name: ""
# Optional. (See policyDefaults.dependencies.namespace for description.)
namespace: ""
# Optional. (See policyDefaults.dependencies.compliance for description.)
compliance: "Compliant"
# Optional. (See policyDefaults.dependencies.kind for description.)
kind: "Policy"
# Optional. (See policyDefaults.dependencies.apiVersion for description.)
apiVersion: "policy.open-cluster-management.io/v1"
# Optional. Determines whether objects created or monitored by the policy should be deleted when the policy is
# deleted. Pruning only takes place if the remediation action of the policy has been set to "enforce". Example values
# are "DeleteIfCreated", "DeleteAll", or "None". This defaults to unset, which is equivalent to "None".
pruneObjectBehavior: "None"
# Optional. Determines whether to treat the policy as compliant when it is waiting for its
# dependencies to reach their desired states. Defaults to false.
ignorePending: false
# Optional. When the policy references a Gatekeeper policy manifest, this determines if an additional
# configuration policy should be generated in order to receive policy violations in Open Cluster
# Management when the Gatekeeper policy has been violated. This defaults to true.
informGatekeeperPolicies: true
# Optional. When the policy references a Kyverno policy manifest, this determines if an additional
# configuration policy should be generated in order to receive policy violations in Open Cluster
# Management when the Kyverno policy has been violated. This defaults to true.
informKyvernoPolicies: true
# Optional. Overrides complianceType when comparing the manifest's metadata section to objects on
# the cluster ("musthave", "mustonlyhave"). Default is unset to not override complianceType for metadata.
metadataComplianceType: ""
# Required. The namespace of all the policies.
namespace: ""
# Optional. Determines the list of namespaces to check on the cluster for the given manifest. If
# a namespace is specified in the manifest, the selector is not necessary. This defaults to no
# selectors.
namespaceSelector:
include: []
exclude: []
matchLabels: {}
matchExpressions: []
# Optional. Determines whether to define extraDependencies on policy templates so that they are
# applied in the order they are defined in the manifests list for that policy. Cannot be specified
# when consolidateManifests is set to true. Cannot be specified at the same time as extraDependencies.
orderManifests: false
# Optional. Determines whether to define dependencies on the policies so they are applied in the
# order they are defined in the policies list. This defaults to false, and all the policies
# can be applied at the same time. Cannot be specified at the same time as dependencies.
orderPolicies: false
# Optional. The placement configuration for the policies. This defaults to a placement
# configuration that matches all clusters.
placement:
# To specify a placement rule, specify key:value pair cluster selectors. (See placementRulePath
# to specify an existing file instead.)
clusterSelectors: {}
# To specify a placement, specify key:value pair cluster label selectors. (See placementPath to
# specify an existing file instead.)
labelSelector: {}
# Optional. Specifying a name will consolidate placement rules that contain the same cluster
# selectors.
name: ""
# To reuse an existing placement manifest, specify the path here relative to the
# kustomization.yaml file. If given, this placement will be used by all policies by default.
# (See clusterSelectors to generate a new Placement instead.)
placementPath: ""
# To reuse an existing placement rule manifest, specify the path here relative to the
# kustomization.yaml file. If given, this placement rule will be used by all policies by
# default. (See clusterSelectors to generate a new PlacementRule instead.)
placementRulePath: ""
# Use a placement that already exists in the cluster in the same namespace as the policy to be
# generated. It is the responsibility of the administrator to ensure the placement exists. Use
# of this setting will prevent a Placement from being generated, but the Placement Binding will
# still be created.
placementName: ""
# Use a placement rule that already exists in the cluster in the same namespace as the policy to
# be generated. It is the responsibility of the administrator to ensure the placement rule
# exists. Use of this setting will prevent a placement rule from being generated, but the
# placement binding will still be created.
placementRuleName: ""
# Optional. The remediation action ("inform" or "enforce") for each configuration policy. This
# defaults to "inform".
remediationAction: "inform"
# Optional. The severity of the policy violation. This defaults to "low".
severity: "low"
# Optional. Array of standards to be used in the policy.open-cluster-management.io/standards
# annotation. This defaults to ["NIST SP 800-53"].
standards:
- "NIST SP 800-53"
# Optional. Array of policy sets that the policy will join. Policy set details can be defined
# in the policySets section. When a policy is part of a policy set, a placement binding will not be
# generated for the policy since one is generated for the set. Set policies[*].generatePlacementWhenInSet
# or policyDefaults.generatePlacementWhenInSet to override.
policySets: []
# Optional. Whether to generate placement manifests for policies. Placement generation occurs except when policies are
# part of a policy set. Use this setting to turn off placement generation for policies not in policy sets. This
# defaults to "true".
generatePolicyPlacement: true
# Optional. When a policy is part of a policy set, by default the generator will not generate the placement
# for this policy since a placement is generated for the policy set. If a placement should still be generated,
# set it to "true" so that the policy will be deployed with both policy placement and policy set placement.
# This defaults to "false".
generatePlacementWhenInSet: false
# Optional. Annotations that the policy will include under its metadata.annotations. It will be applied for all
# policies unless specified in the policy.
policyAnnotations: {}
# Required. The list of policies to create along with overrides to either the default values or, if
# set, the values given in policyDefaults.
policies:
# Required. The name of the policy to create.
- name: ""
# Required. The list of Kubernetes resource object manifests to include in the policy.
manifests:
# Required. Path to a single file or a flat directory of files relative to the
# kustomization.yaml file. This path cannot be in a directory outside of the directory with
# the kustomization.yaml file. Subdirectories within the directory of the kustomization.yaml
# file are allowed. Kustomization subdirectories are also supported and will not process any
# YAML files in the subdirectory if a kustomization.yaml file is found.
# Supported manifests:
# 1) Non-root policy type manifests such as IamPolicy, CertificatePolicy, and ConfigurationPolicy
# that have a "Policy" suffix. These are not modified except for patches and are directly added
# as a Policy's policy-templates entry.
# 2) For everything else, ConfigurationPolicy objects are generated to wrap these manifests.
# The resulting ConfigurationPolicy is added as a Policy's policy-templates entry.
- path: ""
# Optional. (See policyDefaults.complianceType for description.)
complianceType: "musthave"
# Optional. (See policyDefaults.metadataComplianceType for description.)
metadataComplianceType: ""
# Optional. (See policyDefaults.namespaceSelector for description.)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
namespaceSelector: {}
# Optional. (See policyDefaults.evaluationInterval for description.)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
evaluationInterval: {}
# Optional. (See policyDefaults.extraDependencies for description)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
extraDependencies: []
# Optional. (See policyDefaults.pruneObjectBehavior for description.)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
pruneObjectBehavior: ""
# Optional. (See policyDefaults.ignorePending for description.)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
ignorePending: false
# Optional. (See policyDefaults.remediationAction for description.)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
remediationAction: ""
# Optional. (See policyDefaults.severity for description.)
# Cannot be specified when policyDefaults.consolidateManifests is set to true.
severity: "low"
# (Note: a path to a directory containing a Kustomize manifest is a supported alternative.) Optional. A
# Kustomize patch to apply to the manifest(s) at the path. If there are multiple manifests, the patch requires
# the apiVersion, kind, metadata.name, and metadata.namespace (if applicable) fields to be set so Kustomize can
# identify the manifest the patch applies to.
patches:
# Optional: Only required when there are multiple manifests in the path.
- apiVersion: ""
# Optional: Only required when there are multiple manifests in the path.
kind: ""
metadata:
# Optional: Only required when there are multiple manifests in the path.
# Optional: Replace metadata.name is only allowed for a single YAML structure manifest.
name: ""
# Optional: Only required when there are multiple manifests in the path and it's a
# manifest to a namespaced resource.
# Optional: Replace metadata.namespace is only allowed for a single YAML structure manifest.
namespace: ""
# An example modification to the manifest
annotations:
friends-character: Chandler Bing
# Optional. (See policyDefaults.categories for description.)
categories:
- "CM Configuration Management"
# Optional. (See policyDefaults.complianceType for description.)
complianceType: "musthave"
# Optional. (See policyDefaults.configurationPolicyAnnotations for description.)
configurationPolicyAnnotations: {}
# Optional. (See policyDefaults.metadataComplianceType for description.)
metadataComplianceType: ""
# Optional. (See policyDefaults.controls for description.)
controls:
- "CM-2 Baseline Configuration"
# Optional. (See policyDefaults.dependencies for description.)
# Cannot be specified when policyDefaults.orderPolicies is set to true.
dependencies: []
# Optional. (See policyDefaults.disabled for description.)
disabled: false
# Optional. (See policyDefaults.evaluationInterval for description.)
evaluationInterval: {}
# Optional. (See policyDefaults.extraDependencies for description.)
# Cannot be specified when orderManifests is set to true.
extraDependencies: []
# Optional. (See policyDefaults.pruneObjectBehavior for description.)
pruneObjectBehavior: ""
# Optional. (See policyDefaults.ignorePending for description.)
ignorePending: false
# Optional. (See policyDefaults.informGatekeeperPolicies for description.)
informGatekeeperPolicies: true
# Optional. (See policyDefaults.informKyvernoPolicies for description.)
informKyvernoPolicies: true
# Optional. (See policyDefaults.consolidateManifests for description.)
consolidateManifests: true
# Optional. (See policyDefaults.namespaceSelector for description.)
namespaceSelector: {}
# Optional. (See policyDefaults.orderManifests for description.)
# Cannot be specified when consolidateManifests is set to true.
# If set true here, the default extraDependencies will be overwritten.
orderManifests: false
# Optional. (See policyDefaults.placement for description.)
placement: {}
# Optional. (See policyDefaults.remediationAction for description.)
remediationAction: ""
# Optional. (See policyDefaults.severity for description.)
severity: "low"
# Optional. (See policyDefaults.standards for description.)
standards:
- "NIST SP 800-53"
# Optional. (See policyDefaults.policySets for description.)
policySets: []
# Optional. (See policyDefaults.generatePlacementWhenInSet for description.)
generatePlacementWhenInSet: false
# Optional. Annotations that the policy will include under its metadata.annotations. It will overwrite
# the policyAnnotation defined in the policyDefaults.
policyAnnotations: {}
# Optional. The list of policy sets to create. To include a policy in a policy set, use
# policies[*].policySets or policyDefaults.policySets or policySets.policies.
policySets:
# Required. The name of the policy set to create.
- name: ""
# Optional. The description of the policy set to create.
description: ""
# Optional. The list of policies to be included in the policy set. If policies[*].policySets or
# policyDefaults.policySets is also specified, the list is merged.
policies: []
# Optional. The placement configuration for the policy set. This defaults to a placement
# configuration that matches all clusters. (See policyDefaults.placement for description.)
placement: {}