2019-05-22 17:29:26 -07:00
|
|
|
apiVersion : kyverno.io/v1alpha1
|
2019-05-17 14:18:10 -07:00
|
|
|
kind: Policy
|
|
|
|
metadata:
|
2019-06-03 15:10:49 -04:00
|
|
|
name: check-registries
|
2019-05-17 14:18:10 -07:00
|
|
|
spec:
|
|
|
|
rules:
|
2019-06-03 15:10:49 -04:00
|
|
|
- name: check-registries
|
2019-05-17 14:18:10 -07:00
|
|
|
resource:
|
2019-05-23 20:37:11 +03:00
|
|
|
kinds:
|
2019-05-21 15:43:43 -07:00
|
|
|
- Deployment
|
2019-05-23 20:37:11 +03:00
|
|
|
- StatefulSet
|
2019-05-17 14:18:10 -07:00
|
|
|
validate:
|
2019-05-23 20:37:11 +03:00
|
|
|
message: "Registry is not allowed"
|
2019-05-17 14:18:10 -07:00
|
|
|
pattern:
|
2019-05-23 20:37:11 +03:00
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: "*"
|
2019-05-23 20:42:34 -07:00
|
|
|
# Check allowed registries
|
|
|
|
image: "*/nirmata/* | https://private.registry.io/*"
|