Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

Log nào cần thiết cho an ninh mạng? (Network Security Logs)

Network Security Logs là gì?

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.

Network Logs là gì?

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.

Các loại Log trong Cybersecurity

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)

  1. Mở Event Viewer (eventvwr.msc hoặc Start → gõ Event Viewer).
  2. Mở rộng Windows Logs → chọn Security.
  3. Danh sách sự kiện bảo mật hiển thị ở pane giữa.
  4. Click sự kiện cụ thể → xem chi tiết (General / Details tab: XML view).
  5. 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.

  1. F12 hoặc More tools → Developer Tools.
  2. Tab Network.
  3. Tích Preserve log.
  4. 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

  1. Control Panel → System & Security → Administrative Tools → Event Viewer.
  2. Hoặc: Win+X → Event Viewer.
  3. Mở rộng Windows Logs → chọn: Application, System, Security, Setup, Forwarded Events.
  4. 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

  1. Centralized Logging: Syslog/Forwarder → SIEM/Log Lake (S3, Azure Monitor, GCS, Loki).
  2. Structured Format: JSON/CEF/LEEF/OCSF — dễ parse, query.
  3. Timestamp chuẩn: UTC, ISO 8601, có timezone.
  4. Enrichment: Thêm geoIP, asset info, user identity, threat intel tag tại ingest.
  5. Retention: Hot (30-90 ngày), Warm (1 năm), Cold/Archive (7 năm tuân thủ pháp lý).
  6. Integrity: Hash chain, WORM storage, signed log — chống xóa/sửa log.
  7. Alerting: Rule-based (Sigma, Splunk SPL, KQL, YARA-L), ML-based anomaly.
  8. Privacy: Mask PII/PHI trong log (credit card, SSN, password) — trừ khi cần thiết cho investigation.
Loại LogNguồnNội dung chínhMục đích an ninh
Perimeter Device LogsFirewall, VPN Gateway, WAF, Proxy, Load Balancer, Router, SwitchConnection allowed/denied, bandwidth, threat detection (IPS/IDS alert), URL category, app controlPhát hiện truy cập bất thường, lateral movement, C2, data exfil
Windows Event LogsDomain Controller, Server, WorkstationSecurity (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 DefendProcess tree, file/registry/network behavior, MITRE ATT&CK mapping, IOC matchReal-time detection, threat hunting, automated response
Application LogsWeb App, API, Database, Middleware, Custom AppRequest/Response, Error, Audit trail, Business transaction, AuthZ decisionsAppSec: SQLi, XSS, RCE, BOLA/IDOR, Logic flaw, Fraud detection
Proxy LogsForward Proxy, SWG (Zscaler, Netskope, Cloudflare, Blue Coat)URL, Category, User, Device, Action (Allow/Block/Scan), File type, DLP matchWeb threat, Shadow IT, Data exfil, C2 beaconing
IoT/OT LogsIoT Gateway, PLC, SCADA, HMI, Building Mgmt, Medical DeviceProtocol traffic (Modbus, BACnet, OPC UA, MQTT), Anomaly, Firmware changeOT Security, Purdue Model visibility
DNS LogsResolver (AD DNS, Infoblox, Cisco Umbrella, Quad9, Pi-hole)Query/Response, NXDOMAIN, DGA detection, Fast-flux, C2 domain, TunnelingEarly detection: malware beacon, phishing click, data exfil via DNS
Cloud/Infrastructure LogsAWS CloudTrail, Azure Activity Log, GCP Audit Log, K8s Audit, VPC Flow LogsAPI call, Resource change, IAM policy change, Network flow, Identity usageCloud misconfig, privilege escalation, data access anomaly, crypto mining
Identity/IdP LogsEntra ID (Azure AD), Okta, Ping, Keycloak, AD FSSign-in (success/failed), MFA challenge, Conditional Access eval, Token issuance, Admin actionIdentity threat: impossible travel, password spray, token theft, admin abuse