From plugin version 4.7.0 on, you can delete attachments in Redmine automatically. In practice nobody does this by hand, so the Automation plugin does it for you: The new action Delete attachments removes attachments by age, file type, size or content. The issue itself stays.
The action Delete attachments is available from version 4.7.0 of the Automation plugin.
When the ID card has been attached to the issue for three years
A customer sends a copy of their ID card for identification. The issue is done after two days. Three years later the copy is still there.
The new action helps wherever personal data may only be stored as long as necessary for its purpose under the GDPR (Art. 5(1)(e) GDPR, storage limitation). For issues this means: The handling of the case may stay documented, the copy of the ID card may not.
A scheduled rule takes care of this regularly, for example every night:
- Trigger: Scheduled, Issues
- Condition: Closed on, more than 90 days ago. Add project or tracker, so the rule only runs where the retention period applies.
- Action: Delete attachments, criterion Older than (days): 90
The retention period itself is set by your data protection officer. The rule only puts it into practice.
When someone uploads unwanted files
Redmine itself has no block list for file types. If someone attaches an executable file to an issue, everyone with access to the issue can download it.
A rule with the trigger Event, Save Issue checks every upload right away, also on old issues. As criterion you enter the file extensions, for example exe,bat,msi,ps1. A comment in the same rule tells the user why the file has disappeared.
When storage space runs low
Screen recordings, database dumps, log files: While the issue is being worked on, they are useful. Once it is done, nobody needs them anymore, but they keep taking up storage space and end up in every backup.
Two criteria help here:
- File extensions:
tmp,bak,logcleans up drafts and log files when the issue is closed. Other files stay. - Larger than (MB): Delete large files in closed issues after a set period. Combined with the condition Project, this gives you a size limit per project, which Redmine itself does not have.
When a bank account number is hidden in a PDF
File name and extension usually do not tell you what a file contains. An invoice is called “scan.pdf”, a configuration export “export.txt”.
If you also use our AI plugin, the action gets an additional criterion File content. It reads the text of text files and PDFs and deletes files that contain certain terms or patterns, for example private keys or passwords. Note: It does not recognise images and scanned PDFs without a text layer.
The AI plugin can be added monthly to Redmine Hosting, is part of Redmine AI Hosting or comes with the Enterprise Support package.
Not only issue attachments
Attachments are not only found on issues. The action is also available for wiki pages and projects, and with the matching AlphaNodes plugins for DB entries, contacts, invoices and passwords. An example: In the DB plugin, contracts are attached to DB entries. With the criterion Older than (days), a rule deletes the copy of the contract once the retention period has passed. The entry with term and contract partner stays.
Proving what was deleted
Deleting alone is not enough for data protection. You also have to be able to show that the data was deleted.
That is why every deleted attachment is listed in the Reporting log, with file name, record and rule. In the history of the issue, Redmine also notes the deletion under the bot user of the Automation plugin. So you can see on the issue that a rule removed the file, and not a colleague. With the additional action Add Log, you can extend the log entry to suit your needs.
What to keep in mind
Important: There is no recycle bin. What the rule deletes is gone. That is why:
- Check first: The file list of the Reporting plugin shows which files would match the criteria.
- Start small: One project, one tracker, one file extension. You can extend it later.
- Combine several criteria: Only files that match all criteria you filled in are deleted. “Older than 90 days” and “extension GIF” together match fewer attachments than each criterion on its own.
Conclusion
You no longer have to keep track of retention periods for attachments by hand. A matching rule in the Automation plugin deletes the attachments as soon as the period has expired. The issue with all its comments stays. And the Reporting log shows what was deleted and when.
Useful links
- Redmine Automation plugin: rules for issues, projects, wiki and the data of the AlphaNodes plugins.
- Automation cheat sheet: triggers, conditions and actions at a glance.
- Redmine Hosting: new plugin versions and the AI plugin, without your own server.