Safeguard
Security Guides•

Does adding my own SecurityFilterChain remove Actuator security?

Yes. Once you define a SecurityFilterChain bean, Spring Boot backs off its default web security, including Actuator protection. Here is how to cover it.

Safeguard Security Team
3 min read

Yes. Spring Boot secures Actuator endpoints other than health when Spring Security is on the classpath and no other SecurityFilterChain bean exists. Once you define your own chain, the auto configuration backs off and your rules decide who can reach Actuator. Add explicit rules for it.

What Boot does by default

The Spring Boot Actuator documentation says only the health endpoint is exposed over HTTP by default. It also says that if Spring Security is present and you have not defined any other SecurityFilterChain bean, all actuators other than health are secured by auto configuration.

The Spring Boot security documentation states the flip side: adding a bean of type SecurityFilterChain switches off the default web security configuration, including Actuator security. Actuator then follows whatever you wrote.

Why this catches teams out

A developer adds a custom chain to permit a public login page or configure a JSON API. It compiles, the app works, and nobody notices that the safety net for Actuator is gone. If exposure was also widened to include more endpoints, those paths may now fall under a broad permit rule or the catch all of your chain.

SituationResult
No custom chain, default exposureHealth only over HTTP
No custom chain, wider exposureNon health endpoints secured by Boot
Custom chain, default exposureHealth only is reachable, but your rules govern it
Custom chain, wider exposureReachability depends entirely on your rules

How to cover Actuator in your own chain

Spring Boot provides request matcher helpers for Actuator endpoints, so you do not have to hardcode paths. The Actuator docs describe them as convenient for custom rules, such as allowing only users with a certain role.

  1. Decide which endpoints you truly need exposed, using the include property.
  2. In your chain, add a rule for the Actuator matcher that requires a role.
  3. Leave health open only if your load balancer needs it, and consider a separate management port.
  4. Make sure the catch all rule at the end requires authentication.
  5. Write a test that calls an Actuator path without credentials and expects a rejection.

For the exposure side of the story, see Spring Boot Actuator: which endpoints are exposed.

Review prompt

Whenever a pull request adds or edits a SecurityFilterChain bean, ask: what happened to the Actuator rules? A scanner can tell you about vulnerable libraries, but this kind of gap is configuration, so it belongs in review and tests.

Safeguard scans dependencies, produces SBOMs and uses reachability analysis to show which findings your code can actually reach. You can run a free scan at gold.safeguard.sh/scan.

Quick check

Does a custom chain also remove the default user?

No. The Boot docs say adding a SecurityFilterChain does not disable the UserDetailsService configuration. A UserDetailsService, AuthenticationProvider or AuthenticationManager bean does.

Is the health endpoint always safe to leave open?

It depends on what details it shows. See our post on the health show details property.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.