Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ~1.25.3
go-version: ~1.25.8
- name: Test Policy
run: go run ./cmd/cli/kubectl-kyverno test ../policies
working-directory: kyverno
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ~1.25.3
go-version: ~1.25.8
- name: Lint policies
run: |
set -e
Expand Down
2 changes: 1 addition & 1 deletion other-mpol/replace-image-registry/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Sample"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "Pod"
digest: 2463c641a775bf52901516d24d5a6898298a630ed7b6ec981dcee3354e798a38
digest: 2be43b9a23807316228e9e30b89c619113b84cf96cff589447b9219837d54562
12 changes: 2 additions & 10 deletions other-mpol/replace-image-registry/replace-image-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ spec:
apiVersions: ["v1"]
operations: ["CREATE", "UPDATE"]
resources: ["pods"]

variables:
- name: stripRegistry
expression: |
string(img) =>
img.contains('/') && img.split('/')[0].contains('.') ?
img.split('/', 2)[1] :
img

mutations:
- patchType: ApplyConfiguration
applyConfiguration:
Expand Down Expand Up @@ -64,4 +56,4 @@ spec:
enabled: true

webhookConfiguration:
timeoutSeconds: 10
timeoutSeconds: 10
2 changes: 1 addition & 1 deletion other/block-stale-images/.chainsaw-test/pods-good.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
containers:
- name: kyverno
image: kyverno:latest
image: ghcr.io/kyverno/kyverno:latest
- name: kyverno02
image: ghcr.io/kyverno/kyverno:latest
---
Expand Down
2 changes: 1 addition & 1 deletion other/block-stale-images/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.23"
kyverno/subject: "Pod"
digest: 4c840db89d0d4d8d79c3ef120d319a93d62638f3e6c82ccbdf863b4f3d60b7aa
digest: 1eb8ff932d2d9b35a2eb6876bf2a2ff3522dc1840076a315ff2996cbb3ea21be
2 changes: 1 addition & 1 deletion other/block-stale-images/block-stale-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
context:
- name: imageData
imageRegistry:
reference: "{{ element.image }}"
reference: '{{ element.image }}'
deny:
conditions:
all:
Expand Down
2 changes: 1 addition & 1 deletion other/verify-image-ivpol/.chainsaw-test/bad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
spec:
containers:
- name: test-container
image: 'docker.io/mohdcode/kyverno@sha256:b178bb94b508183cddda73829e007c7ae2c6996324b2fc1f1746f2281e635f7a'
image: 'ghcr.io/kyverno/test-verify-image:unsigned'
imagePullPolicy: Always
2 changes: 1 addition & 1 deletion other/verify-image-ivpol/.chainsaw-test/good.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
spec:
containers:
- name: test-container
image: 'docker.io/mohdcode/kyverno@sha256:2215deb786eb4039647d8d2881d1b5290ec2c200e14ba1535b0cdd58b69a1bcf'
image: 'ghcr.io/kyverno/test-verify-image:signed'
imagePullPolicy: Always
18 changes: 9 additions & 9 deletions other/verify-image-ivpol/.chainsaw-test/policy-ready.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ metadata:
name: verify-image-ivpol
status:
conditionStatus:
(conditions[?type == 'RBACPermissionsGranted']):
- message: Policy is ready for reporting.
reason: Succeeded
status: "True"
(conditions[?type == 'WebhookConfigured']):
- message: Webhook configured.
reason: Succeeded
status: "True"
type: WebhookConfigured
(conditions[?type == 'RBACPermissionsGranted']):
- message: Policy is ready for reporting.
reason: Succeeded
status: "True"
(conditions[?type == 'WebhookConfigured']):
- message: Webhook configured.
reason: Succeeded
status: "True"
type: WebhookConfigured

2 changes: 1 addition & 1 deletion other/verify-image-ivpol/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ readme: |
annotations:
kyverno/category: "Software Supply Chain Security, EKS Best Practices"
kyverno/subject: "Pod"
digest: c315f0db7538deb20debade15ceb0fcbbdf4e526512acac6af95048dd1ecb0e5
digest: d15b7c6c473fd34424da705a54a27f2bd8d57c2ebf7dde140b8bed6199630c5f
42 changes: 29 additions & 13 deletions other/verify-image-ivpol/verify-image-ivpol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ spec:
webhookConfiguration:
timeoutSeconds: 30
evaluation:
background:
enabled: false
background:
enabled: false
validationActions: [Deny]
matchConstraints:
resourceRules:
Expand All @@ -29,18 +29,34 @@ spec:
operations: ["CREATE", "UPDATE"]
resources: ["pods"]
matchImageReferences:
- glob : "docker.io/mohdcode/kyverno*"
- glob : "ghcr.io/kyverno/test-verify-image*"
attestors:
- name: cosign
cosign:
key:
data: |
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6QsNef3SKYhJVYSVj+ZfbPwJd0pv
DLYNHXITZkhIzfE+apcxDjCCkDPcJ3A3zvhPATYOIsCxYPch7Q2JdJLsDQ==
-----END PUBLIC KEY-----
- name: notary
notary:
certs:
value: |-
-----BEGIN CERTIFICATE-----
MIIDTTCCAjWgAwIBAgIJAPI+zAzn4s0xMA0GCSqGSIb3DQEBCwUAMEwxCzAJBgNV
BAYTAlVTMQswCQYDVQQIDAJXQTEQMA4GA1UEBwwHU2VhdHRsZTEPMA0GA1U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map(image, verifyImageSignatures(image, [attestors.cosign])).all(e ,e > 0)
images.containers.map(image, verifyImageSignatures(image, [attestors.notary])).all(e ,e > 0)
message: >-
failed the verification
failed the verification
Loading