Open source

Securing Grafana Mimir Alertmanager

By default, the Alertmanager exposes API endpoints that enable a user to configure the Alertmanager. The Alertmanager configuration includes receivers that create network connections to send the alerting notifications. For example, the webhook receiver enables a user to configure an arbitrary URL to which the Alertmanager sends a customizable request for every alerting notification. If the Alertmanager network security is not hardened, Grafana Mimir users might configure the Alertmanager to issue requests to any network address both in the local network and the Internet.

We recommend hardening the network on which the Alertmanager runs. Although hardening the network is out of the scope for Grafana Mimir, Grafana Mimir provides a basic built-in firewall that blocks connections created by Alertmanager receivers:

  • To block specific network addresses in Alertmanager receivers, set -alertmanager.receivers-firewall-block-cidr-networks to a comma-separated list of network CIDRs to block.
  • To block private and local addresses in Alertmanager receivers, set -alertmanager.receivers-firewall-block-private-addresses=true.

You can override the Alertmanager built-in firewall settings on a per-tenant basis in the overrides section of the runtime configuration.

Warning

Setting the AWS_CA_BUNDLE environment variable on the Alertmanager disables the built-in firewall for Amazon SNS receivers. If you use the built-in firewall and need a custom certificate authority (CA), add the CA to the system trust store instead, for example in /etc/ssl/certs.

Note

You can disable the Alertmanager configuration API by setting -alertmanager.enable-api=false.

Fallback configuration

The Alertmanager uses the fallback configuration from -alertmanager.configs.fallback for each tenant that doesn’t have its own configuration. The operator supplies the fallback configuration, so the restrictions for tenant configuration don’t apply to it. For example, the fallback configuration can load files, and its Amazon SNS receivers can use the AWS credentials of the Alertmanager.

Tenants still control the alerts that the fallback configuration sends. The Alertmanager fills some destination fields from the alert data. Examples are the SNS api_url, the webhook url, and the contents of the webhook url_file. If a destination field uses alert labels or annotations, a tenant can choose where the requests with the fallback credentials go.

Warning

Don’t use alert data in the destination fields of the fallback configuration.