sysreptor icon indicating copy to clipboard operation
sysreptor copied to clipboard

PDF metadata removal

Open byteboltsec opened this issue 1 year ago • 2 comments

Hi syslifters,

currently, when creating new PDF reports, the following metadata are added to the PDFs:

$ exiftool ...
producer: GPL Ghostscript 10.04.0
CreatorTool: UnknownApplication
CreateDate: 2024-10-03T11:46:04Z
ModifyDate: 2024-10-03T11:46:04Z
creation-date: 1727955964
mod-date: 1727955964

Maybe it is a good idea to put a removal tool like mat2 (https://0xacab.org/jvoisin/mat2) between the report generation, to reduce the likelihood of new metadata from lib updates etc? Just a suggestion!

Thank you! 😃

byteboltsec avatar Oct 03 '24 12:10 byteboltsec

When generating the PDF weasyprint allows for custom metadata with the following option: --custom-metadata

c-leitner avatar Oct 03 '24 12:10 c-leitner

Thanks for the suggestion. PDF metadata is added by Ghostscript. Ghostscript does not support removing the producer, so we have to use another tool in the post-processing step.

MWedl avatar Oct 04 '24 05:10 MWedl

Implemented in https://github.com/Syslifters/sysreptor/releases/tag/2024.91

PDF metadata is removed via pikepdf after compressing PDFs via ghostscript. For non-compressed PDFs, metadata is removed via a weasyprint hook.

MWedl avatar Nov 20 '24 14:11 MWedl