Skip to content

Commit f98f2f4

Browse files
Security - Redis authentication - cherry pick from https://github.com/argoproj/argo-helm-ghsa-4j3q-9h77-jq5x (#74)
1 parent aee4c58 commit f98f2f4

File tree

17 files changed

+288
-15
lines changed

17 files changed

+288
-15
lines changed

charts/argo-cd/Chart.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apiVersion: v2
2-
appVersion: v2.10-2024.3.29-1dcc54e29
2+
appVersion: v2.10-2024.5.14-9315e75e1
33
kubeVersion: ">=1.23.0-0"
44
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
55
name: argo-cd
6-
version: 6.7.18-2-cap-2.10-2024.3.29-1dcc54e29
6+
version: 6.7.18-3-cap-2.10-2024.5.14-9315e75e1
77
home: https://github.com/argoproj/argo-helm
88
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
99
sources:
@@ -27,4 +27,6 @@ annotations:
2727
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
2828
artifacthub.io/changes: |
2929
- kind: changed
30-
description: Upgrade argo-cd to v2.10-2024.3.29-1dcc54e29
30+
description: Upgrade argo-cd to v2.10-2024.5.14-9315e75e1
31+
- kind: changed
32+
description: Fix for security vulnerability GHSA-9766-5277-j5hr - Redis authentication

charts/argo-cd/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,10 @@ The main options are listed here:
13421342
|-----|------|---------|-------------|
13431343
| redis-ha.additionalAffinities | object | `{}` | Additional affinities to add to the Redis server pods. |
13441344
| redis-ha.affinity | string | `""` | Assign custom [affinity] rules to the Redis pods. |
1345+
| redis-ha.auth | bool | `true` | Configures redis-ha with AUTH |
13451346
| redis-ha.containerSecurityContext | object | See [values.yaml] | Redis HA statefulset container-level security context |
13461347
| redis-ha.enabled | bool | `false` | Enables the Redis HA subchart and disables the custom Redis single node deployment |
1348+
| redis-ha.existingSecret | string | `"argocd-redis"` | Existing Secret to use for redis-ha authentication. By default the redis-secret-init Job is generating this Secret. |
13471349
| redis-ha.exporter.enabled | bool | `false` | Enable Prometheus redis-exporter sidecar |
13481350
| redis-ha.exporter.image | string | `"public.ecr.aws/bitnami/redis-exporter"` | Repository to use for the redis-exporter |
13491351
| redis-ha.exporter.tag | string | `"1.58.0"` | Tag to use for the redis-exporter |
@@ -1387,6 +1389,29 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
13871389
| externalRedis.secretAnnotations | object | `{}` | External Redis Secret annotations |
13881390
| externalRedis.username | string | `""` | External Redis username |
13891391

1392+
### Redis secret-init
1393+
1394+
The helm chart deploys a Job to setup a random password which is used to secure the Redis. The Redis password is stored in Kubernetes secret `argocd-redis` with key `auth` in the namespace where Argo CD is installed.
1395+
If you use an External Redis (See Option 3 above), this Job is not deployed.
1396+
1397+
| Key | Type | Default | Description |
1398+
|-----|------|---------|-------------|
1399+
| redisSecretInit.containerSecurityContext | object | See [values.yaml] | Application controller container-level security context |
1400+
| redisSecretInit.image.imagePullPolicy | string | `""` (defaults to global.image.imagePullPolicy) | Image pull policy for the Redis secret-init Job |
1401+
| redisSecretInit.image.repository | string | `""` (defaults to global.image.repository) | Repository to use for the Redis secret-init Job |
1402+
| redisSecretInit.image.tag | string | `""` (defaults to global.image.tag) | Tag to use for the Redis secret-init Job |
1403+
| redisSecretInit.imagePullSecrets | list | `[]` (defaults to global.imagePullSecrets) | Secrets with credentials to pull images from a private registry |
1404+
| redisSecretInit.jobAnnotations | object | `{}` | Annotations to be added to the Redis secret-init Job |
1405+
| redisSecretInit.name | string | `"redis-secret-init"` | Redis secret-init name |
1406+
| redisSecretInit.podAnnotations | object | `{}` | Annotations to be added to the Redis secret-init Job |
1407+
| redisSecretInit.podLabels | object | `{}` | Labels to be added to the Redis secret-init Job |
1408+
| redisSecretInit.resources | object | `{}` | Resource limits and requests for Redis secret-init Job |
1409+
| redisSecretInit.securityContext | object | `{}` | Redis secret-init Job pod-level security context |
1410+
| redisSecretInit.serviceAccount.annotations | object | `{}` | Annotations applied to created service account |
1411+
| redisSecretInit.serviceAccount.automountServiceAccountToken | bool | `true` | Automount API credentials for the Service Account |
1412+
| redisSecretInit.serviceAccount.create | bool | `true` | Create a service account for the redis pod |
1413+
| redisSecretInit.serviceAccount.name | string | `""` | Service account name for redis pod |
1414+
13901415
## ApplicationSet
13911416

13921417
| Key | Type | Default | Description |

charts/argo-cd/README.md.gotmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,19 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
719719
{{- end }}
720720
{{- end }}
721721

