Course contentsShow
← Security
Lesson 2385 of 3,05246. Incident ResponseFree lesson

Log Collection and Preservation

Gathering system logs, application logs, and security logs from multiple sources while maintaining integrity.

Log Collection and Preservation

What you'll learn: How to systematically gather and protect log evidence from across your infrastructure while maintaining its legal and investigative integrity.

Why Logs Are Critical Evidence

After a security incident, logs are often your primary witness. System logs, application logs, and security device logs tell the story of what happened, when, and potentially who was responsible. But unlike physical evidence, logs are fragile—they can be overwritten, tampered with, or lost if not collected properly.

Core Collection Principles

Cast a wide net immediately. Time is your enemy. Collect logs from:

  • System logs: OS event logs, authentication records, process execution
  • Application logs: Web servers, databases, custom applications
  • Security logs: Firewalls, IDS/IPS, proxies, EDR agents, SIEM platforms
  • Network infrastructure: Routers, switches, load balancers

Think of this like gathering witness statements after a crime—you want perspectives from everyone who saw anything, before memories fade.

Preservation Requirements

Once collected, logs must maintain chain of custody:

  1. Hash immediately: Generate cryptographic hashes (SHA-256) of each log file to prove it hasn't been altered
  2. Write-protect: Move logs to read-only storage or append-only systems
  3. Document everything: Record what you collected, when, from where, and who collected it
  4. Create copies: Original evidence stays pristine; work with copies for analysis
  5. Centralize securely: Store in a protected location separate from production systems

Key Takeaway: Log collection requires speed and precision—gather evidence from all relevant sources immediately, then protect its integrity with cryptographic hashing and strict access controls to ensure it remains legally defensible and investigatively useful.