title: How to disable security on management port in Spring Boot 2
body: <p>I have the <strong>/actuator/</strong> Endpoints (in my case <strong>manage</strong>) on Port 6565. Is it possible to disable Security in Spring Boot 2 only for a specific port? At the moment I can only exclude certain paths from security. That would be insecure if I now run Enpoints under the main application port 1337 under /manage/. In the past we used <strong>management.security.enabled: false</strong> or was that path related too?</p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
                  .authorizeRequests()
                  .antMatchers("/manage/**").permitAll()
                  .anyRequest().authenticated().and().httpBasic().realmName("Hay, the Config Server is here");
  
      }
  }
  </code></pre>
  
  <p>application.yml</p>
  
  <pre><code>spring:
    cloud:
      config:
        server:
          git:
            uri: https://bitbucket.xxx.net/scm/gpi/springconfiguration.git
            username: xxx
            password: xxx
            searchPaths: application-*
            force-pull: true
    security:
      user:
        name: xxxUser
        password: xxx
  server:
    port: 1337
    address: 0.0.0.0
  management:
      server:
        port: 6565
      metrics:
        export:
          prometheus:
            enabled: true
      endpoints:
        web:
          exposure:
            include: '*'
          base-path: /manage
      endpoint:
        prometheus:
          enabled: true
  </code></pre>