-
Notifications
You must be signed in to change notification settings - Fork 0
/
policy4.yml
52 lines (52 loc) · 1.69 KB
/
policy4.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
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: check-image-signature
annotations:
policies.kyverno.io/title: Check Image Signature
policies.kyverno.io/category: ImageSignature
policies.kyverno.io/severity: medium
policies.kyverno.io/subject: Pod
policies.kyverno.io/minversion: 1.7.0
policies.kyverno.io/description: >-
Using the Cosign project, OCI images may be signed to ensure supply chain
security is maintained. Those signatures can be verified before pulling into
a cluster. This policy checks the signature of an image repo called
ghcr.io/kyverno/test-verify-image to ensure it has been signed by verifying
its signature against the provided public key. This policy serves as an illustration for
how to configure a similar rule and will require replacing with your image(s) and keys.
spec:
webhookTimeoutSeconds: 15
validationFailureAction: audit
background: false
rules:
- name: verify-image-signature
match:
resources: {}
any:
- resources:
kinds:
- Pod
namespaces:
- "cool-namespace"
verifyImages:
- imageReferences:
- "*"
mutateDigest: true
required: true
verifyDigest: true
attestors:
- entries:
- keys:
publicKeys: |
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
# BC: https://github.com/kyverno/kyverno/issues/5738
mutate: {}
validate: {}
exclude:
resources: {}
generate:
clone: {}
cloneList: {}