Skip to content

fix(k8s): loki runs from the grafana-community chart on loki 3.7.9, out of reach of CVE-2026-21729 - #2470

Merged
dan-petty merged 4 commits into
mainfrom
fix/1632-loki-grafana-community-chart
Oct 28, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/1632-loki-grafana-community-chart

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Loki ran 3.6.11 from chart grafana/loki 7.3.0 in https://grafana.github.io/helm-charts. That chart is now the Grafana Enterprise Logs chart, and its newest version still runs Loki 3.6. CVE-2026-21729 affects Loki before 3.7.0: the detected_fields endpoint allocates memory for the limit of the request, so one request with a very large limit stops Loki. The open-source chart continues as grafana-community/loki in https://grafana-community.github.io/helm-charts.

  • The Argo CD Application loki (k8s/argocd/apps/loki.yaml) and the logging stack of devops k8s deploy-stack install grafana-community/loki 20.0.2, which runs Loki 3.7.9. The logging stack adds the grafana-community repository in place of grafana. The infra stack keeps grafana for its other charts.
  • k8s/logging/loki-values.yaml names the new chart and deletes monitoring.selfMonitoring, which the chart removed in 9.0.0. The note of fix(k8s): chart defaults stop writing logs and watches nobody reads (loki canary and per-query delete warnings, pyroscope debug logging, grafana's datasource sidecar), and loki admits only grafana and alloy from monitoring #1133 on deletion_mode names the Loki 3.7.9 source lines, because the behavior that it records did not change.
  • The StatefulSet keeps its selector, service name and claim template, so pod loki-0 keeps claim storage-loki-0.
  • The chart version is the Loki pin only when nothing else sets the image. An invariant test in tests/invariants/test_k8s_manifests.py holds the repository, the chart and the version of the Application, the AppProject that admits the repository, an Application that gives the chart only the values file, and values that set no loki.image, no singleBinary.image and no removed key. Thus a value such as loki.image.tag: 3.6.11 cannot bring back an affected Loki release under the new pin. A test in tests/test_k8s_logging_stack.py holds the release and the repositories of the logging stack.
  • _loki_mode in tests/test_k8s_local_path_placement.py takes Monolithic, the default mode of the community chart, and its old name SingleBinary.
  • The new capability loki-release-pin records these rules.

The change pins chart 20.0.2 (Loki 3.7.9), not 18.17.1 (Loki 3.7.8), because 20.0.2 is the newest chart and its upgrade notes need no other change to these values. The NetworkPolicy of logging stays closed to Traefik, because Loki runs with auth_enabled: false. Issue #2439 deletes loki-ingress, and issue #2441 sets deploymentMode: Monolithic and turns off memcached.enabled.

Closes #1632

Change: openspec/changes/archive/2026-10-28-1632-loki-grafana-community-chart/

Plan #1632 as change 1632-loki-grafana-community-chart. Loki 3.6 from the
Grafana Enterprise Logs chart has no fix for CVE-2026-21729. The change moves
the Argo CD Application and the logging stack of deploy-stack to
grafana-community/loki 20.0.2, which runs Loki 3.7.9.
…ut of reach of cve-2026-21729

grafana/loki in grafana.github.io/helm-charts is now the Grafana Enterprise
Logs chart, and its newest version still runs Loki 3.6. CVE-2026-21729 affects
Loki before 3.7.0: one detected_fields request with a very large limit makes
Loki allocate memory until it stops.

The Argo CD Application loki and the logging stack of deploy-stack now install
grafana-community/loki 20.0.2, which runs Loki 3.7.9. The values delete
monitoring.selfMonitoring, which that chart removed in 9.0.0, and the note on
deletion_mode names the Loki 3.7.9 source. The StatefulSet keeps its selector,
service name and claim template, so pod loki-0 keeps claim storage-loki-0.

A new test holds the repository, the chart and the version of both paths.
…nd the values set no loki image

The test of the Argo CD Application, its AppProject and the Loki values
moves to tests/invariants/test_k8s_manifests.py, as docs/TESTING.md says
for a test of committed manifests. The test of the logging stack of
deploy-stack stays in tests/test_k8s_logging_stack.py and holds the
whole release and the repositories of the stack.

The chart version is the Loki pin only when nothing else sets the image.
A value `loki.image.tag: 3.6.11` brought back a Loki release that
CVE-2026-21729 affects, and every test passed. The invariant test now
fails when the values set `loki.image` or `singleBinary.image`, or when
the Application gives the chart a value other than the values file.

The OpenSpec change records the new requirement, the two tests, and the
three points where the change differs from the text of issue #1632.
The change moves to openspec/changes/archive/2026-10-28-1632-loki-grafana-community-chart/.
The new capability loki-release-pin records the chart, the version and the
values rules that keep Loki out of reach of CVE-2026-21729.
@dan-petty dan-petty added scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/security Type security: a vulnerability or a leak labels Oct 28, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

Targeted tests on the branch after the rebase onto origin/main (960e357):

uv run devops ci test tests/invariants/test_k8s_manifests.py tests/test_k8s_logging_stack.py tests/test_k8s_argocd_apps.py tests/test_k8s.py tests/test_k8s_local_path_placement.py tests/test_change_folders.py
169 passed in 35.95s

uv run devops openspec archive 1632-loki-grafana-community-chart: every spec and change validates. uv run devops openspec check: passed. trivy config (0.75.0, HIGH and CRITICAL) finds 0 misconfigurations in k8s/argocd/apps/loki.yaml.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main: 3 tests fail on the base and pass on the branch, 28 pass on both, 0 errored.

  failed on base: tests.invariants.test_k8s_manifests::test_loki_runs_the_grafana_community_chart_whose_loki_fixes_cve_2026_21729 (AssertionError: assert {'chart': ('h...e': None, ...} == {'chart': ('h...e': None, ...})
  failed on base: tests.test_k8s_logging_stack::test_logging_stack_definitions_and_single_shipper (AssertionError: assert (('loki',), (.../api/v1/push') == (('loki',), (.../api/v1/push'))
  failed on base: tests.test_k8s_logging_stack::test_deploy_stack_installs_loki_from_the_grafana_community_chart (AssertionError: assert ({'name': 'lo...helm-charts'}) == ({'name': 'lo...helm-charts'}))
3 failed on base (3 failed and 28 passed in tests/invariants/test_k8s_manifests.py, tests/test_k8s_local_path_placement.py, tests/test_k8s_logging_stack.py; 0 errored).
Elapsed: 13s

Steps for a person after the merge

  • Argo CD syncs Application loki to the new chart. Pod loki-0 stops and starts again with the new image, and Loki does not accept logs for the time of the restart. Make sure that pod logging/loki-0 runs docker.io/grafana/loki:3.7.9, is Ready and mounts claim storage-loki-0, and that the alerts LokiRequestErrors and LokiRetentionNotRunning do not fire.
  • The design check before the merge: helm template loki grafana-community/loki --version 20.0.2 -n logging -f k8s/logging/loki-values.yaml | kubectl apply --dry-run=server -n logging -f - reported each object as configured or created with no warning.
  • A person reviews the diff in tuicr (tuicr -r origin/main..HEAD).

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 17:37
@dan-petty
dan-petty merged commit 96c50c9 into main Oct 28, 2026
17 of 19 checks passed
@dan-petty
dan-petty deleted the fix/1632-loki-grafana-community-chart branch October 28, 2026 17:50
dan-petty pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](v0.9.0...v0.10.0)
(2026-10-28)


### Features

* **review:** devops review intake hands the findings of a session on
merged code to roadmap intake
([#2455](#2455))
([a5c7b82](a5c7b82))
* **security:** devops k8s audit runs Popeye in the tool sandbox with a
kube-api network profile that only reads the API server
([#2467](#2467))
([e02c3fb](e02c3fb))
* **security:** the App's installation tokens carry only the permissions
the roadmap jobs use
([#2482](#2482))
([9599ef2](9599ef2)),
closes [#2473](#2473)


### Bug Fixes

* **config:** a config file that is not valid YAML stops the load with
an error that quotes none of its text
([#2468](#2468))
([91fe5dc](91fe5dc))
* **config:** config set reports an unknown key as unknown, not as a key
that needs a value
([#2465](#2465))
([8b650a6](8b650a6))
* **devcontainer:** run the checkout's devops in devcontainer terminals
([#2460](#2460))
([abd2d41](abd2d41))
* **k8s:** loki runs from the grafana-community chart on loki 3.7.9, out
of reach of CVE-2026-21729
([#2470](#2470))
([96c50c9](96c50c9))
* **security:** a credential keyword at the end of a line no longer
masks the first word of the next line
([#2461](#2461))
([b754a73](b754a73))
* **security:** a credential value is masked also when the next line
starts with a parenthesis
([#2477](#2477))
([ece25ca](ece25ca)),
closes [#2471](#2471)
* **security:** pin kubeconform and replace Checkov with Trivy's
misconfiguration scan
([#2464](#2464))
([960e357](960e357))
* **security:** refuse GCONV_PATH, SHELLOPTS, BASHOPTS and PS4 from a
caller, and archive the merged security changes
([#2453](#2453))
([1f9231d](1f9231d))


### Code Refactoring

* **ai:** chat_structured is the one structured-output path
([#2452](#2452))
([3509732](3509732))
* **github:** pr check-readiness reads one merge-readiness verdict from
github/ ([#2456](#2456))
([16442c4](16442c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/security Type security: a vulnerability or a leak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): loki runs from the grafana-community chart on loki 3.7, out of reach of cve-2026-21729

1 participant