Schedule icon
Download icon
Script icon
OutputValues icon
If icon
SlackIncomingWebhook icon
Fail icon
Log icon

Alertmanager Silence Safety Gate

Audit active Alertmanager silences for unsafe duration and label scope. Save evidence, notify Slack, and fail on violations.

Categories
Infrastructure

Alertmanager silences suppress matching notifications. A long or broadly scoped silence can hide a production incident. This flow checks that active silences have a bounded duration and an exact matcher on an approved scope label.

How it works

  1. Read GET /api/v2/silences from one Alertmanager API endpoint.
  2. Validate the response, states, time windows, and matcher structures.
  3. For each active silence, check its total duration and require an exact, positive matcher on at least one label in scope_labels.
  4. Save the JSON report before the If task. On BLOCK, send Slack and fail.

What you get

  • PASS or BLOCK for the selected Alertmanager instance.
  • The number of active silences and a list of violations by silence ID.
  • A report in outputs.publish_report.values.report_uri.
  • A failed execution if the API, JSON format, or script fails. Failures do not produce a PASS result.

Prerequisites and secrets

  • Alertmanager v2 API exposed on a trusted HTTPS endpoint.
  • A read-only API token accepted by the Alertmanager reverse proxy.
  • Node Script and Slack notification plugins; a configured task runner.
  • ALERTMANAGER_URL: trusted HTTPS base URL with no trailing slash.
  • ALERTMANAGER_TOKEN: API bearer token. Do not store it in flow inputs.
  • SLACK_WEBHOOK_URL: Slack incoming webhook used on BLOCK.

Quick start

  1. Set the secrets and configure max_silence_hours (default 24).
  2. Set scope_labels to the labels your team uses to restrict silences. By default, alertname, service, namespace, or job must have an exact, positive matcher. A regex or negative matcher does not meet this rule.
  3. Run with no active silences. The result must be PASS.
  4. Create a temporary broad silence with a short expiry. The result must be BLOCK. Remove the test silence after checking the Slack alert.
  5. Open the saved JSON report and then enable the schedule.

Limits

  • This check audits one Alertmanager endpoint. If you use several independent clusters, deploy this flow for each cluster.
  • A bounded silence can still hide an incident. The flow does not verify alert delivery, notification routing, or whether a silence is approved.
  • Pending and expired silences are checked for response consistency, but only active silences are checked against scope and duration policy.
  • The duration is the whole silence window, not the remaining time.
  • The input is limited to 10,000 silences and 2 MiB. A larger response fails the task rather than giving an incomplete PASS.
  • Only the first 100 violations are stored in the report. The count includes all violations.
  • The API bearer token is for a trusted reverse proxy. Alertmanager itself does not implement built-in user authentication.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.