官术网_书友最值得收藏!

Changing the sensitivity of the Actuator's endpoints

By default, many of the Actuator's endpoints are sensitive. All default endpoints in Spring Boot Actuator are automatically sensitive. Hence the endpoints can be secured by using default properties for fault security. These include username, password, and role, within the properties file of your application. But you can also mark sensitive as false if the endpoint doesn't expose sensitive information, as follows:

endpoints._endpoint-id.sensitive = false 

In the application.yml file, it would look like the following:

endpoints:
   _endpoint-id:
         sensitive: false 

You can also set it to true if all endpoints expose sensitive information.

For example, let's set the /health endpoint's sensitive value to false:

endpoints.health.sensitive=false 

Or in application.yml file:

endpoints:
   health:
         sensitive: false 

Now you can access the /health endpoint without any authentication security.

Spring Boot Actuators also allows you to create your own endpoint, with your own configurations and implementations. To do so, all you have to do is implement the endpoint interface and override its method.

主站蜘蛛池模板: 呼和浩特市| 襄垣县| 临湘市| 林州市| 鸡西市| 石嘴山市| 祥云县| 阿勒泰市| 大新县| 理塘县| 沁阳市| 神木县| 麻栗坡县| 四川省| 修文县| 金坛市| 广西| 陈巴尔虎旗| 吴旗县| 永昌县| 桐庐县| 灵台县| 大竹县| 色达县| 昭觉县| 三门峡市| 阳原县| 北海市| 雅安市| 亳州市| 运城市| 武夷山市| 新疆| 怀仁县| 沙河市| 晋宁县| 石家庄市| 湘潭县| 五峰| 文昌市| 冷水江市|