Skip to content

Commit

Permalink
feat: add kyverno registry policy
Browse files Browse the repository at this point in the history
  • Loading branch information
janfuhrer committed May 8, 2024
1 parent a9e321b commit e01fe0c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions kubernetes/kyverno/registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: restrict-image-registries
spec:
validationFailureAction: Audit
background: true
rules:
- name: validate-registries
match:
any:
- resources:
kinds:
- Pod
validate:
message: "Unknown image registry."
pattern:
spec:
=(ephemeralContainers):
- image: "harbor.domain.local/*"
=(initContainers):
- image: "harbor.domain.local/*"
containers:
- image: "harbor.domain.local/*"

0 comments on commit e01fe0c

Please sign in to comment.