Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active December 29, 2024 06:17
Show Gist options
  • Save sandipchitale/f30b624d05bdbc5cd221116eec1ef0a2 to your computer and use it in GitHub Desktop.
Save sandipchitale/f30b624d05bdbc5cd221116eec1ef0a2 to your computer and use it in GitHub Desktop.
RequestMatcher for all Actuator paths #actuator
management:
endpoints:
enabled-by-default: true
web:
exposure:
# Enable all
include: "*"
# Change from default /actuator to /mamamia
base-path: "/mamamia"
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
httpSecurity
.authorizeHttpRequests(auth -> {
auth.requestMatchers(EndpointRequest.toAnyEndpoint()).permitAll();
auth.anyRequest().fullyAuthenticated();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment