-
Notifications
You must be signed in to change notification settings - Fork 3
Helm Security Enhancements #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
04512ad
cd856b7
23c5cb6
dd21825
0d993b5
6b2d367
31b2b8c
19a8643
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,10 @@ spec: | |
| {{- end }} | ||
| spec: | ||
| serviceAccountName: {{ .Values.brainstore.serviceAccount.name }} | ||
| {{- with .Values.brainstore.writer.podSecurityContext }} | ||
| securityContext: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- if or .Values.brainstore.writer.nodeSelector (and (eq .Values.cloud "google") (eq .Values.google.mode "autopilot")) }} | ||
| nodeSelector: | ||
| {{- with .Values.brainstore.writer.nodeSelector }} | ||
|
|
@@ -66,6 +70,10 @@ spec: | |
| - name: brainstore-writer | ||
| image: "{{ .Values.brainstore.image.repository }}:{{ .Values.brainstore.image.tag }}" | ||
| imagePullPolicy: {{ .Values.brainstore.image.pullPolicy }} | ||
| {{- with .Values.brainstore.writer.securityContext }} | ||
| securityContext: | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| command: ["brainstore"] | ||
| args: ["web"] | ||
| ports: | ||
|
|
@@ -127,6 +135,10 @@ spec: | |
| {{- if .Values.brainstore.writer.extraEnvVars }} | ||
| {{- toYaml .Values.brainstore.writer.extraEnvVars | nindent 12 }} | ||
| {{- end }} | ||
| {{- if .Values.customTLSCABundle }} | ||
| - name: SSL_CERT_FILE | ||
| value: "/etc/braintrust/tls/ca-bundle.pem" | ||
|
Comment on lines
+138
to
+140
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The writer deployment applies the same Useful? React with 👍 / 👎. |
||
| {{- end }} | ||
| volumeMounts: | ||
| - name: cache-volume | ||
| mountPath: {{ .Values.brainstore.writer.cacheDir }} | ||
|
|
@@ -135,6 +147,11 @@ spec: | |
| mountPath: "/mnt/secrets-store" | ||
| readOnly: true | ||
| {{- end }} | ||
| {{- if .Values.customTLSCABundle }} | ||
| - name: tls-ca | ||
| mountPath: "/etc/braintrust/tls" | ||
| readOnly: true | ||
| {{- end }} | ||
| volumes: | ||
| - name: cache-volume | ||
| {{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureContainerStorageDriver }} | ||
|
|
@@ -158,3 +175,13 @@ spec: | |
| volumeAttributes: | ||
| secretProviderClass: {{ .Values.azure.keyVaultName }} | ||
| {{- end }} | ||
| {{- if .Values.customTLSCABundle }} | ||
| - name: tls-ca | ||
| projected: | ||
| sources: | ||
| - secret: | ||
| name: "braintrust-secrets" | ||
| items: | ||
| - key: "CA_PEM" | ||
| path: "ca-bundle.pem" | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| {{- if .Values.realtime.enabled }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ .Values.realtime.name }} | ||
| namespace: {{ include "braintrust.namespace" . }} | ||
| {{- with (merge .Values.global.labels .Values.realtime.labels) }} | ||
| labels: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.realtime.annotations.deployment }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| replicas: {{ .Values.realtime.replicas }} | ||
| selector: | ||
| matchLabels: | ||
| app: {{ .Values.realtime.name }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: {{ .Values.realtime.name }} | ||
| {{- with (merge .Values.global.labels .Values.realtime.labels) }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| annotations: | ||
| {{- with .Values.realtime.annotations.pod }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.realtime.podSecurityContext }} | ||
| securityContext: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.realtime.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.realtime.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.realtime.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| containers: | ||
| - name: realtime | ||
| image: "{{ .Values.realtime.image.repository }}:{{ .Values.realtime.image.tag }}" | ||
| imagePullPolicy: {{ .Values.realtime.image.pullPolicy }} | ||
| {{- with .Values.realtime.securityContext }} | ||
| securityContext: | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| ports: | ||
| - containerPort: {{ .Values.realtime.service.port }} | ||
| resources: | ||
| {{- toYaml .Values.realtime.resources | nindent 12 }} | ||
| env: | ||
| - name: REDIS_URL | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: braintrust-secrets | ||
| key: REDIS_URL | ||
| {{- if .Values.realtime.extraEnvVars }} | ||
| {{- toYaml .Values.realtime.extraEnvVars | nindent 12 }} | ||
| {{- end }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| {{- if .Values.realtime.enabled }} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ .Values.realtime.service.name | default .Values.realtime.name }} | ||
| namespace: {{ include "braintrust.namespace" . }} | ||
| {{- with (merge .Values.global.labels .Values.realtime.labels) }} | ||
| labels: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.realtime.annotations.service }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| selector: | ||
| app: {{ .Values.realtime.name }} | ||
| ports: | ||
| - name: {{ .Values.realtime.service.portName }} | ||
| protocol: TCP | ||
| port: {{ .Values.realtime.service.port }} | ||
| targetPort: {{ .Values.realtime.service.port }} | ||
| type: {{ .Values.realtime.service.type }} | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
customTLSCABundleis enabled the reader container setsSSL_CERT_FILEto/etc/braintrust/tls/ca-bundle.pem. In Go/OpenSSL this variable replaces the entire trust store rather than augmenting it, so the reader will stop trusting system CAs and will fail on connections to services using public certificates (e.g., S3/GCS) once the feature is turned on. The values comments describe the feature as appending custom CAs, so this implementation likely breaks that use case. Consider concatenating the custom bundle with the system CA file or usingSSL_CERT_DIRso defaults remain available.Useful? React with 👍 / 👎.