Repository navigation
Closed
Closed
Copy link
Description
Enhance the DRS API to check that files submitted by the public are safe / virus free. Two options have been identified: leverage the existing STRR ClamAV anti-virus service, or implement a new PDF converter service.
As backround for the PDF converter, a note from Thor:
What we proposed was using the same type of setup shown in the google example, but using something like https://dangerzone.rocks/ that will just convert everything to a PDF.
Option 1: Use ClamAV
- From 26364, leverage the existing GCP ClamAV scanning service https://github.com/GoogleCloudPlatform/docker-clamav-malware-scanner?tab=readme-ov-file.
- Upload a new file to a known GCP unscanned storage bucket.
- Sometime later download a clean file from a different, known clean file storage bucket (same file name).
- Create a new AV Scan API as a wrapper to the GCP ClamAV service.
- Decouple the AV scanning implementation.
- Scan a file as a synchronous call.
- Return a distinct status code for infected files (422)
- Integrate the DRS API with the new AV Scan API
- Create a new endpoint for receiving files submitted by the public. Always scan these files before storing.
- Add a request parameter to existing endpoints that receive files to include an AV scan.
- Scan the file using the new AV Scan API.
- Do not scan files that are generated by registries (application reports and documents created by the Registries desktop scanning application).
Infected file sequence diagram:
Option 2: Use a PDF Converter Service
- Create a new PDF Converter API
- Use a similar approach to the https://dangerzone.rocks/about/ solution to produce safe pdfs.
- Convert the submitted file to a PDF format using the Gotenberg report service LibreOffice convert endpoint.
- With a PDF editing library render the report service PDF as pixel data, page by page, to produce the final, clean PDF.
- Integrate the DRS API with the new PDF Converter API
- Create a new endpoint for receiving files submitted by the public. Always check these files before storing.
- Add a request parameter to existing endpoints that receive files to include a public file check parameter.
- Create a safe file using the new PDF Converter API.
- Do not check files that are generated by registries (application reports and documents created by the Registries desktop scanning application).
Recommendation: implement option 2



Activity
mbertucci commentedon May 27, 2025
@sandragornall
mbertucci commentedon May 30, 2025
@sal-hamood @thorwolpert Here is the spike ticket. I am in the process of working with @oanyahuru to flush out the user story, requirements, etc.. the DRAFT story is in the epic https://app.zenhub.com/workspaces/assets-team-space-new-655515cb02e714000e74f9f3/issues/gh/bcgov/entity/28690
@forgeuxGH5 fyi