DBL-001 PostgreSQL Connection and Query Log
Log Structure
PostgreSQL 로그는 설정에 따라 접속/종료, 인증 실패, statement, duration, slow query 등을 남긴다. 실무형 분석에서는 모든 쿼리를 무조건 남기기보다, 실습 목적에 맞춰 접속 로그와 특정 statement 로그를 제한적으로 수집하는 것이 적절하다.
Important Fields
| Field | Meaning |
|---|---|
@timestamp | DB 이벤트 발생 시간 |
user.name | DB 접속 계정 |
database.name | 접속 대상 DB |
source.ip | 접속 출발지 |
event.action | connection, disconnection, statement 등 |
message | PostgreSQL 원본 로그 |
Mapped Techniques
| Technique | Mapping Reason |
|---|---|
| T1213.006 Data from Information Repositories: Databases | DB 조회와 데이터 접근 확인 |
| T1078 Valid Accounts | 정상 DB 계정으로 접속했는지 확인 |
KQL Draft
service.type: "postgresql" and message: ("booking" or "reservation" or "customer")
Investigation Pivot
DB 접속 계정과 source IP를 기준으로 App 서버 환경 파일 접근 로그, SSH 접속 로그, Jenkins 배포 로그와 연결한다.
