Bản ghi (record) các sự kiện xảy ra trong mạng và hệ thống của tổ chức. Mỗi log entry chứa thông tin liên quan đến sự kiện cụ thể: timestamp, source/dest IP, user, process, action, result. Tổ chức lưu trữ nhiều loại log file cho mục đích an ninh máy tính.
File sự kiện (event log) của ứng dụng/hệ thống, ghi lại: lịch sử truy cập đối tượng bởi user/process, lần thử xác thực (authentication attempts - success/failed), thay đổi cấu hình, lỗi, cảnh báo.
| Loại Log | Nguồn | Nội dung chính | Mục đích an ninh |
| Perimeter Device Logs | Firewall, VPN Gateway, WAF, Proxy, Load Balancer, Router, Switch | Connection allowed/denied, bandwidth, threat detection (IPS/IDS alert), URL category, app control | Phát hiện truy cập bất thường, lateral movement, C2, data exfil |
| Windows Event Logs | Domain Controller, Server, Workstation | Security (4624/4625 logon, 4688 process creation, 4672 privilege use), System, Application, PowerShell Operational, Sysmon (Event ID 1,3,7,8,10,11,12,13,15,22,23,255) | Phát hiện credential theft, lateral movement, persistence, privilege escalation, malware execution |
| Endpoint Logs (EDR/XDR) | CrowdStrike, SentinelOne, Defender for Endpoint, Cortex XDR, Elastic Defend | Process tree, file/registry/network behavior, MITRE ATT&CK mapping, IOC match | Real-time detection, threat hunting, automated response |
| Application Logs | Web App, API, Database, Middleware, Custom App | Request/Response, Error, Audit trail, Business transaction, AuthZ decisions | AppSec: SQLi, XSS, RCE, BOLA/IDOR, Logic flaw, Fraud detection |
| Proxy Logs | Forward Proxy, SWG (Zscaler, Netskope, Cloudflare, Blue Coat) | URL, Category, User, Device, Action (Allow/Block/Scan), File type, DLP match | Web threat, Shadow IT, Data exfil, C2 beaconing |
| IoT/OT Logs | IoT Gateway, PLC, SCADA, HMI, Building Mgmt, Medical Device | Protocol traffic (Modbus, BACnet, OPC UA, MQTT), Anomaly, Firmware change | OT Security, Purdue Model visibility |
| DNS Logs | Resolver (AD DNS, Infoblox, Cisco Umbrella, Quad9, Pi-hole) | Query/Response, NXDOMAIN, DGA detection, Fast-flux, C2 domain, Tunneling | Early detection: malware beacon, phishing click, data exfil via DNS |
| Cloud/Infrastructure Logs | AWS CloudTrail, Azure Activity Log, GCP Audit Log, K8s Audit, VPC Flow Logs | API call, Resource change, IAM policy change, Network flow, Identity usage | Cloud misconfig, privilege escalation, data access anomaly, crypto mining |
| Identity/IdP Logs | Entra ID (Azure AD), Okta, Ping, Keycloak, AD FS | Sign-in (success/failed), MFA challenge, Conditional Access eval, Token issuance, Admin action | Identity threat: impossible travel, password spray, token theft, admin abuse |
Security Log (Windows Security Log) chứa gì?
Trong Microsoft Windows: Security Log ghi lại logon/logoff (Event ID 4624/4625/4634/4647), quản trị quyền (4672), tạo tiến trình (4688 với Sysmon), truy cập đối tượng (4656/4663), thay đổi chính sách (4719), hệ thống (1100/1102 log cleared). Admin cấu hình qua Audit Policy (Advanced Audit Policy Configuration) để bật các subcategory cần thiết.
Tại sao Log quan trọng cho an ninh?
- Điều tra nguyên nhân sau lỗi/sự cố (Root Cause Analysis).
- Xác định vị trí và thời điểm lỗi/vi phạm xảy ra.
- Ghi dữ liệu song song với hệ thống → thấy cả data và events timeline.
- Tuân thủ (Compliance): PCI DSS, HIPAA, GDPR, ISO 27001 yêu cầu log retention, review.
- Threat Hunting: tìm kiếm IOC, TTPs, anomaly chủ động.
- Forensics: chuỗi bằng chứng (chain of custody), timeline reconstruction.
Cách kiểm tra Security Log (Windows)
- Mở Event Viewer (
eventvwr.msc hoặc Start → gõ Event Viewer).
- Mở rộng Windows Logs → chọn Security.
- Danh sách sự kiện bảo mật hiển thị ở pane giữa.
- Click sự kiện cụ thể → xem chi tiết (General / Details tab: XML view).
- Lọc (Filter Current Log): Event ID (4624, 4625, 4688...), User, Time range, Keywords.
Cách kiểm tra Network Logs
Trên trình duyệt (Chrome DevTools - Network tab): Dùng cho debug web app, không phải network security monitoring.
- F12 hoặc More tools → Developer Tools.
- Tab Network.
- Tích Preserve log.
- Truy cập URL → quan sát request/response, timing, status code.
Xem Network Logs trong Chrome
Tools → Developer Tools → Network tab → Preserve logs. Dùng cho frontend debugging, không phải network security appliance log.
Tìm Network Logs trong Windows 10
- Control Panel → System & Security → Administrative Tools → Event Viewer.
- Hoặc: Win+X → Event Viewer.
- Mở rộng Windows Logs → chọn: Application, System, Security, Setup, Forwarded Events.
- Applications and Services Logs → Microsoft → Windows → Networking, WLAN-AutoConfig, DHCP, DNS Client, TCPIP...
Các loại Log khác (phi an ninh)
- Gamma Ray Log, Spectral Gamma Ray (địa chất/dầu khí).
- Density Logging, Neutron Porosity, Neutron Lifetime (petrophysics).
- Carbon/Oxygen Log, Geochemical Log (khoáng sản).
- Lưu ý: Đây là logging trong ngành dầu khí/địa chất, không liên quan an ninh mạng.
Log nào nên gửi đến SIEM?
Ưu tiên ingest (thu nhập) vào SIEM (Splunk, Elastic, Sentinel, QRadar, LogRhythm, Panther, Datadog, Sumo Logic):
- Firewall/Network Security Appliance logs (Allow/Deny, Threat logs, Traffic logs).
- Router & Switch logs (NetFlow/sFlow, Syslog, Config change).
- Wireless AP/Controller logs (Auth success/fail, Rogue AP, Client association).
- Vulnerability Scan results (Qualys, Nessus, Rapid7, Tenable → SIEM).
- Threat Intelligence Feed (IOC, TTP, Actor profile).
- Antivirus/EDR/XDR logs (Detection, Quarantine, Remediation).
- Identity/IdP logs (Sign-in, MFA, Admin activity, Privilege escalation).
- Cloud logs (CloudTrail, Activity Log, Audit Log, VPC Flow Logs).
- Email Security logs (Delivery, Block, Phish, Sandbox verdict).
- Web Proxy/SWG logs (URL, Category, User, Action, DLP).
- Application logs (Critical business app, Custom audit trail).
- Database audit logs (Sensitive table access, Schema change).
Các loại Log duy trì trong tổ chức
- Audit Logs: Truy cập đặc quyền, thay đổi cấu hình, quản trị user — cho compliance/audit.
- Transaction Logs: Giao dịch DB, financial, order — cho rollback, audit, reconciliation.
- Event Logs: Hệ thống, ứng dụng, security — cho troubleshooting, monitoring.
- Error Logs: Lỗi ứng dụng, crash, exception — cho dev/ops debugging.
- Message/Communication Logs: Email, chat, API call — cho DLP, eDiscovery, compliance.
- Access Logs (Web/Proxy/FW): Request/Response — cho security analytics, capacity planning.
Một số log readable by human (text/JSON), số khác binary/encoded cho audit/performance (ETW, pcap, protobuf).
Mục đích Security Log
Theo dõi thông tin liên quan đến an ninh trên hệ thống máy tính: ai làm gì, khi nào, từ đâu, kết quả ra sao. Cơ sở cho: detection, investigation, compliance, forensics.
Network Security Logs (định nghĩa bổ sung)
System log ghi lại hoạt động cụ thể trên hệ thống thông tin/mạng, cũng như lỗi, sự cố, dữ liệu hoặc thông tin chung. Nếu không có log → hoạt động độc hại không bị phát hiện, không thể điều tra.
Vị trí Security Log (Windows)
- File vật lý:
%SystemRoot%\System32\winevt\Logs\Security.evtx (Windows Vista+/Server 2008+).
- Xem qua Event Viewer (eventvwr.msc).
- Local Policy / Audit Policy / Advanced Audit Policy Configuration điều khiển gì được ghi.
Best Practices cho Security Logging
- Centralized Logging: Syslog/Forwarder → SIEM/Log Lake (S3, Azure Monitor, GCS, Loki).
- Structured Format: JSON/CEF/LEEF/OCSF — dễ parse, query.
- Timestamp chuẩn: UTC, ISO 8601, có timezone.
- Enrichment: Thêm geoIP, asset info, user identity, threat intel tag tại ingest.
- Retention: Hot (30-90 ngày), Warm (1 năm), Cold/Archive (7 năm tuân thủ pháp lý).
- Integrity: Hash chain, WORM storage, signed log — chống xóa/sửa log.
- Alerting: Rule-based (Sigma, Splunk SPL, KQL, YARA-L), ML-based anomaly.
- Privacy: Mask PII/PHI trong log (credit card, SSN, password) — trừ khi cần thiết cho investigation.