-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathartifacthub-pkg.yml
300 lines (300 loc) · 9.26 KB
/
artifacthub-pkg.yml
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
# Kubewarden Artifacthub Package config
#
# Use this config to submit the policy to https://artifacthub.io.
#
# This config can be saved to its default location with:
# kwctl scaffold artifacthub > artifacthub-pkg.yml
version: 0.3.0
name: verify-image-signatures
displayName: Verify Image Signatures
createdAt: 2024-09-09T07:20:08.259815499Z
description: A Kubewarden Policy that verifies all the signatures of the container images referenced by a Pod
license: Apache-2.0
homeURL: https://github.com/kubewarden/verify-image-signatures
containersImages:
- name: policy
image: ghcr.io/kubewarden/policies/verify-image-signatures:v0.3.0
keywords:
- pod
- signature
- sigstore
- trusted
links:
- name: policy
url: https://github.com/kubewarden/verify-image-signatures/releases/download/v0.3.0/policy.wasm
- name: source
url: https://github.com/kubewarden/verify-image-signatures
install: |
The policy can be obtained using [`kwctl`](https://github.com/kubewarden/kwctl):
```console
kwctl pull ghcr.io/kubewarden/policies/verify-image-signatures:v0.3.0
```
Then, generate the policy manifest and tune it to your liking. For example:
```console
kwctl scaffold manifest -t ClusterAdmissionPolicy registry://ghcr.io/kubewarden/policies/verify-image-signatures:v0.3.0
```
maintainers:
- name: Kubewarden developers
email: [email protected]
provider:
name: kubewarden
recommendations:
- url: https://artifacthub.io/packages/helm/kubewarden/kubewarden-controller
annotations:
kubewarden/mutation: 'true'
kubewarden/questions-ui: |
questions:
- default: null
description: >-
This policy validates Sigstore signatures for containers, init container and
ephemeral container that match the name provided in the image settings
field. It will reject the Pod if any validation fails. If all signature
validation pass or there is no container that matches the image name, the
Pod will be accepted.
group: Settings
required: false
hide_input: true
type: string
variable: description
- default: true
tooltip: >-
This policy also mutates matching images to add the image digest, therefore
the version of the deployed image can't change. This mutation can be
disabled by setting modifyImagesWithDigest to false.
group: Settings
label: modifyImagesWithDigest
required: false
title: Modify images with digest
type: boolean
variable: modifyImagesWithDigest
- default: GithubAction
description: >-
The policy takes a list of signatures. A signature can be of two types:
public key or keyless. Each signature has an image field which will be used
to select the matching containers in the pod that will be evaluated. image
supports wildcard. For example, ghcr.io/kubewarden/* will match all images
from the kubewarden ghcr repo.
group: Settings
label: Signature Type
options:
- GithubAction
- KeylessPrefix
- Keyless
- PublicKey
- Certificate
required: false
type: enum
variable: rule
- default: []
description: >-
Github action will verify that all images were signed for a GitHub action by the owner and repo properties
label: Github Actions signature
show_if: rule=GithubAction
type: sequence[
variable: signatures
sequence_questions:
- default: ''
group: Settings
label: Image
show_if: rule=GithubAction
type: string
required: true
variable: image
- default: {}
label: Github Actions
show_if: rule=GithubAction
hide_input: true
type: map[
variable: githubActions
subquestions:
- default: ''
group: Settings
label: Owner
show_if: rule=GithubAction
type: string
required: true
variable: githubActions.owner
- default: ''
group: Settings
label: Repo
show_if: rule=GithubAction
type: string
variable: githubActions.repo
- default: []
description: >-
Keyless subject prefix. It will verify that the issuer and that the urlPrefix is sanitized to prevent typosquatting.
label: Keyless Subject Prefix
show_if: rule=KeylessPrefix
type: sequence[
variable: signatures
sequence_questions:
- default: ''
group: Settings
label: Image
show_if: rule=KeylessPrefix
type: string
required: true
variable: image
- default: []
label: Keyless Prefix
show_if: rule=KeylessPrefix
hide_input: true
type: sequence[
variable: keylessPrefix
sequence_questions:
- default: ''
group: Settings
label: Issuer
show_if: rule=KeylessPrefix
type: string
required: true
variable: issuer
- default: ''
group: Settings
label: URL Prefix
show_if: rule=KeylessPrefix
type: string
variable: urlPrefix
- default: []
description: >-
It will verify that the issuer and the subject are an exact match. It will not modify the image with the digest.
label: Keyless Exact Match
show_if: rule=Keyless
type: sequence[
variable: signatures
sequence_questions:
- default: ''
group: Settings
label: Image
show_if: rule=Keyless
type: string
required: true
variable: image
- default: []
label: Keyless
show_if: rule=Keyless
hide_input: true
type: sequence[
variable: keyless
sequence_questions:
- default: ''
group: Settings
label: Issuer
show_if: rule=Keyless
type: string
required: true
variable: issuer
- default: ''
group: Settings
label: Subject
show_if: rule=Keyless
type: string
variable: subject
- default: []
description: >-
It will verify that all images are signed with the supplied public keys, and contains the annotation if provided.
group: Settings
label: Public Key
show_if: rule=PublicKey
hide_input: true
type: sequence[
variable: signatures
sequence_questions:
- default: ''
group: Settings
label: Image
show_if: rule=PublicKey
type: string
required: true
variable: image
- default: []
group: Settings
label: Public keys
show_if: rule=PublicKey
type: array[
value_multiline: true
variable: pubKeys
- default: {}
group: Settings
label: Annotations
show_if: rule=PublicKey
type: map[
variable: annotations
- default: []
description: >-
It will verify that the image has been signed using all the certificates provided. The certificates must be PEM encoded. Optionally the settings can have the list of PEM encoded certificates that can create the certificateChain used to verify the given certificate. The requireRekorBundle should be set to true to have a stronger verification process. When set to true, the signature must have a Rekor bundle and the signature must have been created during the validity time frame of the certificate.
group: Settings
label: Certificate
show_if: rule=Certificate
hide_input: true
type: sequence[
variable: signatures
sequence_questions:
- default: ''
group: Settings
label: Image
show_if: rule=Certificate
type: string
required: true
variable: image
- default: []
group: Settings
label: Certificates
show_if: rule=Certificate
type: array[
value_multiline: true
variable: certificates
- default: true
group: Settings
label: Require Rekor Bundle
show_if: rule=Certificate
type: boolean
variable: requireRekorBundle
- default: {}
group: Settings
label: Annotations
show_if: rule=Certificate
type: map[
variable: annotations
kubewarden/resources: Pod
kubewarden/rules: |
- apiGroups:
- ''
apiVersions:
- v1
resources:
- pods
operations:
- CREATE
- UPDATE
- apiGroups:
- ''
apiVersions:
- v1
resources:
- replicationcontrollers
operations:
- CREATE
- UPDATE
- apiGroups:
- apps
apiVersions:
- v1
resources:
- deployments
- replicasets
- statefulsets
- daemonsets
operations:
- CREATE
- UPDATE
- apiGroups:
- batch
apiVersions:
- v1
resources:
- jobs
- cronjobs
operations:
- CREATE
- UPDATE