1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/samples/DisallowUnknownRegistries.md

30 lines
697 B
Markdown
Raw Normal View History

2019-10-23 14:06:03 -07:00
# Disallow unknown image registries
2019-10-23 15:36:37 -07:00
Images from unknown registries may not be scanned and secured. Requiring the use of trusted registries helps reduce threat exposure.
You can customize this policy to allow image registries that you trust.
2019-10-23 14:06:03 -07:00
## Policy YAML
[trusted_image_registries.yaml](best_practices/trusted_image_registries.yaml)
````yaml
apiVersion : kyverno.io/v1alpha1
kind: ClusterPolicy
metadata:
name: trusted-registries
spec:
rules:
- name: trusted-registries
match:
resources:
kinds:
- Pod
validate:
message: "Unknown image registry"
2019-10-23 14:06:03 -07:00
pattern:
spec:
containers:
- image: "k8s.gcr.io/* | gcr.io/*"
````