Log Management
Log Retention: How Long Should You Keep Security Logs?
Logchase Security Team7 min read
Log retention is the policy that decides how long each type of log is kept, where it is stored and when it is deleted. For security logs, the answer comes from three directions: legal and regulatory requirements, how far back investigations need to look, and the cost of storing and searching the data.
Why does log retention matter?
Retention decides whether the evidence still exists when you need it. Data about an event may be needed weeks or months after it happened, and an investigation can only reconstruct what the logs still hold.
NIST SP 800-92 separates two activities. Log retention is archiving logs regularly as part of normal operations. Log preservation is keeping logs that would normally be discarded because they record activity of particular interest, for example during an incident or a legal hold. A good policy covers both.
- Investigations — tracing an attacker back to the first compromised account or host.
- Compliance — showing auditors that required events were recorded and kept.
- Evidence — supporting legal disputes, official requests and internal inquiries.
- Detection — giving baselines and correlation rules enough history to work with.
Keeping everything forever is not the answer either. Logs often contain personal data such as usernames and IP addresses, and the GDPR's storage limitation principle (Article 5(1)(e)) says personal data should be kept no longer than necessary for its purpose. A retention policy therefore needs a maximum as well as a minimum.
Write the policy down. For each log type, record the minimum and maximum period, the storage tier, who owns it and how deletion happens. Auditors usually ask to see the policy as well as the logs.
What are common regulatory log retention periods?
There is no universal number. PCI DSS requires at least 12 months of audit log history, CIS Controls set a 90-day minimum, and many other frameworks require logging without fixing a period.
| Framework | What it says about retention |
|---|---|
| PCI DSS v4.0.1, Req. 10.5.1 | Keep audit log history for at least 12 months, with the most recent three months immediately available for analysis |
| CIS Controls v8, Safeguard 8.10 | Retain audit logs across enterprise assets for at least 90 days |
| HIPAA Security Rule, 45 CFR 164.316(b)(2) | Keep required documentation for six years; no separate period is set for audit logs |
| GDPR, Art. 5(1)(e) | No fixed period; keep personal data no longer than necessary |
| ISO/IEC 27001 | Requires logging controls; the period comes from your own policy |
| Turkey, Law No. 5651, Art. 5–6 | Hosting providers keep traffic data for one to two years, access providers for six months to two years, as set by regulation, and must ensure its accuracy, integrity and confidentiality |
Two details are easy to miss. PCI DSS has two tiers, a year of history but only three months immediately available, which maps neatly onto hot and archive storage. And the HIPAA six-year rule is often quoted as a log retention period, while the regulation applies it to required documentation.
Without a mandate, decide by risk. NIST SP 800-92 offers example values of one to two weeks for low-impact systems, one to three months for moderate and three to twelve months for high-impact systems, and stresses they are a starting point that ignores regulatory requirements.
What are hot, warm and cold log storage?
They are storage tiers that trade search speed for cost. Hot storage keeps recent logs instantly searchable, warm storage keeps older logs searchable on cheaper hardware, and cold storage keeps compressed archives for the long term.
| Tier | Typical age | Search | Cost | Used for |
|---|---|---|---|---|
| Hot | Days to a few months | Interactive | Highest | Alerting, correlation, daily investigations |
| Warm | Months | Slower | Medium | Threat hunting, longer investigations |
| Cold / archive | Months to years | Restore or scan first | Lowest | Compliance, legal requests, forensics |
A typical security log lifecycle
- 1
Ingest
Logs are parsed, normalized and indexed.
- 2
Hot
Recent data stays in fast storage for alerting and search.
- 3
Warm
Older data moves to cheaper storage.
- 4
Archive
Data is compressed, hashed and time-stamped.
- 5
Delete
Data is destroyed when retention ends, unless it is on legal hold.
Set periods per log type, not globally: authentication, firewall and admin activity logs usually deserve more time than verbose debug output. NIST SP 800-92 also advises choosing archive formats and media that will still be readable when the retention period ends.
Test the path back from cold storage. If a requirement says logs must be immediately available, a restore that takes days does not meet it, so measure how long it takes to bring an old month back into search.
In Logchase log management, recent logs stay in a searchable index and older data moves to compressed archives: a full-detail SIEM archive that can be restored into search, and a separate minimal archive for Law No. 5651.
How do you prove log integrity?
You prove integrity by showing that logs have not changed since they were collected. Hash each log file or batch, protect the hashes, and add a trusted timestamp that proves when the data existed.
- Hash on collection or archiving. A cryptographic hash such as SHA-256 is a fingerprint of the file; any change produces a different value. NIST SP 800-92 recommends message digests to confirm that transferred logs were not altered.
- Time-stamp the hash. An RFC 3161 time-stamping authority signs the hash with the time, providing evidence that the data existed in that form before that moment.
- Restrict and log access. Limit who can read, export or delete archives, and record those actions too.
- Keep copies apart. Store a replica in a separate location so one failed or compromised system cannot erase the evidence.
- Verify regularly. Recompute hashes on a schedule and before handing logs to auditors or investigators.
- Keep clocks in sync. Synchronize time on every log source so that event timestamps line up across systems.
Integrity matters most when logs become evidence. Attackers who gain administrative access often try to clear or alter logs (MITRE ATT&CK T1070, Indicator Removal), and timestamped hashes show whether that happened.
Logchase hashes archives and time-stamps them with RFC 3161, using TÜBİTAK Kamu SM Zamane or FreeTSA as the authority; Enterprise and Elite packages add disaster recovery replication. To collect logs in the first place, see our syslog server guide.
Sources
- NIST SP 800-92: Guide to Computer Security Log Management
- PCI Security Standards Council: Document Library (PCI DSS v4.0.1)
- CIS Controls v8 Assessment Specification, Safeguard 8.10: Retain Audit Logs
- 45 CFR 164.316: Policies and procedures and documentation requirements (eCFR)
- Regulation (EU) 2016/679 (GDPR), EUR-Lex
- ISO/IEC 27001: Information security management systems
- Law No. 5651 (5651 sayılı Kanun), mevzuat.gov.tr
- RFC 3161: Time-Stamp Protocol (TSP)
- MITRE ATT&CK T1070: Indicator Removal
Written by
Logchase Security Team
The engineers who build Logchase, working on log management, SIEM, threat detection and file integrity monitoring.
FAQ
Frequently asked questions
How long should security logs be kept?
Long enough to meet the strictest requirement that applies to you and to support investigations. Common reference points are at least 90 days (CIS Controls) and at least 12 months where PCI DSS applies, with recent logs searchable and older logs archived.
What is the difference between log retention and log preservation?
In NIST SP 800-92, retention is archiving logs routinely as part of normal operations. Preservation is keeping specific logs that would otherwise be deleted, for example because they relate to an incident or a legal hold.
Does the GDPR set a log retention period?
No. The GDPR names no period for logs. Its storage limitation principle requires keeping personal data no longer than necessary, so document why each retention period is needed and delete or anonymize logs afterwards.
How much storage does log retention need?
Multiply daily log volume by the retention days for each tier, then adjust for archive compression and any replicas. Measuring your real daily volume for a few weeks gives a far better estimate than generic averages.
Should logs be deleted when the retention period ends?
Usually yes, unless they are under a legal hold or needed for an open investigation. Deleting on schedule limits storage costs and privacy risk; record what was deleted and when, so you can show the policy is followed.
Are archived logs still useful for investigations?
Yes, if they keep full detail and can be searched or restored when needed. Test restores regularly, because an archive you cannot read during an incident is little better than none.
Related articles
Log management
Syslog Server Guide: Centralizing Logs from Network Devices
What a syslog server does, RFC 5424 vs RFC 3164, UDP, TCP and TLS transport, how to send firewall, switch and server logs, and the step to log management.
SIEM
What Is SIEM? How It Works and How to Choose One
What is SIEM? How security information and event management works, how it differs from log management, common use cases and how to choose one.
SIEM
Open Source SIEM vs Commercial SIEM
Open source SIEM or commercial SIEM software? Compare total cost, detection content, scaling, support and compliance, and see when each one fits.