弹簧启动执行器 - 端点灵敏度与安全启用

时间:2017-09-20 15:47:51

标签: java spring spring-boot spring-boot-actuator

我一直在阅读弹簧启动执行器,我很难区分两个application.properties设置

endpoints.sensitive vs management.security.enabled

我想自定义执行器端点的访问规则。我可以使用endpoints.sensitive属性控制所有actuator endpoint sensitivity。我的理解是敏感端点需要授权。我还可以通过management.security.enabled属性change the accessibility获得端点。

灵敏度控制与安全性支持之间的区别是什么?

1 个答案:

答案 0 :(得分:1)

在执行器端点的情况下,敏感"意味着“可能会发出敏感信息”。所以隐含需要进行身份验证。因此,如果您设置endpoints.sensitive=true,那么management.security.enabled也将成立。相反,如果您设置management.security.enabled=false,则您的端点隐式不敏感。

Springs文档提供了一个简洁的表格,其中概述了可能的选择:

management.security.enabled | endpoints.health.sensitive |Unauthenticated |Authenticated (with right role)
--------------------------- | -------------------------- |--------------- |--------------------------------
false                       | *                          | Full content   | Full content
true                        | false                      | Status only    | Full content
true                        | true                       | No content     | Full content