prometheus / prometheus/alertmanager

Support for CSP hardening mechanisms (e.g., nonce/hash templates, report-only CSP, or optional flag to enable safe CSP by default)

Open
#4,509 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component/ui
Dominant language
Go
Stars
8.6k
Forks
2.5k
Avg merge
2d 6h
Merged PRs (30d)
61

Description

We’ve noted that the current Content-Security-Policy header in our project alertmanager implementation includes unsafe-inline and unsafe-eval, which conflict with our security policies.

alertmanager-virtualservice.yaml

http:
- route:
- destination:
host: app-alertmanager
port:
number: 9093
headers:
response:
add:
Content-Security-Policy: "script-src 'self' 'unsafe-eval' 'unsafe-inline';object-src 'none';font-src 'self';style-src 'self' 'unsafe-inline' blob:;img-src * data:;base-uri 'self';connect-src 'self';manifest-src 'self';media-src 'none';form-action 'self';"
{{- end }}

Unlike Grafana—which supports nonce-based or report-only CSP templates—Alertmanager appears to offer no similar configurations per its documentation and codebase.
The only nonce references appear in Webpack build tooling for the React UI and do not affect runtime headers. Would you consider adding CSP configuration features to remove unsafe directives while keeping the UI functional?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with alertmanager-virtualservice.yaml and review the Alertmanager documentation and codebase for existing CSP configuration points. Compare the runtime header with the Webpack build-time nonce references and determine which supported mechanism—nonce or hash templates, report-only mode, or an opt-in safe default—has a testable completion criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, react, webpack
Domain
security, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.