3.2. Elytron에서 파일 감사 로깅 활성화
파일 감사 로깅은 감사 로그 메시지를 파일 시스템 내의 단일 파일에 저장합니다.
기본적으로 Elytron은 local-audit
를 파일 감사 로거로 지정합니다.
독립 실행형 서버의 EAP_HOME/standalone/log/audit.log
또는 관리형 도메인에 대한 EAP_HOME/domain/log/audit.log
에 Elytron 감사 로그를 쓸 수 있도록 local-audit
를 활성화해야 합니다.
사전 요구 사항
애플리케이션을 보호했습니다.
자세한 내용은 Elytron에서
집계 영역
생성 을 참조하십시오.
프로세스
파일 감사 로그를 생성합니다.
구문
/subsystem=elytron/file-audit-log=<audit_log_name>:add(path="<path_to_log_file>",format=<format_type>,synchronized=<whether_to_log_immediately>)
/subsystem=elytron/file-audit-log=<audit_log_name>:add(path="<path_to_log_file>",format=<format_type>,synchronized=<whether_to_log_immediately>)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 예
/subsystem=elytron/file-audit-log=exampleFileAuditLog:add(path="file-audit.log",relative-to=jboss.server.log.dir,format=SIMPLE,synchronized=true)
/subsystem=elytron/file-audit-log=exampleFileAuditLog:add(path="file-audit.log",relative-to=jboss.server.log.dir,format=SIMPLE,synchronized=true)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 보안 도메인에 파일 감사 로그를 추가합니다.
구문
/subsystem=elytron/security-domain=<security_domain_name>:write-attribute(name=security-event-listener,value=<audit_log_name>)
/subsystem=elytron/security-domain=<security_domain_name>:write-attribute(name=security-event-listener,value=<audit_log_name>)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 예
/subsystem=elytron/security-domain=exampleSecurityDomain:write-attribute(name=security-event-listener,value=exampleFileAuditLog)
/subsystem=elytron/security-domain=exampleSecurityDomain:write-attribute(name=security-event-listener,value=exampleFileAuditLog)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
검증
브라우저에서 보안 애플리케이션에 로그인합니다.
예를 들어 보안 도메인을 사용하여 애플리케이션 사용자를 인증하고 권한을 부여하는 데 생성된 애플리케이션에 로그인하려면 http://localhost:8080/simple-webapp-example/secured 로 이동한 후 로그인합니다.
감사 로그를 저장하도록 구성된 디렉터리로 이동합니다. 프로세스에서 예제 명령을 사용하는 경우 디렉터리는 EAP_HOME/standalone/log입니다.
file-audit.log
파일이 생성됩니다. 애플리케이션에 로그인하여 트리거한 이벤트의 로그를 포함합니다.file-audit.log 파일 예
2023-10-24 23:31:04,WARNING,{event=SecurityPermissionCheckSuccessfulEvent,event-time=2023-10-24 23:31:04,security-identity=[name=user1,creation-time=2023-10-24 23:31:04],success=true,permission=[type=org.wildfly.security.auth.permission.LoginPermission,actions=,name=]} 2023-10-24 23:31:04,WARNING,{event=SecurityAuthenticationSuccessfulEvent,event-time=2023-10-24 23:31:04,security-identity=[name=user1,creation-time=2023-10-24 23:31:04],success=true}
2023-10-24 23:31:04,WARNING,{event=SecurityPermissionCheckSuccessfulEvent,event-time=2023-10-24 23:31:04,security-identity=[name=user1,creation-time=2023-10-24 23:31:04],success=true,permission=[type=org.wildfly.security.auth.permission.LoginPermission,actions=,name=]} 2023-10-24 23:31:04,WARNING,{event=SecurityAuthenticationSuccessfulEvent,event-time=2023-10-24 23:31:04,security-identity=[name=user1,creation-time=2023-10-24 23:31:04],success=true}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow