Skip to content

Commit f834124

Browse files
committed
helm-chart: Prevent few more occasions of template injection
By adding quotes you prevent users from injecting yaml based template attacks.
1 parent c030ba9 commit f834124

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

charts/fluent-operator/templates/fluentbit-clusterinput-systemd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
apiVersion: fluentbit.fluent.io/v1alpha2
55
kind: ClusterInput
66
metadata:
7-
name: {{ .Values.containerRuntime }}
7+
name: {{ .Values.containerRuntime | quote }}
88
labels:
99
fluentbit.fluent.io/enabled: "true"
1010
fluentbit.fluent.io/component: logging
@@ -17,7 +17,7 @@ spec:
1717
stripUnderscores: {{ .Values.fluentbit.input.systemd.stripUnderscores | quote }}
1818
systemdFilter:
1919
{{- if .Values.fluentbit.input.systemd.systemdFilter.enable }}
20-
- _SYSTEMD_UNIT={{ .Values.containerRuntime }}.service
20+
- {{ printf "_SYSTEMD_UNIT=%s.service" .Values.containerRuntime }}
2121
{{- if .Values.fluentbit.input.systemd.includeKubelet }}
2222
- _SYSTEMD_UNIT=kubelet.service
2323
{{- end }}

charts/fluent-operator/templates/fluentbit-output-forward.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
spec:
1212
matchRegex: (?:kube|service)\.(.*)
1313
forward:
14-
host: {{ .Values.fluentd.name }}.{{ .Release.Namespace }}.svc
14+
host: {{ printf "%s.%s.svc" .Values.fluentd.name .Release.Namespace | quote }}
1515
port: {{ .Values.fluentd.forward.port }}
1616
{{- end }}
1717
{{- end }}

charts/fluent-operator/templates/fluentbitconfig-fluentBitConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
- /fluent-bit/config/parsers_multiline.conf
1818
httpServer: true
1919
{{- with .Values.fluentbit.logLevel }}
20-
logLevel: {{ . }}
20+
logLevel: {{ . | quote }}
2121
{{- end }}
2222
{{- with .Values.fluentbit.service.storage }}
2323
storage:

0 commit comments

Comments
 (0)