토리맘의 한글라이즈 프로젝트 logo 토리맘의 한글라이즈 프로젝트

스프링 부트 공식 레퍼런스를 한글로 번역한 문서입니다.

전체 목차는 여기에 있습니다.

목차


8.7. Auditing

스프링 부트 액추에이터는 스프링 시큐리티가 있으면 이벤트(기본적으로 “authentication success”, “failure”, “access denied” exceptions)를 게시하는 유연한 감사audit 프레임워크를 등록한다. 이 기능은 리포팅 용도로도 이용할 수 있으며, 인증에 실패했을 때 잠금 정책을 구현하는 데에도 매우 유용할 수 있다.

애플리케이션 설정에 AuditEventRepository 타입 빈을 제공하면 감사를 활성화할 수 있다. 스프링 부트는 간편한 InMemoryAuditEventRepository를 제공한다. InMemoryAuditEventRepository는 기능이 제한적이기 때문에 개발 환경에서만 사용하는 걸 권장한다. 프로덕션 환경에선 이대신 자체 AuditEventRepository 구현체를 만드는 것을 검토해봐라.

8.7.1. Custom Auditing

게시하는 시큐리티 이벤트를 커스텀하려면 AbstractAuthenticationAuditListenerAbstractAuthorizationAuditListener의 자체 구현체를 제공하면 된다.

이 감사 서비스는 자체 비즈니스 이벤트에도 활용할 수 있다. AuditEventRepository 빈을 자체 컴포넌트에 주입한 뒤 직접 사용하거나, 스프링 ApplicationEventPublisherAuditApplicationEvent를 게시하면 된다 (ApplicationEventPublisherAware를 구현해서).


Next :
HTTP Tracing
액추에이터로 HTTP tracing 정보 추적하기

전체 목차는 여기에 있습니다.

<< >>

TOP