Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http, RememberMeServ
.requestMatchers("/auth-login.html", "/auth-signup.html").permitAll()
.requestMatchers("/admin/**", "/api/admin/**", "/api/v2/admin/**").hasRole("ADMIN")
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/api-docs/**", "/swagger-ui.html").permitAll()
.requestMatchers("/actuator/**").permitAll()
.requestMatchers("/actuator/**").hasRole("ADMIN")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 /actuator/** 경로에 대해 ADMIN 권한을 요구하도록 변경하여 민감한 엔드포인트(예: /actuator/env, /actuator/heapdump 등)를 보호하는 것은 좋은 보안 조치입니다.

다만, Prometheus 등 외부 모니터링 시스템이 /actuator/prometheus/actuator/info와 같은 엔드포인트를 주기적으로 수집(Scraping)해야 하는 경우, 모니터링 시스템에 과도한 권한(ADMIN)을 부여해야 하거나 수집이 차단될 수 있습니다.

권장 사항:
최소 권한 원칙(Principle of Least Privilege)을 준수하기 위해, 모니터링 전용 역할(예: MONITORING)을 추가로 정의하고 hasAnyRole을 사용하여 권한을 부여하는 것을 고려해 보세요.

(참고: /actuator/healthhealthSecurityFilterChain에서 이미 permitAll()로 설정되어 있으므로 이 변경의 영향을 받지 않습니다.)

Suggested change
.requestMatchers("/actuator/**").hasRole("ADMIN")
.requestMatchers("/actuator/**").hasAnyRole("ADMIN", "MONITORING")

.requestMatchers("/api/groups/**").authenticated()
.anyRequest().authenticated()
)
Expand Down
Loading