通过hawt.io访问时确保jolokia执行器端点不起作用

时间:2018-10-16 16:56:49

标签: spring-boot spring-boot-actuator hawtio

我已经安装了hawtio 2.1.0,它连接到Spring Boot 2.0.5应用程序暴露的jolokia端点。

我的应用程序Yaml包含

management:
  endpoints:
    enabled-by-default: true
    web:
      exposure:
        include: "jolokia"
    jmx:
      exposure:
        exclude: "*"
  endpoint:
    jolokia:
      enabled: true
      config:
        debug: true

此外,我还有一个过滤器

@Configuration
public class ActuatorSecurity extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .requestMatchers(EndpointRequest.to(ShutdownEndpoint.class))
                .hasRole("ADMIN")
                .requestMatchers(EndpointRequest.to(HealthEndpoint.class, InfoEndpoint.class))
                .permitAll()
                .requestMatchers(EndpointRequest.toAnyEndpoint())
                .fullyAuthenticated()
                .and().httpBasic();
    }

当我在浏览器中访问jolokia执行器端点时,它会正确地要求我提供凭据。 因此,使用这种方法可以保护端点。

当我通过hawt.io Web应用程序连接到jolokia端点时,不需要提供任何凭据。如果hawt.io在运行Spring Boot应用程序的远程或本地机器上运行,则没有区别。 Hawt.io能够通过jolokia获取所有MBean信息。

那怎么可能? Hawt.io在某种程度上绕过了大关节运动执行器端点的固定。

有什么想法,或者为什么我可以保护jolokia执行器端点,以便甚至hawt.io都提示输入凭据?

非常感谢!

欢呼

橄榄

0 个答案:

没有答案