Skip to content

Commit

Permalink
Merge pull request #130 from snyk/fix/validate-certificate-format
Browse files Browse the repository at this point in the history
fix: validate certificate format
  • Loading branch information
soniqua authored Aug 15, 2024
2 parents a0a6dab + a3d6b7f commit f0da331
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
607a5d5d16b365165d8636e526ed92a2ea116719:charts/snyk-broker/tests/broker_deployment_ca_test.yaml:private-key:271
2 changes: 1 addition & 1 deletion charts/snyk-broker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: snyk-broker
version: 2.7.2
version: 2.7.3
description: A Helm chart for Kubernetes
type: application
6 changes: 6 additions & 0 deletions charts/snyk-broker/tests/broker_deployment_ca_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,9 @@ tests:
documentSelector:
path: metadata.name
value: RELEASE-NAME-snyk-broker-cacert-secret

- it: rejects a non-PEM certificate
set:
caCertFile: "\n \n-----BEGIN RSA PRIVATE KEY-----\nCERTIFICATE GOES HERE\n-----END RSA PRIVATE KEY-----\n\n\n" #gitleaks:allow
asserts:
- failedTemplate: {}
3 changes: 2 additions & 1 deletion charts/snyk-broker/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@
"type": "string"
},
"caCertFile": {
"type": "string"
"type": "string",
"pattern": "^$|^\\s*-----BEGIN CERTIFICATE-----(?:.|\\s)*-----END CERTIFICATE-----\\s*$"
},
"disableCaCertTrust": {
"type": "boolean"
Expand Down

0 comments on commit f0da331

Please sign in to comment.