Skip to content

Commit ac7f881

Browse files
authored
feat(deployment): support custom CAs (#964)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent 7ff56f0 commit ac7f881

File tree

5 files changed

+54
-1
lines changed

5 files changed

+54
-1
lines changed

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.61.0
10+
version: 1.61.1
1111
# Do not update appVersion, this is handled automatically by the release process
1212
appVersion: v0.91.6
1313

deployment/chainloop/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,22 @@ controlplane:
399399
keyPass: "REDACTED"
400400
```
401401

402+
### Insert custom Certificate Authorities (CAs)
403+
404+
In some scenarios, you might want to add custom Certificate Authorities to the Chainloop deployment. Like in the instance where your OIDC provider uses a self-signed certificate. To do so, add the PEM-encoded CA certificate to the `customCAs` list in your `values.yaml` file like in the example below.
405+
406+
```yaml
407+
customCAs:
408+
- |-
409+
-----BEGIN CERTIFICATE-----
410+
MIIFmDCCA4CgAwIBAgIQU9C87nMpOIFKYpfvOHFHFDANBgkqhkiG9w0BAQsFADBm
411+
BhMCVVMxMzAxBgNVBAoTKihTVEFHSU5HKSBJbnRlcm5ldCBTZWN1cml0eSBSZXNl
412+
REDACTED
413+
5CunuvCXmEQJHo7kGcViT7sETn6Jz9KOhvYcXkJ7po6d93A/jy4GKPIPnsKKNEmR
414+
7DiA+/9Qdp9RBWJpTS9i/mDnJg1xvo8Xz49mrrgfmcAXTCJqXi24NatI3Oc=
415+
-----END CERTIFICATE-----
416+
```
417+
402418
### Send exceptions to Sentry
403419

404420
You can configure different sentry projects for both the controlplane and the artifact CAS
@@ -568,6 +584,7 @@ chainloop config save \
568584
| `controlplane.keylessSigning.fileCA.cert` | The PEM-encoded certificate of the file based CA | `""` |
569585
| `controlplane.keylessSigning.fileCA.key` | The PEM-encoded private key of the file based CA | `""` |
570586
| `controlplane.keylessSigning.fileCA.keyPass` | The secret key pass | `""` |
587+
| `controlplane.customCAs` | List of custom CA certificates content | `[]` |
571588

572589
### Artifact Content Addressable (CAS) API
573590

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- /*
2+
Copyright Chainloop, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- $customCAs := .Values.controlplane.customCAs }}
7+
{{- if (not (empty $customCAs)) }}
8+
apiVersion: v1
9+
kind: Secret
10+
metadata:
11+
name: {{ include "chainloop.controlplane.fullname" . }}-custom-cas
12+
labels:
13+
{{- include "chainloop.controlplane.labels" . | nindent 4 }}
14+
data:
15+
{{- range $index, $pem := $customCAs }}
16+
custom-{{ $index }}.crt: {{ $pem | b64enc | quote }}
17+
{{- end -}}
18+
{{- end -}}

deployment/chainloop/templates/controlplane/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ spec:
9797
- name: gcp-secretmanager-serviceaccountkey
9898
mountPath: /gcp-secrets
9999
{{- end }}
100+
{{- if (not (empty .Values.controlplane.customCAs)) }}
101+
- name: custom-cas
102+
# NOTE: /etc/ssl/certs already contains the system CA certs
103+
# Let's use another known path https://go.dev/src/crypto/x509/root_linux.go
104+
mountPath: /etc/pki/tls/certs
105+
readOnly: true
106+
{{- end }}
100107
volumes:
101108
- name: config
102109
projected:
@@ -105,6 +112,13 @@ spec:
105112
name: {{ include "chainloop.controlplane.fullname" . }}
106113
- configMap:
107114
name: {{ include "chainloop.controlplane.fullname" . }}
115+
{{- if (not (empty .Values.controlplane.customCAs)) }}
116+
- name: custom-cas
117+
projected:
118+
sources:
119+
- secret:
120+
name: {{ include "chainloop.controlplane.fullname" . }}-custom-cas
121+
{{- end }}
108122
# required for the plugins to store the socket files
109123
- name: tmp
110124
emptyDir: {}

deployment/chainloop/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ controlplane:
475475
key: ""
476476
keyPass: ""
477477

478+
## Inject custom CA certificates to the controlplane container
479+
## @param controlplane.customCAs List of custom CA certificates content
480+
customCAs: []
481+
478482
## @section Artifact Content Addressable (CAS) API
479483
##################################
480484
# Artifacts CAS #

0 commit comments

Comments
 (0)