What is the purpose of securing actuator endpoints in Spring Boot?
Securing actuator endpoints protects sensitive application information and controls from unauthorized access, ensuring only trusted users can view or manage the app's health, metrics, and configurations.
Click to reveal answer
intermediate
Which Spring Boot property enables security for actuator endpoints?
The property management.endpoints.web.exposure.include controls which endpoints are exposed, and management.endpoint.<endpoint>.enabled controls if an endpoint is active. Security is often configured with Spring Security to restrict access.
Click to reveal answer
intermediate
How do you restrict actuator endpoints to authenticated users only?
Add Spring Security and configure HTTP security to require authentication for actuator endpoints, for example by matching /actuator/** and requiring login or specific roles.
Click to reveal answer
beginner
What is the default exposure level of actuator endpoints in Spring Boot?
By default, only the health and info endpoints are exposed over HTTP. Other endpoints are not exposed unless explicitly configured.
Click to reveal answer
beginner
Why should sensitive actuator endpoints like 'shutdown' be secured or disabled?
Endpoints like 'shutdown' can stop the application remotely. If left unsecured, attackers could disrupt service. Securing or disabling them prevents unauthorized control.
Click to reveal answer
Which Spring Boot property controls which actuator endpoints are exposed over HTTP?
Aspring.security.user.name
Bmanagement.endpoints.web.exposure.include
Cserver.port
Dmanagement.endpoint.enabled
✗ Incorrect
The property management.endpoints.web.exposure.include defines which actuator endpoints are exposed over HTTP.
What is the best way to secure actuator endpoints in a Spring Boot app?
AUse Spring Security to require authentication for actuator URLs
BDisable all actuator endpoints
CExpose all endpoints publicly
DChange server port
✗ Incorrect
Using Spring Security to require authentication ensures only authorized users can access actuator endpoints.
By default, which actuator endpoints are exposed over HTTP?
Ahealth and info
Bshutdown and metrics
Call endpoints
Dnone
✗ Incorrect
Spring Boot exposes only the health and info endpoints by default.
What could happen if the 'shutdown' actuator endpoint is left unsecured?
AIt will expose user data
BNothing, it is safe by default
CAttackers could stop the application remotely
DIt will slow down the app
✗ Incorrect
An unsecured shutdown endpoint allows attackers to stop the app, causing downtime.
How can you disable a specific actuator endpoint like 'shutdown'?
ARemove Spring Security
BDelete the actuator dependency
CSet server.port=0
DSet management.endpoint.shutdown.enabled=false
✗ Incorrect
Setting management.endpoint.shutdown.enabled=false disables the shutdown endpoint.
Explain how to secure actuator endpoints in a Spring Boot application.
Think about controlling who can see and use the actuator URLs.
You got /4 concepts.
Why is it important to limit access to actuator endpoints?
Consider what could happen if anyone could access these endpoints.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of securing Spring Boot actuator endpoints?
easy
A. To improve application performance by disabling endpoints
B. To automatically update actuator endpoints without manual configuration
C. To enable actuator endpoints for all users without restrictions
D. To protect sensitive application information from unauthorized access
Solution
Step 1: Understand actuator endpoints role
Actuator endpoints provide information about the app's health, metrics, and configuration.
Step 2: Recognize security importance
Since these endpoints expose sensitive data, securing them prevents unauthorized users from accessing this info.
Final Answer:
To protect sensitive application information from unauthorized access -> Option D
Quick Check:
Actuator security = protect info [OK]
Hint: Actuator endpoints show app info; protect them from strangers [OK]
Common Mistakes:
Thinking actuator endpoints improve performance
Assuming all endpoints should be open
Believing security auto-applies without config
2. Which property correctly exposes only the health and info actuator endpoints in application.properties?
easy
A. management.endpoints.web.expose=health,info
B. management.endpoints.web.exposure.include=health,info
C. management.endpoints.exposure.include=health,info
D. management.web.endpoints.include=health,info
Solution
Step 1: Identify correct property name
The correct property to expose endpoints is management.endpoints.web.exposure.include.
Step 2: Verify property value format
Comma-separated list of endpoints like health,info is correct.
Final Answer:
management.endpoints.web.exposure.include=health,info -> Option B
A. The requestMatchers pattern is incorrect syntax
B. The method should return void, not SecurityFilterChain
C. Actuator endpoints require login but other URLs are open, risking security
D. The configuration disables all security
Solution
Step 1: Review authorization rules order
Actuator endpoints require authentication, but all other requests are permitted without login.
Step 2: Identify security risk
This means non-actuator URLs are open, which might expose sensitive parts unintentionally.
Final Answer:
Actuator endpoints require login but other URLs are open, risking security -> Option C
Quick Check:
PermitAll on anyRequest risks open access [OK]
Hint: Check if anyRequest().permitAll() opens unwanted URLs [OK]
Common Mistakes:
Thinking method return type is wrong
Assuming requestMatchers syntax is invalid
Believing security is fully disabled
5. You want to expose only the health endpoint publicly and secure all other actuator endpoints to ADMIN role. Which configuration achieves this correctly?
hard
A. Expose health only and configure security to permit all on /actuator/health and ADMIN role on /actuator/** except health
B. Expose all endpoints and secure only /actuator/health to ADMIN role
C. Expose health and info endpoints and allow anonymous access to all actuator URLs
D. Expose no endpoints and disable security for actuator URLs
Solution
Step 1: Set exposure property
Use management.endpoints.web.exposure.include=health to expose only health publicly.
Step 2: Configure security rules
Permit all access to /actuator/health and require ADMIN role for other actuator endpoints using requestMatchers.
Final Answer:
Expose health only and configure security to permit all on /actuator/health and ADMIN role on /actuator/** except health -> Option A
Quick Check:
Expose health public + secure others ADMIN [OK]
Hint: Expose health only, secure others with ADMIN role [OK]
Common Mistakes:
Exposing too many endpoints publicly
Not securing non-health actuator endpoints
Allowing anonymous access to sensitive endpoints
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.