Skip to content

Commit

Permalink
fix: ensure certificates have pem header/footer
Browse files Browse the repository at this point in the history
  • Loading branch information
soniqua committed Aug 15, 2024
1 parent a0a6dab commit 607a5d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/snyk-broker/tests/broker_deployment_ca_test.yaml:private-key:271
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"
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 607a5d5

Please sign in to comment.