I did this presentation for one of my java user groups at work.
Basically, this is a mashed up version of various presentations, slides and images that I gathered over the internet.
I've quoted the sources in the end. Feel free to reuse it as you like.
I did this presentation for one of my java user groups at work.
Basically, this is a mashed up version of various presentations, slides and images that I gathered over the internet.
I've quoted the sources in the end. Feel free to reuse it as you like.
배민찬(https://www.baeminchan.com) 서비스의 백엔드 시스템 중 일부가 지난 1년간 어떤 고민과 아이디어, 결과물을 만들어냈는지 공유하려고 합니다. 발표 중 언급되는 용어나 도구에 대해 일반적인 정의나 간단한 설명은 언급되나 자세히 다루지 않습니다. 사용된 도구들로 어떻게 이벤트 기반 분산 시스템을 만들었는지에 대한 이야기가 중심입니다.
마이크로서비스 스타일로 만들어진 시스템을 모노리틱 스타일로 이관한 사례와 함께 스프링을 이용해 모듈형 모노리스(modular monoliths)를 만든 경험을 바탕으로 모노리틱/마이크로서비스 보다 본질적인 문제를 제기하고, 문제 해결을 위한 아이디어와 코드를 공유합니다.
https://github.com/arawn/building-modular-monoliths-using-spring
이 자료는 2019년 KSUG 세미나에서 진행한 "잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다"를 기반으로 몇가지 내용을 추가하고, 전개 방식을 다듬어 조금 더 친절하게 만들어졌습니다.
Discussed the general OAuth2 features. Reviewer OAuth2 Roles and Grand Flows
Authorization code grant flow
Implicit grant flow
Resource owner password credentials grant flow
Client credentials grant flow
Reviewed access resource flow and token refresh.
see video: https://www.youtube.com/watch?v=UPsVD-A7gP0
In this Java Spring Training session, you will learn Spring – Inversion of Control, Dependency Injection and Bean definitions. Topics covered in this session are:
For more information, visit this link:
Spring Framework
• Core Container
• Data Access/Integration
• Web Layer
• Spring Setup
• Key features
• Spring Bean
• Dependency Injection
• Relation between DI and IoC
• Spring IoC Containers
• Spring DI
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
Spring Data is a high level SpringSource project whose purpose is to unify and ease the access to different kinds of persistence stores, both relational database systems and NoSQL data stores.
JPA의 기본 개념에 대해 설명하고 MyBatis로 작성된 애플리케이션을 JPA로 리팩토링하는 과정을 단계별로 살펴봅니다.
목차
1. MyBatis
2. Why JPA?
3. MyBatis to JPA
- JPA 설정
- Entity
- 연관관계 설정
- Repository
- 애플리케이션에서의 사용
대상
- MyBatis를 실무에 사용하고 있으면서 JPA 도입을 고려하고 있는 백엔드 개발자
- JPA를 적용하면서 어려움을 겪었거나 JPA를 실제 적용하는 과정이 궁금한 개발자
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
Stormpath .NET Developer Evangelist, Nate Barbettini, presents Token Authentication with ASP.NET Core. Nate will explain how Token Authentication can be used to secure web applications built with ASP.NET Core, REST APIs, and 'unsafe' clients while supporting security best practices and even improving performance and scale.
배민찬(https://www.baeminchan.com) 서비스의 백엔드 시스템 중 일부가 지난 1년간 어떤 고민과 아이디어, 결과물을 만들어냈는지 공유하려고 합니다. 발표 중 언급되는 용어나 도구에 대해 일반적인 정의나 간단한 설명은 언급되나 자세히 다루지 않습니다. 사용된 도구들로 어떻게 이벤트 기반 분산 시스템을 만들었는지에 대한 이야기가 중심입니다.
마이크로서비스 스타일로 만들어진 시스템을 모노리틱 스타일로 이관한 사례와 함께 스프링을 이용해 모듈형 모노리스(modular monoliths)를 만든 경험을 바탕으로 모노리틱/마이크로서비스 보다 본질적인 문제를 제기하고, 문제 해결을 위한 아이디어와 코드를 공유합니다.
https://github.com/arawn/building-modular-monoliths-using-spring
이 자료는 2019년 KSUG 세미나에서 진행한 "잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다"를 기반으로 몇가지 내용을 추가하고, 전개 방식을 다듬어 조금 더 친절하게 만들어졌습니다.
Discussed the general OAuth2 features. Reviewer OAuth2 Roles and Grand Flows
Authorization code grant flow
Implicit grant flow
Resource owner password credentials grant flow
Client credentials grant flow
Reviewed access resource flow and token refresh.
see video: https://www.youtube.com/watch?v=UPsVD-A7gP0
In this Java Spring Training session, you will learn Spring – Inversion of Control, Dependency Injection and Bean definitions. Topics covered in this session are:
For more information, visit this link:
Spring Framework
• Core Container
• Data Access/Integration
• Web Layer
• Spring Setup
• Key features
• Spring Bean
• Dependency Injection
• Relation between DI and IoC
• Spring IoC Containers
• Spring DI
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
Spring Data is a high level SpringSource project whose purpose is to unify and ease the access to different kinds of persistence stores, both relational database systems and NoSQL data stores.
JPA의 기본 개념에 대해 설명하고 MyBatis로 작성된 애플리케이션을 JPA로 리팩토링하는 과정을 단계별로 살펴봅니다.
목차
1. MyBatis
2. Why JPA?
3. MyBatis to JPA
- JPA 설정
- Entity
- 연관관계 설정
- Repository
- 애플리케이션에서의 사용
대상
- MyBatis를 실무에 사용하고 있으면서 JPA 도입을 고려하고 있는 백엔드 개발자
- JPA를 적용하면서 어려움을 겪었거나 JPA를 실제 적용하는 과정이 궁금한 개발자
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
Stormpath .NET Developer Evangelist, Nate Barbettini, presents Token Authentication with ASP.NET Core. Nate will explain how Token Authentication can be used to secure web applications built with ASP.NET Core, REST APIs, and 'unsafe' clients while supporting security best practices and even improving performance and scale.
사물인터넷(IoT) 제품·서비스의 개발자를 위한 안내지침인 ‘IoT 공통 보안가이드’가 나왔다. 안전성이 검증된 보안기술을 활용하고, 보안취약점이 발견되면 사용자에게 알려야 한다는 등의 내용이 담겼다.
미래창조과학부는 27일 서울 중구 프레스센터에서 열린 ’2016년 사물인터넷(IoT) 보안 얼라이언스 제3차 정기회의’에서 7개 대원칙과 15개 항목으로 구성된 보안가이드의 세부내용을 발표했다.
지난해 6월 나온 ‘IoT 공통보안 7대 원칙’을 구체화한 것으로, IoT 기기의 개발부터 폐기까지 전 주기에 걸친 기술적 권고사항을 포함했다.
미래부는 “보안가이드가 IoT 제품·서비스에 대한 종합적인 보안 체크리스트 기능을 수행함으로써 IoT 산업, 특히 인력·기술이 취약한 중소기업의 경쟁력 강화에 도움이 될 것”이라고 설명했다.
◇ IoT 공통보안 7대 원칙과 15대 보안가이드
보안원칙 1 : 정보보호·프라이버시 강화를 고려한 IoT 제품·서비스 설계
① IoT 장치의 특성을 고려하여 보안기능의 경량화 구현
② IoT 서비스 운영환경에 적합한 접근권한 관리 및 인증, 종단 간 통신보안, 데이터 암호화 등의 방안 제공
③ 소프트웨어 보안기술과 하드웨어 보안기술의 적용 검토 및 안전성이 검증된 보안기술 활용
④ IoT 장치 및 서비스에서 수집하는 민감 정보(개인정보 등) 보호를 위해 암호화, 비식별화, 접근관리 등의 방안 제공
⑤ IoT 서비스 제공자는 수집하는 민감 정보의 이용목적 및 기간 등을 포함한 운영정책 가시화 및 사용자에 투명성 보장
보안원칙 2 : 안전한 소프트웨어 및 하드웨어 개발기술 적용 및 검증
⑥ 소스코드 구현단계부터 내재될 수 있는 보안 취약점을 예방하기 위해 시큐어 코딩 적용
⑦ IoT 제품·서비스 개발에 사용된 다양한 SW에 대해 보안 취약점 점검 수행 및 보안패치 방안 구현
⑧ 펌웨어/코드 암호화, 실행코드 영역제어, 역공학 방지 기법 등 다양한 하드웨어 보안기법 적용
보안원칙 3 : 안전한 초기 보안 설정 방안 제공
⑨ IoT 장치 및 서비스 (재)설치 시 보안 프로토콜들에 기본으로 설정되는 파라미터 값이 가장 안전한 설정이 되도록 ‘Secure by Default’ 기본원칙 준수
보안원칙 4 : 보안 프로토콜 준수 및 안전한 파라미터 설정
⑩ 안전성을 보장하는 보안 프로토콜 적용 및 보안 서비스 제공 시 안전한 파라미터 설정
보안원칙 5 : IoT 제품·서비스의 취약점 보안패치 및 업데이트 지속 이행
⑪ IoT 장치·서비스의 보안 취약점 발견 시, 이에 대한 분석 수행 및 보안패치 배포 등의 사후조치 방안 마련
⑫ IoT 장치·서비스에 대한 보안취약점 및 보호조치 사항은 홈페이지, SNS 등을 통해 사용자에게 공개
보안원칙 6 : 안전한 운영·관리를 위한 정보보호·프라이버시 관리체계 마련
⑬ 최소한의 개인정보만 수집·활용될 수 있도록 개인정보보호정책 수립 및 특정 개인 식별정보의 생성·유통을 통제할 수 있는 기술적·관리적 보호조치 포함
보안원칙 7 : 사물인터넷 침해사고 대응체계 및 책임추적성 확보 방안 마련
⑭ 다양한 유형의 IoT 장치, 유·무선 네트워크, 플랫폼 등 다양한 계층에서 발생 가능한 보안 침해사고에 대비하여 침입탐지 및 모니터링 수행
⑮ 침해사고 발생 이후 원인분석 및 책임추적성 확보를 위해 로그기록의 주기적 저장·관리
클라우드 핀테크 규제 준수를 위한 AWS 서비스 – 김지민 AWS 스타트업 솔루션즈 아키텍트, 박범준 AWS 스타트업 어카운트 매니저:: ...Amazon Web Services Korea
클라우드를 사용하기 위해 작성하셔야 하는 안전성 확보 조치 방안. 계정관리, 암호화 및 키 관리, 로깅 및 모니터링… 준수해야 하는 규정 항목은 익숙하지만 클라우드에서는 어떻게 해야하는지 막막하게 느껴집니다. 클라우드 보안과 거버넌스를 위한 필수 AWS 서비스들을 알아봅니다.
4. 보안 관련 3요소
● 접근 주체(Principal)
○ 보호된 대상에 접근하는 사용자
● 인증(Authenticate)
○ 현재 사용자가 누군인지 확인하는 과정
○ 일반적으로 아이디/암호를 이용해서 인증을 처리
● 인가(Authorize)
○ 현재 사용자가 특정 대상(URL, 기능 등)을 사용(접근)
할 권한이 있는지 검사하는 것
5. 스프링 시큐리티와 보안 3요소의 매칭
접근 주체
인증
인가
Authentication
Authentication
Manager
Security
Interceptor
6. Authentication와 SecurityContext
● Authentication의 용도
○ 현재 접근 주체 정보를 담는 목적
○ 인증 요청할 때, 요청 정보를 담는 목적
● SecurityContext
○ Authentication을 보관
○ 스프링 시큐리티는 현재 사용자에 대한
Authentication 객체를 구할 때 SecurityContext로부
터 구함
7. SecurityContextHolder
● SecurityContext를 보관
○ 기본: 쓰레드로컬에 SecurityContext를 보관
● 전형적인 SecurityContext 설정 코드
Authentication auth = someMethodForGettingAuth(req, resp);
try {
SecurityContextHolder.getContext().setAuthentication(auth);
chain.doFilter(request, response); // 이후 코드에서 동일 SecurityContext 사용
} finally {
SecurityContextHolder.clearContext();
}
스프링 시큐리티가 유사한 필터 이미 제공
8. 참고, Authentication의 주요 메서드
● Authentication의 주요 메서드
○ String getName(): 사용자의 이름
○ Object getCredential(): 증명 값 (비밀번호 등)
○ Object getPrincipal(): 인증 주체 정보
○ boolean isAuthenticated(): 인증되었는지 여부
○ Collection<GrantedAuthority) getAuthorities(): 현재
사용자가 가진 권한(GrantedAuthority)
9. AuthenticationManager
● 인증을 처리함
public interface AuthenticationManager {
Authentication authenticate(Authentication authentication)
throws AuthenticationException;
}
● 인증에 성공하면 인증 정보를 담고 있는 Authentication 객체 리턴
○ 스프링 시큐리티는 리턴한 Authentication 객체를 SecurityContext에
보관 및 인증 상태를 유지하기 위해 세션에 보관
● 인증 실패시 AuthenticationException을 발생시킴
10. (Abstract)SecurityInterceptor
● 인가를 처리
○ 웹의 경우 FilterSecurityInterceptor 구현 사용
○ AccessDecisionManager에 권한 검사 위임
public interface AccessDecisionManager {
void decide(Authentication authentication, // 사용자
Object object, // 접근 자원
Collection<ConfigAttribute> configAttributes) // 보안 설정
throws AccessDeniedException, InsufficientAuthenticationException;
boolean supports(ConfigAttribute attribute);
boolean supports(Class<?> clazz);
}
● 사용자가 자원의 보안 설정 기준으로, 접근 권한이 없을 경우 익셉션 발생
12. 웹 어플리케이션 보안 지원
● 보인 필터 체인를 이용한 보안 처리
FilterChainProxy
보안 필터 체인
실제 자원
주로 다음 기능을 제공
- Authentication 정보 생성
- 접근 권한 검사
- 인증 요청 처리
<sec:http use-expressions="true">
<sec:intercept-url pattern="/admin/**"
access="hasAuthority('ROLE_ADMIN')" />
<sec:intercept-url pattern="/manager/**"
access="hasRole('ROLE_MANAGER')" />
<sec:intercept-url pattern="/member/**"
access="isAuthenticated()" />
<sec:intercept-url pattern="/**"
access="permitAll"/>
<sec:form-login />
<sec:logout />
</sec:http>
생성
생성
스프링 빈으로 등록된 필터
(springSecurityFilterChain)
13. 웹 요청을 FilterChainProxy 적용
<filter>
<filter-name>
springSecurityFilterChain
</filter-name>
<filter-class>
o...filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
FilterChainProxy
보안 필터 체인
DelegatingFilterProxy
14. 보안 필터 체인
보안 필터 체인의 주요 구성 요소
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor접근 권한 검사
익셉션 처리
로그인 폼 출력
인증 요청 처리
로그아웃 요청 처리
Authentication 로딩 ● 필터 체인은 순서대로 실
행
● 필터에 따라 요청을 처리
하고 체인 실행을 끝내기
도 함
임의 사용자 처리
15. 접근 권한 없을 때 처리, 인증 전
보안 필터 체인
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
1. 요청
Access
Decision
Manager 2. 권한 검사
요청
4. 익셉션 발생
Authentication
EntryPoint
5. 인증 과
정 시작 처
리
<sec:form-login
login-page="/user/loginform"
/>
16. 접근 권한 없을 때 처리, 인증 상태
보안 필터 체인
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
1. 요청
Access
Decision
Manager 3. 권한 검사
요청
4. 익셉션 발생
AccessDenied
Handler
5. 접근 거부
응답 처리
<sec:access-denied-handler
error-page="/accessDenied"/>
SecurityContext
Repository
2. 보관된 SecurityContext를
로딩
17. 기본 로그인 폼 제공
보안 필터 체인
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
1. /spring_security_login 경
로 요청
2. 로그인 폼
응답 전송
18. 인증 요청 처리 과정 (성공시)
보안 필터 체인
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
1. 인증 요청
Authentication
Manager
2. 인증 실행
SecurityContext
3. Authentication 보관
Authentication
SuccessHandler
4. 성공 후처리
SecurityContext
Repository
5. SecurityContext 보관
<sec:form-login
login-processing-url="/user/login"
username-parameter="userid"
password-parameter="password"
default-target-url="/index"
/>
19. 인증 요청 처리 과정 (실패시)
보안 필터 체인
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
1. 인증 요청
Authentication
Manager
2. 인증 실행
Authentication
FailureHandler
3. 실패 후처리
<sec:form-login
...
authentication-failure-url="/user/loginform?error=true"
/>
20. 로그아웃 요청 처리 과정
보안 필터 체인
SecurityContextPersistenceFilter
LogoutFilter
UsernamePasswordAuthenticationFilter
DefaultLoginPageGeneratingFilter
AnonymousAuthenticationFilter
ExceptionTranslationFilter
FilterSecurityInterceptor
1. 로그 아웃
요청
LogoutSuccess
Handler
3. 로그아웃 후
처리
LogoutHandler
2. 로그아웃 처
리
<sec:logout logout-url="/user/logout"
logout-success-url=”/”
/>