File tree Expand file tree Collapse file tree 12 files changed +186
-15
lines changed
Expand file tree Collapse file tree 12 files changed +186
-15
lines changed Original file line number Diff line number Diff line change 5252 mutateDigest : false
5353 required : true
5454 verifyDigest : false
55- validationFailureAction : enforce
55+ validationFailureAction : enforce
Original file line number Diff line number Diff line change 1+ name : verify_multiple_resources
2+ policies :
3+ - policy3.yml
4+ resources :
5+ # - pod3.yml
6+ - pod4.yml
7+ variables : values.yml
8+ results :
9+ # - policy: check-image
10+ # rule: check-image
11+ # resource: pod-3
12+ # kind: Pod
13+ # result: pass
14+ - policy : check-image
15+ rule : check-image
16+ resource : pod-4
17+ kind : Pod
18+ result : pass
Original file line number Diff line number Diff line change 1+ # verified
12apiVersion : apps/v1
23kind : Deployment
34metadata :
4- name : nginx-deployment
55 labels :
66 app : nginx
7+ name : nginx-deployment
78spec :
89 replicas : 1
910 selector :
1415 labels :
1516 app : nginx
1617 spec :
17- imagePullSecrets :
18- - name : regcred
1918 containers :
20- - name : nginx
21- image : ghcr.io/hackeramitkumar/test5:app
22- ports :
23- - containerPort : 80
19+ - image : ghcr.io/hackeramitkumar/test5:app
20+ name : nginx
21+ resources : {}
Original file line number Diff line number Diff line change 1+ # verfied image
12apiVersion : apps/v1
23kind : Deployment
34metadata :
4- name : nginx-deployment
55 labels :
66 app : nginx
7+ name : nginx-deployment
78spec :
89 replicas : 1
910 selector :
1415 labels :
1516 app : nginx
1617 spec :
17- imagePullSecrets :
18- - name : regcred
1918 containers :
20- - name : nginx
21- image : ghcr.io/hackeramitkumar/test5:app2 # NEW VERSION of image
22- ports :
23- - containerPort : 80
19+ - image : ghcr.io/hackeramitkumar/test5:app2
20+ name : nginx
21+ resources : {}
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Pod
3+ metadata :
4+ name : pod-3
5+ namespace : default
6+ spec :
7+ containers :
8+ - image : ghcr.io/hackeramitkumar/test6:app
9+ name : bad-container
10+ imagePullPolicy : Always
11+ - image : ghcr.io/hackeramitkumar/test5:app
12+ name : good-container
13+ imagePullPolicy : Always
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Pod
3+ metadata :
4+ name : pod-4
5+ namespace : default
6+ spec :
7+ containers :
8+ - image : ghcr.io/hackeramitkumar/test5:app
9+ name : good-container
10+ imagePullPolicy : Always
11+ - image : ghcr.io/hackeramitkumar/test6:app
12+ name : bad-container
13+ imagePullPolicy : Always
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ labels :
5+ app : nginx
6+ name : nginx-deployment-5
7+ spec :
8+ replicas : 1
9+ selector :
10+ matchLabels :
11+ app : nginx
12+ template :
13+ metadata :
14+ labels :
15+ app : nginx
16+ spec :
17+ containers :
18+ - image : ghcr.io/hackeramitkumar/test5:app
19+ name : good-container
20+ resources : {}
21+ - image : ghcr.io/hackeramitkumar/test6:app
22+ name : bad-container
23+ resources : {}
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ labels :
5+ app : nginx
6+ name : nginx-deployment-6
7+ spec :
8+ replicas : 1
9+ selector :
10+ matchLabels :
11+ app : nginx
12+ template :
13+ metadata :
14+ labels :
15+ app : nginx
16+ spec :
17+ containers :
18+ - image : ghcr.io/hackeramitkumar/test6:app
19+ name : bad-container
20+ resources : {}
21+ - image : ghcr.io/hackeramitkumar/test5:app
22+ name : good-container
23+ resources : {}
Original file line number Diff line number Diff line change 1+ apiVersion : kyverno.io/v1
2+ kind : ClusterPolicy
3+ metadata :
4+ name : check-image
5+ spec :
6+ validationFailureAction : Enforce
7+ background : false
8+ webhookTimeoutSeconds : 30
9+ failurePolicy : Fail
10+ rules :
11+ - name : check-image
12+ match :
13+ any :
14+ - resources :
15+ kinds :
16+ - Pod
17+ verifyImages :
18+ - imageReferences :
19+ - " ghcr.io/hackeramitkumar*"
20+ attestors :
21+ - count : 1
22+ entries :
23+ - keys :
24+ publicKeys : |-
25+ -----BEGIN PUBLIC KEY-----
26+ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFN8gGjQua2g8N+aLx3Eff+/j5HxL
27+ bV+H2z50/0A4d8XyMUvizPQBtcgei43pqLj1850m3wSwI08z2+6zT1QaEg==
28+ -----END PUBLIC KEY-----
You can’t perform that action at this time.
0 commit comments