Log retention
Deciding how long each kind of log is kept before it is deleted - long enough to look into incidents, but no longer than needed.
Draft - this entry has not been reviewed yet.
Formal
A documented rule for each type of log stating how long it is stored, where, how it is protected and when it is deleted, based on the risk assessment, legal duties and the purpose of the log.
In plain English
Like keeping till receipts; throw them out after a day and you cannot handle a return, keep them forever and the back room fills with paper about people who shopped years ago.
In practice
An attack on a pension fund is found in March but began five months earlier; because login logs are kept for twelve months, the fund can trace the first break-in, while web logs holding member data are deleted after ninety days.
Why it matters
Attackers often go unseen for months, so logs deleted too soon leave no trail; NIS2 and DORA rules expect a documented period, while GDPR forbids keeping personal data longer than needed.
Technical deep dive
A retention decision has two opposing legal and operational pressures. On one side, investigations need history: intrusions are often discovered weeks or months after initial access, and indicators shared by others must be searched retroactively. On the other side, GDPR Art. 5(1)(e) (storage limitation) and Art. 5(1)(c) (data minimisation) forbid keeping personal data, which most security logs contain (usernames, IP addresses, email addresses, device identifiers), longer than necessary for the purpose. Art. 32 simultaneously makes logging part of appropriate security, so the result must be a documented, purpose-based period per log type rather than "keep everything" or "delete quickly".
Frameworks give reference points rather than a single number. CIS Controls v8 safeguard 8.10 requires retaining audit logs for a minimum of 90 days. PCI DSS v4.0 requirement 10.5.1 requires at least 12 months of audit log history, with at least the most recent three months immediately available for analysis. NIS2 does not fix a period in the directive itself; Commission Implementing Regulation (EU) 2024/2690, which applies to certain digital service providers, sets detailed monitoring and logging requirements in its point 3.2, including protection of logs and a defined retention period, and the DORA RTS on ICT risk management (Delegated Regulation 2024/1774, Art. 12) requires financial entities to define logging procedures including retention. In Denmark, the pre-GDPR security order for public authorities (bekendtgørelse nr. 528 af 15. juni 2000, § 19) required logs of personal-data use to be kept for six months and then deleted; that order has been repealed, and Datatilsynet's current guidance leaves the period to a concrete, purpose-based assessment.
A retention policy should specify for each log source the purpose, the period in hot (searchable) and cold (archive) storage, the storage location and jurisdiction, protection (access control, encryption, immutability), the deletion mechanism, and who can extend retention. Legal holds must be able to suspend deletion for specific data when litigation or a regulatory investigation is anticipated. Pseudonymisation, field-level reduction or aggregation can extend useful retention of security data while reducing personal-data exposure, for example by keeping full authentication logs for a year but reducing web access logs to aggregates after 90 days.
Frequent errors include retention set implicitly by SIEM licence cost rather than by policy, deletion that never happens in backups and archives, and retention periods that differ silently between the source system, the SIEM and the archive. Log retention is distinct from records retention under accounting law (in Denmark, bogføringsloven), and from the telecom data-retention rules, which concern traffic data kept by providers for law enforcement rather than an organisation's own security logs.
What to learn first
Everything this builds on, foundations first.
- User account
- →Audit logging
- →Log retention
Relationships
- Part of
- Log management
- Requires
- Audit logging
- Mandated by
- DORANIS2 Directive
- Used with
- Personal dataSecurity incident
Sources & further reading
Standards & official texts
- NIST SP 800-92 - Guide to Computer Security Log Management · NIST
- Commission Delegated Regulation (EU) 2024/1774 (DORA RTS on ICT risk management) - Article 12, Logging · European Union
- Commission Implementing Regulation (EU) 2024/2690 (NIS2) - Annex, point 3.2 Monitoring and logging · European Union
- GDPR (Regulation (EU) 2016/679) - Article 5(1)(e), storage limitation · European Union
- Bekendtgørelse nr. 528 af 15. juni 2000 om sikkerhedsforanstaltninger til beskyttelse af personoplysninger, som behandles for den offentlige forvaltning (repealed) · Justitsministeriet
Official documentation
Where this data comes from
This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.
See the review queueSuggest a correction on GitHubThis term as JSON
Check yourself
Loading…