From f0220482a58a003dc472e077a55d7655868c6303 Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Fri, 19 Dec 2025 15:31:58 +0000 Subject: [PATCH 1/2] Run workflows on the maintenance branch --- .github/workflows/actions-linting.yml | 1 + .github/workflows/build-test.yml | 1 + .github/workflows/changelog_check.yml | 1 + .github/workflows/licensing.yml | 1 + .github/workflows/matrix-tools.yml | 1 + .github/workflows/pytest.yml | 1 + .github/workflows/releasing.yml | 1 + .github/workflows/scripts-linting.yml | 1 + 8 files changed, 8 insertions(+) diff --git a/.github/workflows/actions-linting.yml b/.github/workflows/actions-linting.yml index f743937d..409d2768 100644 --- a/.github/workflows/actions-linting.yml +++ b/.github/workflows/actions-linting.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - 'maintenance/*' workflow_dispatch: permissions: diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f8b6bdda..076dbf1d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -9,6 +9,7 @@ on: push: branches: - main + - 'maintenance/*' workflow_dispatch: permissions: diff --git a/.github/workflows/changelog_check.yml b/.github/workflows/changelog_check.yml index d0992e87..78d06013 100644 --- a/.github/workflows/changelog_check.yml +++ b/.github/workflows/changelog_check.yml @@ -9,6 +9,7 @@ on: push: branches: - main + - 'maintenance/*' workflow_dispatch: permissions: diff --git a/.github/workflows/licensing.yml b/.github/workflows/licensing.yml index 2f7d42c0..5157496e 100644 --- a/.github/workflows/licensing.yml +++ b/.github/workflows/licensing.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - 'maintenance/*' workflow_dispatch: permissions: diff --git a/.github/workflows/matrix-tools.yml b/.github/workflows/matrix-tools.yml index 1f2655ad..1de96f49 100644 --- a/.github/workflows/matrix-tools.yml +++ b/.github/workflows/matrix-tools.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - 'maintenance/*' tags: - 'matrix-tools-*' workflow_dispatch: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3360ec1e..e082c0ab 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - 'maintenance/*' workflow_dispatch: permissions: diff --git a/.github/workflows/releasing.yml b/.github/workflows/releasing.yml index 84ac3754..ac7806b3 100644 --- a/.github/workflows/releasing.yml +++ b/.github/workflows/releasing.yml @@ -9,6 +9,7 @@ on: push: branches: - main + - 'maintenance/*' tags: - '[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: diff --git a/.github/workflows/scripts-linting.yml b/.github/workflows/scripts-linting.yml index 7d1e466d..f45b5b3c 100644 --- a/.github/workflows/scripts-linting.yml +++ b/.github/workflows/scripts-linting.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - 'maintenance/*' workflow_dispatch: permissions: From f60c3ba910f8dbbebf7f9a22f76a00ba8a5fe0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Thu, 18 Dec 2025 11:36:13 +0100 Subject: [PATCH 2/2] Use Synapse from oci.element.io --- .../source/common/sub_schema_values.yaml.j2 | 2 +- charts/matrix-stack/source/synapse.yaml.j2 | 2 +- .../templates/ess-library/_render_config.tpl | 4 ++++ .../templates/init-secrets/_helpers.tpl | 3 ++- .../matrix-stack/templates/synapse/_helpers.tpl | 5 +++++ charts/matrix-stack/values.yaml | 8 ++++---- newsfragments/943.security.md | 7 +++++++ tests/manifests/test_secrets.py | 17 ++++++++++++++--- 8 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 newsfragments/943.security.md diff --git a/charts/matrix-stack/source/common/sub_schema_values.yaml.j2 b/charts/matrix-stack/source/common/sub_schema_values.yaml.j2 index 6f3f871c..6d0cc5b6 100644 --- a/charts/matrix-stack/source/common/sub_schema_values.yaml.j2 +++ b/charts/matrix-stack/source/common/sub_schema_values.yaml.j2 @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only ## The matrix-tools image, used in multiple components matrixTools: -{{ image(registry="ghcr.io", repository="element-hq/ess-helm/matrix-tools", tag="0.5.7") | indent(2) }} +{{ image(registry="ghcr.io", repository="element-hq/ess-helm/matrix-tools", tag="0.5.8") | indent(2) }} ## CertManager Issuer to configure by default automatically on all ingresses ## If configured, the chart will automatically generate the tlsSecret name for all ingresses diff --git a/charts/matrix-stack/source/synapse.yaml.j2 b/charts/matrix-stack/source/synapse.yaml.j2 index ef92b14c..dcdc501d 100644 --- a/charts/matrix-stack/source/synapse.yaml.j2 +++ b/charts/matrix-stack/source/synapse.yaml.j2 @@ -85,7 +85,7 @@ logging: ## levelOverrides: ## synapse.util.caches.lrucache: WARNING levelOverrides: {} -{{- sub_schema_values.image(registry='ghcr.io', repository='element-hq/synapse', tag='v1.144.0') }} +{{- sub_schema_values.image(registry='oci.element.io', repository='synapse', tag='v1.144.0-ess.2') }} {{- sub_schema_values.ingress() }} {{- sub_schema_values.labels() }} {{- sub_schema_values.workloadAnnotations() }} diff --git a/charts/matrix-stack/templates/ess-library/_render_config.tpl b/charts/matrix-stack/templates/ess-library/_render_config.tpl index 6bd85cf9..f4983ba9 100644 --- a/charts/matrix-stack/templates/ess-library/_render_config.tpl +++ b/charts/matrix-stack/templates/ess-library/_render_config.tpl @@ -19,6 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{- end -}} {{- $outputFile := required "element-io.ess-library.render-config-container missing context.outputFile" .outputFile -}} {{- $underrides := .underrides | default list -}} +{{- $underridesSecrets := .underridesSecrets | default list -}} {{- $overrides := required "element-io.ess-library.render-config-container missing context.overrides" .overrides -}} - name: {{ $containerName }} {{- include "element-io.ess-library.pods.image" (dict "root" $root "context" $root.Values.matrixTools.image) | nindent 2 }} @@ -32,6 +33,9 @@ SPDX-License-Identifier: AGPL-3.0-only - /conf/{{ $outputFile }} {{- range $underrides }} - /config-templates/{{ . }} + {{- end }} + {{- range $underridesSecrets }} + - /secrets/{{ tpl .configSecret $root }}/{{ .configSecretKey }} {{- end }} {{- range $key := ($additionalProperty | keys | uniq | sortAlpha) -}} {{- $prop := index $additionalProperty $key }} diff --git a/charts/matrix-stack/templates/init-secrets/_helpers.tpl b/charts/matrix-stack/templates/init-secrets/_helpers.tpl index be640d8e..e56d7ab3 100644 --- a/charts/matrix-stack/templates/init-secrets/_helpers.tpl +++ b/charts/matrix-stack/templates/init-secrets/_helpers.tpl @@ -49,7 +49,8 @@ app.kubernetes.io/version: {{ include "element-io.ess-library.labels.makeSafe" $ {{- end }} {{- end }} {{- with $root.Values.synapse }} -{{- if .enabled -}} +{{- if .enabled }} +- {{ (printf "%s-generated" $root.Release.Name) }}:SYNAPSE_EXTRA:extra {{- if not .macaroon }} - {{ (printf "%s-generated" $root.Release.Name) }}:SYNAPSE_MACAROON:rand32 {{- end }} diff --git a/charts/matrix-stack/templates/synapse/_helpers.tpl b/charts/matrix-stack/templates/synapse/_helpers.tpl index 4d9e073c..fd52af41 100644 --- a/charts/matrix-stack/templates/synapse/_helpers.tpl +++ b/charts/matrix-stack/templates/synapse/_helpers.tpl @@ -241,12 +241,17 @@ ess-version.json: | {{- with required "element-io.synapse.render-config-container missing context" .context }} {{- $processType := required "element-io.synapse.render-config-container context required processType" .processType -}} {{- $isHook := required "element-io.synapse.render-config-container context required isHook" .isHook -}} +{{- $underridesSecrets := list }} +{{- if $root.Values.initSecrets.enabled }} +{{- $underridesSecrets = append $underridesSecrets (dict "configSecret" (printf "%s-generated" $root.Release.Name) "configSecretKey" "SYNAPSE_EXTRA") }} +{{- end}} {{- include "element-io.ess-library.render-config-container" (dict "root" $root "context" (dict "additionalPath" "synapse.additional" "nameSuffix" "synapse" "containerName" (.containerName | default "render-config") "templatesVolume" (.templatesVolume | default "plain-config") "underrides" (list "01-homeserver-underrides.yaml") + "underridesSecrets" $underridesSecrets "overrides" (list "04-homeserver-overrides.yaml" (eq $processType "check-config" | ternary "05-main.yaml" (printf "05-%s.yaml" $processType))) "outputFile" "homeserver.yaml" diff --git a/charts/matrix-stack/values.yaml b/charts/matrix-stack/values.yaml index 37642b5a..be6b583c 100644 --- a/charts/matrix-stack/values.yaml +++ b/charts/matrix-stack/values.yaml @@ -21,7 +21,7 @@ matrixTools: ## The tag of the container image to use. ## One of tag or digest must be provided. - tag: "0.5.7" + tag: "0.5.8" ## Container digest to use. Used to pull the image instead of the image tag if set ## The tag will still be set as the app.kubernetes.io/version label @@ -4029,14 +4029,14 @@ synapse: image: ## The host and (optional) port of the container image registry for this component. ## If not specified Docker Hub is implied - registry: ghcr.io + registry: oci.element.io ## The path in the registry where the container image is located - repository: element-hq/synapse + repository: synapse ## The tag of the container image to use. ## One of tag or digest must be provided. - tag: "v1.144.0" + tag: "v1.144.0-ess.2" ## Container digest to use. Used to pull the image instead of the image tag if set ## The tag will still be set as the app.kubernetes.io/version label diff --git a/newsfragments/943.security.md b/newsfragments/943.security.md new file mode 100644 index 00000000..edcd445d --- /dev/null +++ b/newsfragments/943.security.md @@ -0,0 +1,7 @@ +Fix critical security issue tracked as `ELEMENTSEC-2025-1670`. + +This release is a critical security update to address an issue affecting all versions of ESS Community and ESS Pro. ESS Classic and other Synapse-based deployments are not affected. + +The issue only has an impact when federation APIs are exposed to an untrusted network. Deployments that are not currently federating, or that only federate in a closed, trusted federation, are not impacted. These deployments should not enable public federation without first applying this update. + +We advise you to apply the update as quickly as possible. \ No newline at end of file diff --git a/tests/manifests/test_secrets.py b/tests/manifests/test_secrets.py index e5815920..3e7682cd 100644 --- a/tests/manifests/test_secrets.py +++ b/tests/manifests/test_secrets.py @@ -24,6 +24,17 @@ async def test_all_secrets_have_type(templates): @pytest.mark.asyncio_cooperative async def test_no_secret_generated_when_unneeded(release_name, values, make_templates): values["initSecrets"] = {"enabled": True} - for template in await make_templates(values): - if template["kind"] == "Job": - assert template["metadata"]["name"] != f"{release_name}-init-secrets" + + async def _find_init_secrets(): + for template in await make_templates(values): + if template["kind"] == "Job" and template["metadata"]["name"] == f"{release_name}-init-secrets": + return True + return False + + # init-secret is always present when synapse.enabled=true + if values["synapse"]["enabled"]: + assert await _find_init_secrets() + else: + # if snyapse.enabled=false, we should not have init-secrets when all + # secrets are specified + assert not await _find_init_secrets()