add 增加 springboot actuator 账号密码认证 杜绝内外网信息泄漏问题

This commit is contained in:
疯狂的狮子Li
2024-07-24 18:56:40 +08:00
parent 0a3d5fd5d4
commit 105c007f03
7 changed files with 36 additions and 3 deletions

View File

@ -39,9 +39,7 @@ public class SecurityConfig {
.authorizeHttpRequests((authorize) ->
authorize.requestMatchers(
new AntPathRequestMatcher(adminContextPath + "/assets/**"),
new AntPathRequestMatcher(adminContextPath + "/login"),
new AntPathRequestMatcher("/actuator"),
new AntPathRequestMatcher("/actuator/**")
new AntPathRequestMatcher(adminContextPath + "/login")
).permitAll()
.anyRequest().authenticated())
.formLogin((formLogin) ->

View File

@ -41,5 +41,8 @@ spring.boot.admin.client:
url: http://localhost:9090/admin
instance:
service-host-type: IP
metadata:
username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password}
username: ruoyi
password: 123456