Java 健康终点仅表示“健康”;状态:向上“;而且不会显示敏感信息

Java 健康终点仅表示“健康”;状态:向上“;而且不会显示敏感信息,java,spring-security,spring-boot,endpoint,health-monitoring,Java,Spring Security,Spring Boot,Endpoint,Health Monitoring,我用ResourceServerConfigurerAdapeer设置了一个spring展位。我想显示我的健康终点的敏感数据,但它只显示 {状态:UP} spring.profiles.active:oauth endpoints.health.sensitive:false 这是我从Spring文档中读到的内容 HealthIndicators返回的信息在本质上往往有些敏感。例如,您可能不想向世界发布数据库服务器的详细信息。因此,默认情况下,只有运行状况状态通过未经验证的HTTP连接公开。如果

我用ResourceServerConfigurerAdapeer设置了一个spring展位。我想显示我的健康终点的敏感数据,但它只显示

{状态:UP}

spring.profiles.active:oauth
endpoints.health.sensitive:false

这是我从Spring文档中读到的内容

HealthIndicators返回的信息在本质上往往有些敏感。例如,您可能不想向世界发布数据库服务器的详细信息。因此,默认情况下,只有运行状况状态通过未经验证的HTTP连接公开。如果您希望始终公开完整的运行状况信息,可以将endpoints.health.sensitive设置为false

我们如何显示其他信息


谢谢。

我遇到了一个类似的问题,我可以通过将这一行添加到application.properties文件来解决

# Disable security for actuator endpoints
management.security.enabled=false

# Disable sensitive filter for the health endpoint
endpoints.health.sensitive=false
这将禁用所有执行器端点的安全性,因此请注意这一点。我建议关闭所有端点,只启用您需要的端点,例如

# Set all actuator endpoints disabled by default
endpoints.enabled=false
要启用
运行状况
端点,您可以执行以下操作:

endpoints.health.enabled=true
我希望这对你有帮助


另请参见Github存储库中有关Spring Actuator的内容。

我在添加一些属性时解决了这个问题:

## HEALTH
endpoints.health.enabled.sensitive=false

management.health.db.enabled=true

management.health.defaults.enabled=true

management.health.diskspace.enabled=true

management.security.enabled=false

endpoints.enabled=false

endpoints.health.enabled=true
并显示Json{“状态”:“,”磁盘空间”:{},“数据库”:“}。希望能帮助你