Allow logrotate configuration to control log retention based on age
Bug #1771543 reported by
Juan Antonio Osorio Robles
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
Critical
|
Bogdan Dobrelya |
Bug Description
Our current logrotate configuration in puppet-tripleo handles rotation based off of log size and number of rotated logs (rotate at 10M size and retain 14 logs). For things such as GDPR, we need to be able to define the retention based on age as the logs may contain personally identifiable information that needs to be deleted on demand (within a window of time). Ideally, we would only retain logs for <1M (2 weeks might be appropriate), with the option to configure the policy differently via Director.
Changed in tripleo: | |
status: | New → Confirmed |
importance: | Undecided → Critical |
milestone: | none → rocky-2 |
Changed in tripleo: | |
status: | Confirmed → Triaged |
Changed in tripleo: | |
assignee: | Bogdan Dobrelya (bogdando) → Alex Schultz (alex-schultz) |
Changed in tripleo: | |
assignee: | Alex Schultz (alex-schultz) → Bogdan Dobrelya (bogdando) |
Changed in tripleo: | |
milestone: | rocky-2 → rocky-3 |
Changed in tripleo: | |
milestone: | rocky-3 → rocky-rc1 |
tags: | added: pike-backport-potential |
To post a comment you must log in.
I think the goal is to delete all logs containing any info older than X days. Given that Linux will not show you a file creation time for the most of the cases, we only have a few options (and all seem have to belong to the logrotate's postrotate scripts only, as logrotate does not provide a clear interface for the size/maxsize/ minsize vs time based rotation):
- Delete based on files' head -1 content based, trying to figure out expiration from timestamps (Given binary log files and numerous timestamp formats, is prolly bad idea, but gives the best approximation for the real "creation time" criterion)
- Delete based on the older of available files' attributes: -atime +X / -crime +X / -mtime +X (does not really purges old files created long time ago and accessed recently, which potentially leaves some logged user sensitive data in undetected files)
- Delete based on the older of available directories' mtime attribute (corresponds to the last file creation or deletion that happened) - not sure if that works better.