2023-09-19 12:28:58 +02:00
|
|
|
---
|
|
|
|
apiVersion: kyverno.io/v1
|
2019-09-03 14:51:51 -07:00
|
|
|
kind: ClusterPolicy
|
2019-07-17 13:31:00 -07:00
|
|
|
metadata:
|
|
|
|
name: check-registries
|
|
|
|
spec:
|
2023-09-19 12:28:58 +02:00
|
|
|
admission: true
|
|
|
|
background: true
|
2019-07-17 13:31:00 -07:00
|
|
|
rules:
|
2023-09-19 12:28:58 +02:00
|
|
|
- match:
|
|
|
|
any:
|
|
|
|
- resources:
|
|
|
|
kinds:
|
|
|
|
- Deployment
|
|
|
|
- StatefulSet
|
|
|
|
name: check-registries
|
2019-07-17 13:31:00 -07:00
|
|
|
validate:
|
2023-09-19 12:28:58 +02:00
|
|
|
message: Registry is not allowed
|
2019-07-17 13:31:00 -07:00
|
|
|
pattern:
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
containers:
|
2023-09-19 12:28:58 +02:00
|
|
|
- image: '*/nirmata/* | https://private.registry.io/*'
|
|
|
|
name: '*'
|
|
|
|
validationFailureAction: Audit
|