Skip to content
Draft
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-actuator")

//spring security
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ protected boolean shouldNotFilter(HttpServletRequest request) {

return uri.startsWith("/api/auth/sign-in")
|| uri.startsWith("/api/auth/refresh")
|| uri.startsWith("/api/user/sign-up");
|| uri.startsWith("/api/user/sign-up")
|| uri.startsWith("/actuator/health");
}

Choose a reason for hiding this comment

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

/actuator/health 엔드포인트는 인증 없이 접근 가능하도록 설정되었는데, 이는 헬스체크 목적에 부합합니다. 다만, Actuator는 헬스체크 외에도 다양한 관리 기능을 제공하며, 민감한 정보가 노출될 수 있습니다. 필요하다면, 헬스체크 외 다른 Actuator 엔드포인트에 대한 접근 제어를 고려해보시는 것이 좋습니다. 예를 들어 management.endpoints.web.exposure.include=health,info 설정을 통해 노출되는 엔드포인트를 제한할 수 있습니다.

또한, Actuator 엔드포인트에 대한 보안 설정을 강화하기 위해 management.endpoint.health.show-details=when-authorized 설정을 고려하여, 인증된 사용자에게만 상세 정보를 노출하도록 설정하는 것도 좋은 방법입니다.


private void validToken(final Authentication authentication, final String token) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ SecurityFilterChain filterChain(HttpSecurity http, CustomOAuth2UserService oAuth
"/swagger-ui/**",
"/v3/api-docs/**",
"/api/auth/refresh",
"/api/user/sign-up")
"/api/user/sign-up",
"/actuator/health")
.permitAll()
.anyRequest()
.authenticated())
Expand Down
Loading