Actuator Endpoints & Exposure
The Actuator endpoint surface: what ships built in, the loggers and diagnostics endpoints, exposure control over web and JMX, writing your own, securing them, audit events and the info endpoint. Interviewers ask about exposure first, because a public /actuator/env leaks configuration.
part ofSpring Frameworkoverview, primer and where to startread it →on this pageshowhide
explore
- Built-in Endpoints Catalog6 questions
- loggers Endpoint5 questions
- threaddump, heapdump & httpexchanges5 questions
- Endpoint Exposure over Web & JMX5 questions
- Writing Custom Endpoints6 questions
- Securing Actuator Endpoints5 questions
- auditevents Endpoint & AuditEventRepository5 questions
- info Endpoint & InfoContributor5 questions
questions
page 2 of 2How does the Actuator loggers endpoint actually change the level of a running app, and why does the same endpoint work across Logback, Log4j2, and JUL?
basics
~20 sThe endpoint doesn't touch Logback directly. It calls Spring Boot's LoggingSystem abstraction, which has implementations for Logback, Log4j2, and JUL. Boot picks the right one from the classpath, so the endpoint mutates whatever backend is present through one uniform API.
How does Spring Boot prevent /env and /configprops from leaking secrets, and how do you control value masking?
basics
~20 sEven for authorized users, /env and /configprops mask sensitive values. By default keys like password, secret, key, token and credentials are shown as '******', and since Boot 3 all values are hidden unless you set show-values to ALWAYS or WHEN_AUTHORIZED. You can add custom SanitizingFunction beans.
What are the security benefits and pitfalls of running Actuator on a separate management port?
basics
~20 sSetting management.server.port to a different port than the app moves /actuator off the public port. Bind it to an internal address (management.server.address=127.0.0.1 or a private interface) so only ops/monitoring on the internal network can reach it, adding network-level isolation on top of Spring Security.
How would you use the auditevents endpoint safely and effectively for a production, multi-instance service?
basics
~20 sTreat the endpoint as sensitive: expose it only behind admin auth (ideally a separate management port), don't rely on the volatile per-node in-memory store for compliance, forward audit events to a durable central store/SIEM, scrub secrets from the data map, and set retention policies.
Explain the composite structure behind /actuator/health: how the overall status is aggregated, how health groups and readiness/liveness probes fit in, and what edge cases you must handle.
basics
~20 sThe health endpoint composes many HealthIndicator/HealthContributor beans into a tree. A StatusAggregator reduces their statuses to one overall status (by default the worst wins, e.g. any DOWN → overall DOWN). Health groups (like readiness, liveness) expose subsets at /actuator/health/{group} for Kubernetes probes.
How are custom Actuator endpoints discovered and registered, and what are the exposure/security implications of adding a @WriteOperation endpoint in production?
basics
~20 sActuator scans @Endpoint-annotated beans via EndpointDiscoverers and registers them per technology (web/JMX). A @WriteOperation is a POST that mutates state, so you must both restrict web exposure (not *) and secure it — require an ADMIN role for /actuator/**, and treat it like any mutating API.
How would you safely expose these diagnostic endpoints in production, given heapdump/threaddump can leak sensitive data?
basics
~10 sDon't expose them publicly. Keep only health public, put diagnostic endpoints behind authentication/authorization, ideally on a separate internal management port, and restrict access to operators. Treat any heap dump as a secret.
What are the security and exposure considerations when publishing /actuator/info, and how would you govern them?
basics
~20 sThe info endpoint can leak build/git details, environment metadata, and (in git full mode) remote URLs and committer emails. Control exposure with management.endpoints.web.exposure.include, protect Actuator with authentication, keep git.mode=simple, and never place secrets in info.* or custom contributors.
The loggers endpoint can change log levels at runtime. What are the security and operational risks of exposing it in production, and how would you govern it?
basics
~20 sIt is a state-changing endpoint: anyone who can POST can flip logging to TRACE, causing log floods, performance hits, disk exhaustion, and possible leakage of sensitive data in verbose logs. Protect it behind authentication/authorization, don't expose it publicly, and audit changes.
Design a production-grade defense-in-depth strategy for locking down Actuator across exposure, authorization, data masking, and network.
basics
~20 sCombine independent layers: expose only needed endpoints, guard them with a SecurityFilterChain requiring an admin role via EndpointRequest.toAnyEndpoint(), keep /env and /configprops values masked (show-values NEVER or WHEN_AUTHORIZED), disable dangerous ones like /shutdown, and isolate the management port to an internal network.
What are logger groups in Spring Boot, and how do they interact with the loggers endpoint?
basics
~20 sA logger group is a named alias for several loggers, defined with logging.group.<name>=pkg1,pkg2. You can then POST a level to that group name via the loggers endpoint and it changes all members at once. Spring predefines web and sql groups.
Web and JMX exposure are configured separately. Discuss the design rationale and how you'd harden exposure for a production service.
basics
~20 sWeb and JMX each have their own include/exclude sets so you can surface an endpoint on one transport but not the other. In prod, keep web to a minimal allow-list (or a separate internal port), avoid *, and layer Spring Security on top.
showing 31–42 of 42