Merge commit 'fe564d72279f4ab061b961dd528623f0ed272667' as 'cluster-config'
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: application-prevent-default-project
|
||||
annotations:
|
||||
policies.kyverno.io/title: Prevent Use of Default Project
|
||||
policies.kyverno.io/category: Argo
|
||||
policies.kyverno.io/severity: medium
|
||||
kyverno.io/kyverno-version: 1.6.2
|
||||
policies.kyverno.io/minversion: 1.6.0
|
||||
kyverno.io/kubernetes-version: "1.23"
|
||||
policies.kyverno.io/subject: Application
|
||||
policies.kyverno.io/description: >-
|
||||
This policy prevents the use of the default project in an Application.
|
||||
spec:
|
||||
validationFailureAction: audit
|
||||
failurePolicy: Ignore
|
||||
background: false
|
||||
rules:
|
||||
- name: default-project
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Application
|
||||
preconditions:
|
||||
all:
|
||||
- key: "{{ request.operation }}"
|
||||
operator: NotEquals
|
||||
value: DELETE
|
||||
validate:
|
||||
message: "The default project may not be used in an Application."
|
||||
pattern:
|
||||
spec:
|
||||
project: "!default"
|
||||
Reference in New Issue
Block a user