← All projects

Defensive document analysis / Project notes

PDFSentry

Quarantine first. Inspect uploaded PDFs in a separate worker and explain the findings.

Defensive security MVP
  • React
  • FastAPI
  • PostgreSQL
  • ClamAV
PDFSentry defensive PDF analysis dashboard
PDFSentry defensive PDF analysis dashboard.

01 / The problem

A real need.

A PDF extension does not make an upload trustworthy. Malformed structures, active content, resource exhaustion and scanner outages need explicit handling.

02 / The approach

A focused response.

Authenticated uploads enter quarantine outside the webroot. A separate worker combines ClamAV, qpdf and pikepdf signals into a private, explainable report without executing the document.

The user’s path

  1. 01Authenticate and upload
  2. 02Quarantine
  3. 03Inspect in a worker
  4. 04Review evidence

03 / Engineering decisions

Where the trade-offs are.

01

Separate upload from inspection

The API streams bounded uploads into quarantine and queues a PostgreSQL job. A non-root worker performs the expensive analysis outside the API process.

02

Failures are not clean results

Scanner outages and timeouts produce ANALYSIS_FAILED, never SAFE. The verdict must preserve the uncertainty of the inspection.

03

Evidence instead of a black box

Findings contribute to a documented risk score. Owner-scoped access and audit events keep the report tied to the authenticated upload workflow.

04 / Verification & scope

What this project demonstrates.

The repository documents tests using harmless synthetic PDFs and mocked scanner responses, plus frontend, backend and container checks. No malware is needed to exercise the failure semantics.

Limits worth making explicit

A SAFE result is not a guarantee that a file is harmless. Static inspection may miss unknown threats, encrypted content or obfuscation. Original documents are not served back for inline preview.

The next useful step

Bounded embedded-object scanning, stale-job recovery and secure cookie sessions are documented improvements.

Read the project documentation ↗