722+
### Redis secret-init
723+
724+
The helm chart deploys a Job to setup a random password which is used to secure the Redis. The Redis password is stored in Kubernetes secret `argocd-redis` with key `auth` in the namespace where Argo CD is installed.
725+
If you use an External Redis (See Option 3 above), this Job is not deployed.
726+
727+
| Key | Type | Default | Description |
728+
|-----|------|---------|-------------|
729+
{{- range .Values }}
730+
{{- if hasPrefix "redisSecretInit" .Key }}
731+
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
732+
{{- end }}
733+
{{- end }}
734+
722735
## ApplicationSet
723736

724737
| Key | Type | Default | Description |

charts/argo-cd/templates/_helpers.tpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@ Create the name of the redis service account to use
8686
{{- end -}}
8787
{{- end -}}
8888

89+
90+
{{/*
91+
Create Redis secret-init name
92+
*/}}
93+
{{- define "argo-cd.redisSecretInit.fullname" -}}
94+
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.redisSecretInit.name | trunc 63 | trimSuffix "-" -}}
95+
{{- end -}}
96+
97+
{{/*
98+
Create the name of the Redis secret-init service account to use
99+
*/}}
100+
{{- define "argo-cd.redisSecretInit.serviceAccountName" -}}
101+
{{- if .Values.redisSecretInit.serviceAccount.create -}}
102+
{{ default (include "argo-cd.redisSecretInit.fullname" .) .Values.redis.serviceAccount.name }}
103+
{{- else -}}
104+
{{ default "default" .Values.redisSecretInit.serviceAccount.name }}
105+
{{- end -}}
106+
{{- end -}}
107+
89108
{{/*
90109
Create argocd server name and version as used by the chart label.
91110
*/}}

charts/argo-cd/templates/argocd-application-controller/deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,19 @@ spec:
199199
- name: REDIS_USERNAME
200200
valueFrom:
201201
secretKeyRef:
202-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
202+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
203203
key: redis-username
204204
optional: true
205205
- name: REDIS_PASSWORD
206206
valueFrom:
207207
secretKeyRef:
208-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
208+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
209+
{{- if .Values.externalRedis.host }}
209210
key: redis-password
210211
optional: true
212+
{{- else }}
213+
key: auth
214+
{{- end }}
211215
- name: ARGOCD_DEFAULT_CACHE_EXPIRATION
212216
valueFrom:
213217
configMapKeyRef:

charts/argo-cd/templates/argocd-application-controller/statefulset.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,19 @@ spec:
198198
- name: REDIS_USERNAME
199199
valueFrom:
200200
secretKeyRef:
201-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
201+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
202202
key: redis-username
203203
optional: true
204204
- name: REDIS_PASSWORD
205205
valueFrom:
206206
secretKeyRef:
207-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
207+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
208+
{{- if .Values.externalRedis.host }}
208209
key: redis-password
209210
optional: true
211+
{{- else }}
212+
key: auth
213+
{{- end }}
210214
- name: ARGOCD_DEFAULT_CACHE_EXPIRATION
211215
valueFrom:
212216
configMapKeyRef:

charts/argo-cd/templates/argocd-configs/externalredis-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: {{ include "argo-cd.redis.fullname" . }}
5+
name: argocd-redis
66
namespace: {{ .Release.Namespace | quote }}
77
labels:
88
{{- include "argo-cd.labels" (dict "context" $) | nindent 4 }}

charts/argo-cd/templates/argocd-repo-server/deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,19 @@ spec:
179179
- name: REDIS_USERNAME
180180
valueFrom:
181181
secretKeyRef:
182-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
182+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
183183
key: redis-username
184184
optional: true
185185
- name: REDIS_PASSWORD
186186
valueFrom:
187187
secretKeyRef:
188-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
188+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
189+
{{- if .Values.externalRedis.host }}
189190
key: redis-password
190191
optional: true
192+
{{- else }}
193+
key: auth
194+
{{- end }}
191195
- name: ARGOCD_DEFAULT_CACHE_EXPIRATION
192196
valueFrom:
193197
configMapKeyRef:

charts/argo-cd/templates/argocd-server/deployment.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,19 @@ spec:
243243
- name: REDIS_USERNAME
244244
valueFrom:
245245
secretKeyRef:
246-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
246+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
247247
key: redis-username
248248
optional: true
249249
- name: REDIS_PASSWORD
250250
valueFrom:
251251
secretKeyRef:
252-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
252+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
253+
{{- if .Values.externalRedis.host }}
253254
key: redis-password
254255
optional: true
256+
{{- else }}
257+
key: auth
258+
{{- end }}
255259
- name: ARGOCD_DEFAULT_CACHE_EXPIRATION
256260
valueFrom:
257261
configMapKeyRef:

charts/argo-cd/templates/event-reporter/statefulset.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,19 @@ spec:
159159
- name: REDIS_USERNAME
160160
valueFrom:
161161
secretKeyRef:
162-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
162+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
163163
key: redis-username
164164
optional: true
165165
- name: REDIS_PASSWORD
166166
valueFrom:
167167
secretKeyRef:
168-
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
168+
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
169+
{{- if .Values.externalRedis.host }}
169170
key: redis-password
170171
optional: true
172+
{{- else }}
173+
key: auth
174+
{{- end }}
171175
- name: EVENT_REPORTER_SHARDING_ALGORITHM
172176
valueFrom:
173177
configMapKeyRef:

0 commit comments

Comments
 (0)