CVE-2021-41090 (Markdown, published 2021-12-08T17:15Z)
Description: value: Grafana Agent is a telemetry collector for sending metrics, logs, and trace data to the opinionated Grafana observability stack. Prior to versions 0.20.1 and 0.21.2, inline secrets defined within a metrics instance config are exposed in plaintext over two endpoints: metrics instance configs defined in the base YAML file are exposed at `/-/config` and metrics instance configs defined for the scraping service are exposed at `/agent/api/v1/configs/:key`. Inline secrets will be exposed to anyone being able to reach these endpoints. If HTTPS with client authentication is not configured, these endpoints are accessible to unauthenticated users. Secrets found in these sections are used for delivering metrics to a Prometheus Remote Write system, authenticating against a system for discovering Prometheus targets, and authenticating against a system for collecting metrics. This does not apply for non-inlined secrets, such as `*_file` based secrets. This issue is patched in Grafana Agent versions 0.20.1 and 0.21.2. A few workarounds are available. Users who cannot upgrade should use non-inline secrets where possible. Users may also desire to restrict API access to Grafana Agent with some combination of restricting the network interfaces Grafana Agent listens on through `http_listen_address` in the `server` block, configuring Grafana Agent to use HTTPS with client authentication, and/or using firewall rules to restrict external access to Grafana Agent's API.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-312 \u2014 Cleartext Storage of Sensitive Information
The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.
Repository: https://github.com/grafana/agent
Files changed:
CHANGELOG.md
docs/configuration/integrations/node-exporter-config.md
docs/configuration/integrations/process-exporter-config.md
docs/getting-started/_index.md
docs/operator/custom-resource-quickstart.md
docs/operator/getting-started.md
docs/upgrade-guide/_index.md
pkg/operator/defaults.go
production/README.md
production/grafanacloud-install.sh
production/kubernetes/agent-bare.yaml
production/kubernetes/agent-loki.yaml
production/kubernetes/agent-traces.yaml
production/kubernetes/build/lib/version.libsonnet
production/kubernetes/install-bare.sh
production/tanka/grafana-agent/v1/main.libsonnet
production/tanka/grafana-agent/v2/internal/base.libsonnet
production/tanka/grafana-agent/v2/internal/syncer.libsonnet
Commit message: announce patch releases for cve-2021-41090 (#1152)



Vulnerable code:
  grafana/agent:v0.21.1 \
  - image: grafana/agent:v0.21.1
  grafana/agent:v0.21.1 \
  - image: grafana/agent:v0.21.1
  grafana/agent:v0.21.1
  image: grafana/agent:v0.21.1
        image: grafana/agent-operator:v0.21.1
  grafana/agent:v0.21.1
RELEASE_VERSION="0.21.1"
        image: grafana/agent:v0.21.1
        image: grafana/agent:v0.21.1
        image: grafana/agent:v0.21.1
'grafana/agent:v0.21.1'
MANIFEST_BRANCH=v0.21.1
    agent: 'grafana/agent:v0.21.1',
    agentctl: 'grafana/agentctl:v0.21.1',
    agent: 'grafana/agent:v0.21.1',
    agentctl: 'grafana/agentctl:v0.21.1',
    image: 'grafana/agentctl:v0.21.1',

Fixed code:
# v0.21.2 (2021-12-08)

- [SECURITY] This release contains a fix for
  [CVE-2021-41090](https://github.com/grafana/agent/security/advisories/GHSA-9c4x-5hgq-q3wh).

- [CHANGE] This release disables the existing `/-/config` and
  `/agent/api/v1/configs/{name}` endpoitns by default. Pass the
  `--config.enable-read-api` flag at the command line to opt in to these
  endpoints.

# v0.20.1 (2021-12-08)

*NOTE*: The fixes in this patch are only present in v0.20.1 and >=v0.21.2.

- [SECURITY] This release contains a fix for
  [CVE-2021-41090](https://github.com/grafana/agent/security/advisories/GHSA-9c4x-5hgq-q3wh).

- [CHANGE] This release disables the existing `/-/config` and
  `/agent/api/v1/configs/{name}` endpoitns by default. Pass the
  `--config.enable-read-api` flag at the command line to opt in to these
  endpoints.

  grafana/agent:v0.21.2 \
  - image: grafana/agent:v0.21.2
  grafana/agent:v0.21.2 \
  - image: grafana/agent:v0.21.2
  grafana/agent:v0.21.2
  image: grafana/agent:v0.21.2
        image: grafana/agent-operator:v0.21.2
## v0.21.2, v0.20.1

### Disabling of config retrieval enpoints

These two patch releases, as part of a fix for
[CVE-2021-41090](https://github.com/grafana/agent/security/advisories/GHSA-9c4x-5hgq-q3wh),
disable the `/-/config` and `/agent/api/v1/configs/{name}` endpoints by
default. Pass the `--config.enable-read-api` flag at the command line to
re-enable them.

		"v0.20.1",
		"v0.21.2",
  grafana/agent:v0.21.2
RELEASE_VERSION="0.21.2"
        image: grafana/agent:v0.21.2
        image: grafana/agent:v0.21.2
        image: grafana/agent:v0.21.2
'grafana/agent:v0.21.2'
MANIFEST_BRANCH=v0.21.2
    agent: 'grafana/agent:v0.21.2',
    agentctl: 'grafana/agentctl:v0.21.2',
    agent: 'grafana/agent:v0.21.2',
    agentctl: 'grafana/agentctl:v0.21.2',
    image: 'grafana/agentctl:v0.21.2',