mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
21 lines
583 B
YAML
21 lines
583 B
YAML
apiVersion : kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: restrict-image-registries
|
|
annotations:
|
|
policies.kyverno.io/category: Workload Management
|
|
policies.kyverno.io/description: Images from unknown registries may not be scanned and secured.
|
|
Requiring use of known registries helps reduce threat exposure.
|
|
spec:
|
|
rules:
|
|
- name: validate-registries
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Pod
|
|
validate:
|
|
message: "Unknown image registry"
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- image: "k8s.gcr.io/* | gcr.io/*"
|