Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

prometheus: disable web.enable-lifecycle and web.enable-admin-api outside of dev#46393

Merged
bobheadxi merged 2 commits into
mainfrom
prometheus-no-admin-api-and-lifecycle
Jan 13, 2023
Merged

prometheus: disable web.enable-lifecycle and web.enable-admin-api outside of dev#46393
bobheadxi merged 2 commits into
mainfrom
prometheus-no-admin-api-and-lifecycle

Conversation

@bobheadxi

Copy link
Copy Markdown
Member

Closes https://github.com/sourcegraph/security-issues/issues/329 - we only need the reload API in development, in deployments the Prometheus configuration should never change.

Test plan

In separate tabs:

sg run prometheus
sg run grafana
sg run monitoring-generator

In logs, look for Prometheus reload working:

[monitoring-...r] INFO generate.prometheus monitoring/generator.go:298 Reloaded Prometheus instance {"instance": "http://127.0.0.1:9090"}

Then run directly:

docker run -p 0.0.0.0:9090:9090 sourcegraph/prometheus:dev

Reload API no longer works:

$ sg run monitoring-generator
 generate: Unexpected status code 403 while reloading Prometheus rules

@bobheadxi bobheadxi requested review from a team January 12, 2023 18:53
@cla-bot cla-bot Bot added the cla-signed label Jan 12, 2023
@bobheadxi bobheadxi merged commit 46187b8 into main Jan 13, 2023
@bobheadxi bobheadxi deleted the prometheus-no-admin-api-and-lifecycle branch January 13, 2023 01:44

@evict evict left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants