Bird
0
0

You want to expose only the health endpoint publicly and secure all other actuator endpoints to ADMIN role. Which configuration achieves this correctly?

hard📝 Application Q15 of 15
Spring Boot - Actuator
You want to expose only the health endpoint publicly and secure all other actuator endpoints to ADMIN role. Which configuration achieves this correctly?
AExpose health only and configure security to permit all on /actuator/health and ADMIN role on /actuator/** except health
BExpose all endpoints and secure only /actuator/health to ADMIN role
CExpose health and info endpoints and allow anonymous access to all actuator URLs
DExpose no endpoints and disable security for actuator URLs
Step-by-Step Solution
Solution:
  1. Step 1: Set exposure property

    Use management.endpoints.web.exposure.include=health to expose only health publicly.
  2. Step 2: Configure security rules

    Permit all access to /actuator/health and require ADMIN role for other actuator endpoints using requestMatchers.
  3. Final Answer:

    Expose health only and configure security to permit all on /actuator/health and ADMIN role on /actuator/** except health -> Option A
  4. Quick Check:

    Expose health public + secure others ADMIN [OK]
Quick Trick: 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

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes