When teams need Prometheus admin and lifecycle APIs, and why they stay off by default
Prometheus admin and lifecycle APIs are disabled by default, and a team that wants automated reloads, snapshots or cleanup has to turn them on deliberately. Two flags control them. --web.enable-admin-api enables the destructive operations, such as deleting series and taking snapshots, and --web.enable-lifecycle enables the reload and shutdown endpoints. The two flags are independent, so enabling one does not switch on the other. Read the flag list for your exact Prometheus version before you rely on any endpoint, because the set of endpoints behind each flag is defined by the release you run.
Enabling these APIs is justified when a specific automation needs them and the caller is controlled. A common case is a CI pipeline or configuration management job that validates new rules and then asks the running server to reload its configuration, instead of restarting the process and losing scrape state. Snapshots can support a backup routine, and series deletion may be needed to remove data that should not have been collected, such as a secret exposed through a label. Each case should have a named owner, a written reason, and a decision on whether a manual procedure would do the same job with less exposure. If none of those cases applies, keep both flags off.
Before enabling either flag, confirm three things with your own environment: which hosts can reach the Prometheus web port, which identities or services will call the endpoints, and whether the calls will come through a browser session. The Prometheus security model lists the endpoints and the risks that follow from them, and it is the document to check against your version. Treat the result as a design input for the controls covered in the next section, not as a reason to enable the APIs on a server that is reachable by everyone on the network.
What the admin API and lifecycle endpoints allow
Two flags open different parts of the Prometheus HTTP surface: the admin API and the lifecycle endpoints. Each operation below changes data, availability or recovery in a different way, so the decision to enable them should follow from which operations your team actually needs and who can reach them.
Snapshots under the admin API
A snapshot creates a copy of the local TSDB blocks in a directory under the data path. It is useful for backups and for moving history to a test environment, but it writes to disk, can consume significant space on a busy server, and copies whatever history exists at that moment. Check where snapshots land, who can read them, and whether your backup job already covers that location, because a snapshot is not a backup policy on its own.
Storage docsSeries deletion removes history
The delete_series operation, enabled by the admin API flag, removes matching series from the database. Deleted data cannot be recovered from Prometheus itself, so a mistyped matcher can erase the history that incident reviews and capacity reports depend on. Treat it as a destructive change: restrict who can call it, record who ran it, and take a snapshot or backup first if the history matters for compliance or audit.
Configuration reload
The lifecycle flag exposes an endpoint that reloads the configuration file without restarting the process. A reload applies changed scrape jobs, rules and alerting settings, and a broken file is rejected while the previous configuration keeps running. The risk is less about downtime and more about who can trigger a reload with a changed file, so check that configuration changes pass through your review process before they reach the running server.
Shutdown through the API
The lifecycle endpoint can stop the Prometheus process on request. A caller who reaches it can take monitoring offline during an incident, and alerts that depend on this server stop firing. Confirm that a supervisor such as systemd or Kubernetes restarts the process after a stop, that an external watchdog or a second Prometheus monitors the first, and that the endpoint is not reachable from networks where unauthenticated users operate.
Recovery depends on the surrounding setup
Local storage is not clustered or replicated, so a deletion, a bad snapshot or a shutdown during a write has no built-in second copy to fall back on. Recovery therefore relies on backups taken outside the API, on remote write to long-term storage, and on runbooks that name who may call these endpoints during an incident. Ask your platform team which of these exists before you enable either flag.
Security modelConfiguration options and when each fits
This table compares four ways to expose the Prometheus admin and lifecycle endpoints, from leaving them off to restricting them at a proxy. Read each row as a use case, the risk it carries, and the control that must be in place before you accept that risk.
| Option | Use case | Risk | Control that makes it acceptable |
|---|---|---|---|
| Both endpoints disabled (default) | Standard production server where reloads happen by restart and data is managed by retention settings | Configuration changes need a restart, and no operator can trigger a snapshot through the API | Keep the default; confirm your deployment tooling restarts Prometheus cleanly and does not depend on the endpoints |
| Lifecycle reload only (--web.enable-lifecycle) | Configuration pipelines that validate prometheus.yml with promtool and then ask the server to reload | Reload and shutdown endpoints accept requests without built-in CSRF protection, so a malicious page visited by an operator could trigger a shutdown | Bind the listener to a private interface, require TLS and authentication in front of it, and block the endpoint paths from browsers through the proxy |
| Admin API enabled (--web.enable-admin-api) | Scheduled snapshots for backups or maintenance windows where a series deletion is approved in advance | Destructive operations, including series deletion, become reachable by any client that can authenticate, and the API has no built-in CSRF protection | Enable only when a named job needs it, limit callers to a service account, restrict the paths to that account's network, and log each call |
| Endpoints restricted at a reverse proxy | Teams that need admin or lifecycle calls from a CI runner or on-call tooling while the UI stays behind single sign-on | Proxy rules that are too broad expose paths, and proxies that forward mutating methods from browsers reintroduce CSRF exposure | Allow only the specific paths and methods, require SSO or client certificates for humans and a scoped token for automation, and test each blocked path after every change |
Why CSRF exposure matters without built-in protection
The Prometheus security model states that the server has no built-in CSRF protection on mutating endpoints. Once --web.enable-admin-api or --web.enable-lifecycle is set, any state-changing request that reaches the server is accepted if it is well formed, and the server has no way to check whether the person or page that sent it intended to. That gap matters most when an administrator is signed in to something else in the same browser. A web page the administrator opens can cause that browser to send requests to the Prometheus address, and the server will carry them out using the administrator's network access. Prometheus does not ask the browser for a token that proves the request came from its own interface.
The practical consequence is that the protection has to sit outside Prometheus. Before enabling either flag, confirm who can reach the listen address at all. The safer pattern is to keep Prometheus bound to a private interface and place an authenticating reverse proxy in front of the web UI and API, with the proxy allowing the admin and lifecycle paths only from a named administrator group or a fixed management network. Pair this with a check of the browser flow: the proxy should reject cross-site requests on mutating methods, for example by requiring a custom header or validating the Origin header. Treat these as design requirements to test, not as features Prometheus supplies, and confirm the exact behavior of your chosen proxy in its own documentation.
How to enable admin endpoints behind a restrictive proxy
This sequence lets a team turn on Prometheus admin and lifecycle operations only when a specific need exists, and exposes them only through a proxy that allows named paths and methods over TLS with authentication. The result is a tested configuration where blocked requests are refused and the allowed operations are logged and attributable.
Define the operations you actually need
Before changing any flag, the platform owner and the operators who will use the endpoints list each operation they need, such as creating a snapshot for backup, deleting series for a data correction, reloading configuration after a change, or shutting down for maintenance. Each item is then tied to a named role and a reason. Anything without a reason stays disabled. The step is done when the list is written down and reviewed by the security owner, with each operation marked as needed, optional or not needed.
Keep admin and lifecycle flags disabled
Confirm that Prometheus starts with the admin API and lifecycle endpoints disabled, which is the default. Check the launch arguments or service unit and the running process to make sure neither --web.enable-admin-api nor --web.enable-lifecycle is set. Only enable a flag in a non-production environment first, for the specific operation that was approved in the previous step. The check is complete when the running process shows the flags absent and a request to a lifecycle path returns a refusal or not-found response.
Place Prometheus on a private network
Move the Prometheus listener onto an internal network segment that only the reverse proxy, approved scrapers, and operators' bastion hosts can reach. Firewall rules or security group settings should deny direct access from user networks. Test reachability from outside the approved sources. The step is complete when a connection attempt from a non-approved network fails, and the approved proxy host can still reach the Prometheus port.
Place an authenticating reverse proxy in front
Put a reverse proxy in front of Prometheus that handles authentication, such as SSO for operators, and forwards only the paths you approved in step one. Configure the proxy to allow only the named paths and HTTP methods, and to deny everything else by default. Because Prometheus has no built-in CSRF protection on mutating endpoints, the proxy should also reject cross-origin requests to those paths. Log every request with the authenticated identity. The step is complete when an allowed path from an authorized user succeeds and the same path from an unauthenticated client is refused.
Add TLS and authentication end to end
Enable TLS between clients and the proxy, and between the proxy and Prometheus where the network design requires it. Prometheus supports TLS with TLS 1.2 as the minimum version and client certificate authentication. If basic authentication is used anywhere, it must run over TLS, because without TLS it exposes credentials in cleartext. Confirm the certificate chain, expiry and hostname with an external client. The step is complete when a plaintext HTTP request is rejected and a TLS request with valid credentials succeeds.
Test that blocked paths return refusals
Run a scripted test from an authorized operator account and from an unauthenticated client against every path on the admin and lifecycle list, including paths not on the allowed list and alternate HTTP methods. Each unapproved request should return a refusal from the proxy, and each approved request should behave as expected. Keep the test script in version control so it can be rerun after upgrades or proxy changes. The check is complete when all blocked requests are refused and the results are recorded.
Confirm logging and review access regularly
Verify that the proxy and Prometheus logs record who called each allowed operation, when, and with what result, and that these logs are sent to a store the monitoring team cannot quietly edit. Schedule a recurring review of the allowed path list against the operations still needed, and remove any that are no longer used. The step is complete when a test call appears in the central log with the operator identity and the review owner is named in the runbook.
How a request to a lifecycle endpoint reaches Prometheus
The diagram starts with an operator or automation client sending an HTTPS request to an authenticating reverse proxy, which checks identity and only forwards allowlisted paths and methods. The proxy hands the request to the Prometheus web listener, where --web.enable-lifecycle and --web.enable-admin-api decide whether the endpoint exists at all. The request then reaches the local storage and the configuration file, which are the things it can change. Check that TLS terminates before the proxy, that the proxy blocks mutating paths for everyone except named roles, and that Prometheus itself is not reachable without the proxy.
Trust boundaries for lifecycle and admin requests, with TLS and authentication applied at the proxy.
Security and operational controls for admin endpoints
The admin and lifecycle endpoints change data and running state, so the controls around them matter as much as the flags that enable them. The cards below cover where the endpoints sit, how callers prove who they are, which methods and paths stay open, how changes are logged and approved, and what must exist before destructive operations run on production storage.
Keep endpoints off the scrape network
Prometheus serves its admin and lifecycle routes on the same web listener as the UI and API, so any host that can reach that port can reach them. Place Prometheus on a management or internal network segment that only operators, CI runners and the reverse proxy can reach. Check that firewall rules block the port from application subnets, from other tenants and from anything that does not need to query Prometheus.
Prometheus security modelAuthenticate every caller at the proxy
Prometheus has no built-in single sign-on and no built-in CSRF protection on mutating endpoints, so the usual pattern is an authenticating reverse proxy in front of the web listener. Decide whether operators authenticate through SSO with group checks, or through basic authentication with bcrypt-hashed passwords. If basic authentication is used, it must run over TLS, because without TLS the credentials travel in cleartext. Confirm that automation accounts use separate credentials from people.
Allow only the methods and paths needed
At the proxy, expose only the routes your operators and tooling call, and deny everything else by default. Reload, shutdown and admin paths should be reachable from a small set of source addresses and for a narrow set of methods, typically POST. Block browser-originated POST requests to these paths by requiring a custom header or by rejecting requests with a foreign Origin, since the server itself will not stop cross-site form submissions. Test the rules with curl from an allowed and a denied host.
Log admin calls at the proxy
Prometheus does not record a per-caller audit trail for admin calls, so the proxy access log is the main record of who triggered a reload, snapshot or series deletion. Log the authenticated identity, timestamp, method, path, status and source address, and ship those logs to a store that operators cannot quietly edit. Compare proxy entries with change tickets during reviews. Confirm with your logging team how long these records must be kept.
Put reloads under change control
A reload applies configuration changes to a running server, and a broken rule file or scrape job can silence alerts or drop targets from dashboards. Run promtool check config and rule checks in CI before the reload request is sent, and tie each reload to a reviewed commit. Record the configuration version in the change ticket so a rollback target is known. Make sure the reload call comes from the pipeline rather than from an operator's laptop.
Back up before destructive operations
Series deletion removes data permanently, and a snapshot on a busy server consumes disk space and can affect I/O. Before the admin API is enabled on production storage, take a tested backup of the data directory and confirm that restoring it works on a separate host. Set a rule that deletions need a named approver and a documented reason. Local storage is not clustered or replicated, so a single host failure can remove data that nobody else holds.
Questions buyers ask about admin API hardening
What drives the cost of restricting Prometheus admin and lifecycle APIs?
The cost depends on how many Prometheus, Alertmanager and exporter instances you run, how your network and reverse proxy are already set up, and whether you need single sign-on in front of the endpoints. The two flags, --web.enable-admin-api and --web.enable-lifecycle, are off by default, so the simplest case is leaving them off. When you need them, the work is a proxy rule set, network placement and access logging, which you can scope per environment. Ask any partner for a quote built from a written list of instances, proxy platform, identity provider and the endpoints you intend to expose. Ask whether the price covers testing from an attacker's position and a retest after fixes.
How long does it take to restrict the admin endpoints?
Duration depends on the number of instances, how many teams call the endpoints today, and whether any automation depends on reload or snapshot calls. If nothing depends on them, the restriction is mostly a matter of removing the flags and confirming the endpoints return errors. If a deployment pipeline calls /-/reload after each configuration change, that pipeline needs a proxy rule that allows only its service account, and that change needs testing first. Ask a partner for a timeline tied to a written scope, and check that your own change window covers the Prometheus restart needed to alter flags.
What does the work need from our own team?
You need an owner for the Prometheus configuration, someone who knows which systems call the reload or admin endpoints, and a person who can approve changes to the reverse proxy. The team also needs access to the Prometheus, Alertmanager and proxy hosts, along with the current deployment method, whether that is configuration management, Kubernetes manifests or hand-edited files. Expect to supply a list of scripts and CI jobs that talk to these endpoints. Without that inventory, the restriction usually breaks an automated job the first time it runs.
Can our own engineers do this without a partner?
Yes, for a single Prometheus server with no automation that calls the lifecycle endpoints. The change itself is small: confirm the flags are absent from the startup command or unit file, restart during a maintenance window, and verify that POST requests to the admin and lifecycle paths are refused. The harder part is the surrounding control, namely a reverse proxy that exposes only the paths you intend, authentication in front of it, and logging of who called what. If your team already runs a proxy for other services, this is usually manageable in-house. Review the Prometheus security model before you change anything, since it explains why these endpoints need protection.
Can we put SSO in front of the Prometheus admin endpoints?
Yes, but the SSO layer belongs in an authenticating reverse proxy, because Prometheus has no built-in single sign-on. The Prometheus security model notes this is the normal approach for the web UI and API. The proxy authenticates the user, then forwards only allowed paths to Prometheus. Keep in mind that Prometheus has no built-in CSRF protection on mutating endpoints, so a browser session that reaches an admin path could be abused. Blocking those paths at the proxy, rather than relying on the user's login alone, is the control that matters. Confirm with your identity team which proxy and identity provider you already support.
What should we check before and after the change?
Before the change, list every caller of the admin and lifecycle paths, record the current flags, and back up the configuration. After the change, check three things: the flags are off in the running process, the proxy refuses the blocked paths from every network segment you use, and your legitimate automation still succeeds. Also confirm that snapshot and series-deletion requests cannot reach Prometheus through any alternate route, such as a second listener or an unprotected port. Keep a record of these checks, since your auditors may ask for evidence of access control on the monitoring platform.
When is an independent partner review worth paying for?
A partner review is worth considering when Prometheus holds data that your regulators or customers care about, when the admin endpoints are reachable from more networks than you expected, or when the proxy and identity layers are complex enough that your own team cannot test them confidently. DeployOpen runs security testing of cloud and infrastructure systems and can review this setup, then deliver findings, fixes and a retest. Request a written scope that names the instances, proxy and identity components to be tested, and ask what the retest covers. DeployOpen does not issue audit reports or certifications, so an independent auditor would still be needed for formal assurance.
Does restricting these endpoints affect alerting or scraping?
Usually not, because scraping and alert evaluation use separate paths from the admin and lifecycle endpoints. The change does affect the operations that use those endpoints: reloading configuration without a restart, creating snapshots for backups, deleting series, and shutting down remotely. If your backup job relies on the snapshot endpoint, that job must be redesigned before the flag is removed. Alertmanager has its own API and configuration, so confirm separately that your alert routing still works after the Prometheus change. Test the full path from rule evaluation to notification in a non-production environment first.
How DeployOpen scopes and delivers admin API controls
DeployOpen scopes admin and lifecycle API control as a fixed-scope engagement with written deliverables agreed before work starts. The scope usually begins with an inventory of every Prometheus, Alertmanager and exporter endpoint that answers on a network path a user or workload can reach, including whether --web.enable-admin-api and --web.enable-lifecycle are set on each server, which proxy or load balancer sits in front, and which identities can reach the paths /api/v1/admin/tsdb/snapshot, /api/v1/admin/tsdb/delete_series and /-/reload. The written scope should list the servers, the reverse proxy product and configuration, the allowed callers for each operation, and the evidence the client receives at the end.
Implementation covers the proxy layer and the Prometheus flags together. DeployOpen configures the authenticating proxy so that mutating requests from browsers require an explicit check that the proxy can enforce, blocks admin and lifecycle paths for all but named automation identities, and restricts the source networks for operational calls such as reload after a configuration change. Each control is then verified: DeployOpen sends requests to the blocked paths from each role and records the responses, confirms that a configuration reload still works from the approved runner, and retests after any change. The client receives the configuration files, the test results and a findings report with fixes and a retest. Confirm with your proxy vendor how it handles CSRF tokens and origin checks, since Prometheus does not provide them.
Retainers are available for ongoing work after the first delivery, such as reviewing new Prometheus releases, re-running the endpoint checks after proxy or platform changes, and keeping the allowed-caller list current as teams and automation change. Ask any provider for a quote that separates the one-time scoping and build from recurring support, names the systems in scope, and states which tests are repeated and how often. DeployOpen does not publish a price list, so the quote follows from the written scope.

