当前位置: 首页 > 知识库问答 >
问题:

Spring引导执行器-endpoint灵敏度与安全启用

傅俊德
2023-03-14

我一直在阅读Spring引导执行器,我很难区分两个应用程序。属性设置

我想自定义执行器endpoint的访问规则。我可以使用endpoints.sensitive属性控制所有执行器endpoint灵敏度。我的理解是,敏感endpoint将需要授权。我还可以通过management.security.enabled属性更改endpoint的可访问性。

敏感度控制和安全启动之间有什么区别?

共有1个答案

刘京
2023-03-14

在执行器endpoint的上下文中,“敏感”意味着类似于“可能发出敏感信息”的东西,因此存在对身份验证的隐含需求。因此,如果设置endpoints.sensitive=true,则management.security.enabled也将为true。相反,如果设置management.security.enabled=false,则您的endpoint是隐式不敏感的。

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
 类似资料:
  • Spring Boot执行器的两个版本(1.2.5和1.3.0)在HealthMvcEndpoint,isUnrestricted()方法(&&and)中的实现存在差异。我明白这是为了保留这些限制 http://docs.spring.io/spring-boot/docs/current-snapshot/reference/htmlsingle/#production-ready-health

  • 我已经通过浏览器中的令牌读取访问敏感的Spring引导执行器endpoint,因为它接近我需要的,但我不一定需要浏览器,这个问题没有答案。 与教程相反,我在pom.xml中包含了spring-boot-starter-actuator作为依赖项。 我的application.properties如下所示: 我的AccountUserDetailsService如下所示: 我包含了角色“role_a

  • 我在我的应用程序中使用了Spring-Boot1.3.1和Spring-Boot-Actutor。我使用作为中的父级。 为了禁用安全性,我在中添加了2个条目。 它仍然没有禁用基本的安全性。当我在本地Tomcat中启动应用程序时,我看到日志文件中的默认密码。

  • 我使用Spring Boot ()和Jersey (pom依赖项:< code > spring-boot-starter-Jersey ,< code > spring-boot-starter-actuator ,< code > spring-boot-starter-web ,< code > spring-boot-starter-security )。 我有一个泽西岛endpoint(

  • {“Status”:“Down”} 我需要做什么才能显示自定义健康状况指示器?

  • 首先,我是Spring启动框架的新手。我已经在执行器上工作了几天,并且能够设置endpoint来监控系统。当我集成JWT以确保安全性时,我的所有执行器endpoint都坏了。 如何禁用位于Spring启动安全性之上的执行器endpoint的JWT安全性?以下是我的application.yml文件属性。