1. HTTP Basic 인증http.httpBasic(Customizer.withDefaults());클라이언트에서 Header를 통해 Authorization: Basic base64(id:pw) 형태로 요청BasicAuthenticationFilter 필터가 SecurityFilterChain에 추가되어 (Basic Authentication 활성화)Basic Authentication 인증 방식- Authorization 헤더에 username:password ID/PW 인증 정보를 Base64 인코딩 후 전송- Authorization 헤더 형태 :: Authorization: Basic {base64(usename:password)}1.1 처리 흐름1. BasicAuthenticationFil..
1. WebSecurityCustomizer:: Spring Security 내 모든 보안 설정에 대한 예외 설정:: Spring Security는 정적 리소스나 헬스체크 같은 요청은 필터 체인을 아예 사용 X 가능1.1 WebSecurityCustomizer 설정 비교1. 필터 사용 X@Beanpublic WebSecurityCustomizer webSecurityCustomizer() { return (web) -> web.ignoring() .requestMatchers("/health", "/health/**", "/publics/**");}web.ignoring(): 필터 자체를 타지 않음 (SecurityFilterChain 적용하지 않을 예외 URL 규칙 설정)authori..

1. sessionManagement():: 인증 완료 시, 세션관리에 대한 내용 :: 세션 수 제한 및 세션 고정 공격 방어http.sessionManagement(session -> session .sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED) // “Spring Security 로직에서” HttpSession 생성하여 사용할지 여부 .sessionFixation(sessionFixation -> sessionFixation.changeSessionId()) // Session Fixation 세션 고정 공격 방어를 위한 ID 변경 // .sessionCreationPolicy(SessionCreationPolicy.STATEL..

1. csrf()1.1 정의CSRF(Cross-Site Request Forgery) :: 인증된 사용자의 권한을 악용한 요청 위조 공격 :: 악의적인 웹사이트가 사용자를 속여, 사용자가 로그인한 상태에서 웹사이트에 의도하지 않은 요청을 보내는 공격:: CSRF 방지를 위한 CSRF Token 통한 방어책 제공( POST, PUT, DELETE 등 상태 변경 요청에 대해 CSRF 토큰이 필요) // CORS가 방지하지 못하는 FORM 및 IMG 태그를 통한 CSRF 공격의 예// CSRF에 대해 CORS로 일부는 방지할 수 있지만 네이티브 앱과 FORM 통한 공격은 토큰으로만 방어가능// 1) 이미지 태그를 이용한 GET 방식 CSRF 예시// 2) 폼 자동 제출을 이용한 POST 방식 CSRF 예시 ..
0. SecurityConfig 클래스- Spring Security 5.7 :: 메서드를 통해 파라미터 주입받아 세부설정- Spring Security 5.8+ :: 직접 세부설정한 객체를 @Bean 으로 반환@Configuration@EnableWebSecuritypublic class SecurityConfig { // Spring Security 설정은 보통 하나의 설정 클래스로 구성 @Bean public AuthenticationManager authenticationManager() { ... } @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { ... } @B..
- Total
- Today
- Yesterday
- ASAC
- useReducer
- asac7#asac
- useCallback
- asac7
- useState
- memo
- acas#acas7기
- useMemo
- Nginx
- useRef
- git
- acac
- useContext
- ssh
- react
- useEffect
- asac#asac7기
- useLayoutEffect
- asac7기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |