I have a very simple spring boot application. This is just a zuul reverse proxy. there is no security or anything but basic settings to open our services through eureka and route matching based on each service. I'm trying to prevent our actuator endpoints from being publicly exposed, but still want the health check endpoint to be used for our ELB, but you want it not to report the health of all the services that it knows about (I want to be sensitive). When I try to figure out what properties I need to configure to get the expected behavior, I experience very unexpected behavior.
For example, when I set the endpoints.sensitive=true property, this does NOT change the default value of the health check endpoint to be sensitive. This seems to contradict what the documentation says.
http://docs.spring.io/spring-boot/docs/1.4.2.RELEASE/reference/htmlsingle/#production-ready-customizing-endpoints
Similarly, you can also select the global flag โsensitiveโ to all endpoints. By default, the sensitive flag depends on the type of endpoint (see table above). For example, to mark all endpoints as sensitive, except for information:
endpoints.sensitive = true
endpoints.info.sensitive = false
In fact, when I run in debugging, I never see a call to org.springframework.boot.actuate.endpoint.EndpointProperties#isSensitive .
In order for the health endpoint to be sensitive, I need to explicitly set the endpoints.health.sensitive=true property. Oddly enough, when this parameter is provided, org.springframework.boot.actuate.endpoint.EndpointProperties#isSensitive is now called.
So this is great, my health checkpoint now just reports UP or DOWN and nothing else. But now I want the health check endpoint to be the endpoint ONLY. Therefore, I set endpoints.enabled=false and endpoints.health.enabled=true , which should disable all endpoints except health. However, this does not seem to be the case. In my case, I can click /routes , /resume , /pause , /hystrix.stream and others. I was only able to determine this when I turned off all endpoints using endpoints.enabled=false and then turned on the endpoint of the actuator using endpoints.actuator.enabled=true , and this allowed me to hit the endpoint of the actuator, after which reported that these endpoints were included.
{ "links": [ { "rel": "self", "href": "http://localhost:9200/actuator" }, { "rel": "resume", "href": "http://localhost:9200/resume" }, { "rel": "pause", "href": "http://localhost:9200/pause" }, { "rel": "hystrix.stream", "href": "http://localhost:9200/hystrix.stream" }, { "rel": "env", "href": "http://localhost:9200/env" }, { "rel": "routes", "href": "http://localhost:9200/routes" }, { "rel": "health", "href": "http://localhost:9200/health" }, { "rel": "refresh", "href": "http://localhost:9200/refresh" }, { "rel": "restart", "href": "http://localhost:9200/restart" } ] }
I would expect ONLY to look at the two endpoints that I explicitly resolved.
{ "links": [ { "rel": "self", "href": "http://localhost:9200/actuator" }, { "rel": "health", "href": "http://localhost:9200/health" } ] }
disabling each endpoint individually does not seem to be deleted from the endpoint of the actuator, but now when you try to access, I get the message "This endpoint is disabled", which is an improvement. However, I cannot turn off the routes or `hystrix.stream * endpoints, because there seems to be no configuration that provides this feature.
All this said, I wonder if this is the expected behavior or is it a mistake?