我一直在阅读弹簧启动执行器,我很难区分两个application.properties设置
endpoints.sensitive
vs management.security.enabled
我想自定义执行器端点的访问规则。我可以使用endpoints.sensitive
属性控制所有actuator endpoint sensitivity。我的理解是敏感端点需要授权。我还可以通过management.security.enabled
属性change the accessibility获得端点。
灵敏度控制与安全性支持之间的区别是什么?
答案 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