File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ apiVersion : kyverno.io/v1
2
+ kind : ClusterPolicy
3
+ metadata :
4
+ name : require-default-duration
5
+ annotations :
6
+ policies.kyverno.io/title : Require certificate duration to be set to 7days
7
+ policies.kyverno.io/category : cert-manager
8
+ policies.kyverno.io/severity : medium
9
+ policies.kyverno.io/subject : Certificate
10
+ policies.kyverno.io/description : >-
11
+ certificate requests should set the duration to 7days
12
+ spec :
13
+ validationFailureAction : Enforce
14
+ background : true
15
+ rules :
16
+ - name : require-certificate-default-duration
17
+ match :
18
+ resources :
19
+ kinds :
20
+ - Certificate
21
+ preconditions :
22
+ any :
23
+ - key : " {{ request.object.spec.issuerRef.name || '' }}"
24
+ operator : Equals
25
+ value : kafka-shared-selfsigned-issuer
26
+ validate :
27
+ message : " Duration must be set to 168h (7 days) as per our recommended best practices"
28
+ pattern :
29
+ spec :
30
+ duration : " 168h"
Original file line number Diff line number Diff line change
1
+ apiVersion : kyverno.io/v1
2
+ kind : ClusterPolicy
3
+ metadata :
4
+ name : require-defaukt-renewbefore
5
+ annotations :
6
+ policies.kyverno.io/title : Require certificate renewBefore to be set to 2/3rds of duration
7
+ policies.kyverno.io/category : cert-manager
8
+ policies.kyverno.io/severity : medium
9
+ policies.kyverno.io/subject : Certificate
10
+ policies.kyverno.io/description : >-
11
+ certificate requests should set renewBefore to 2/3rds of duration
12
+ spec :
13
+ validationFailureAction : Enforce
14
+ background : true
15
+ rules :
16
+ - name : require-certificate-default-renewbefore
17
+ match :
18
+ resources :
19
+ kinds :
20
+ - Certificate
21
+ preconditions :
22
+ any :
23
+ - key : " {{ request.object.spec.issuerRef.name || '' }}"
24
+ operator : Equals
25
+ value : kafka-shared-selfsigned-issuer
26
+ validate :
27
+ message : " renewBefore must be unset or set to 2/3 of duration, which is required to be 168hrs currently (7 days)"
28
+ pattern :
29
+ spec :
30
+ =(renewBefore) : " 112h"
You can’t perform that action at this time.
0 commit comments