Enable Spring Boot Actuator with limited exposure and secure /actuator/mappings endpoint access.

This commit is contained in:
akastijn 2026-07-19 00:08:46 +02:00
parent dde66bd608
commit 5b28f2b707
3 changed files with 3 additions and 0 deletions

View File

@ -43,6 +43,7 @@ dependencies {
//Open API //Open API
implementation("io.swagger.core.v3:swagger-annotations:2.2.37") implementation("io.swagger.core.v3:swagger-annotations:2.2.37")
implementation("io.swagger.core.v3:swagger-models:2.2.37") implementation("io.swagger.core.v3:swagger-models:2.2.37")
implementation("org.springframework.boot:spring-boot-starter-actuator")
//AOP //AOP
implementation("org.aspectj:aspectjrt:1.9.19") implementation("org.aspectj:aspectjrt:1.9.19")

View File

@ -56,6 +56,7 @@ public class SecurityConfig {
auth -> auth auth -> auth
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.requestMatchers("/api/chat/send/**").access(allowedIpCheck) .requestMatchers("/api/chat/send/**").access(allowedIpCheck)
.requestMatchers("/actuator/mappings").access(allowedIpCheck)
.requestMatchers("/api/form/**").authenticated() .requestMatchers("/api/form/**").authenticated()
.requestMatchers("/api/login/getUsername").authenticated() .requestMatchers("/api/login/getUsername").authenticated()
.requestMatchers("/api/mail/**").authenticated() .requestMatchers("/api/mail/**").authenticated()

View File

@ -19,3 +19,4 @@ spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.enable=true spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
chat.allowed-ip=${ALLOWED_IP:10.0.0.0/24} chat.allowed-ip=${ALLOWED_IP:10.0.0.0/24}
management.endpoints.web.exposure.include=mappings