You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTML report generation in `docker_scanner.py` and `report_generator.py` uses a hand-rolled `{{VARIABLE}}` string substitution system. This works today but has real limitations that are already visible in the codebase:
No loops — vulnerability tables are pre-built as a single string concatenation, not a template loop
No conditionals — empty sections (e.g., no CRITICAL findings) require Python-side string manipulation
Escaping must be handled manually — XSS-prone if any path is missed
Not composable — can't include sub-templates or extend a base layout
Overview
The HTML report generation in `docker_scanner.py` and `report_generator.py` uses a hand-rolled `{{VARIABLE}}` string substitution system. This works today but has real limitations that are already visible in the codebase:
Jinja2 is already the standard templating engine in the Python ecosystem (Flask, Ansible, Cookiecutter all use it). It solves all the above.
Proposed Change
1. Add Jinja2 to `requirements.txt`
2. Move the HTML template to `templates/report.html.j2`
3. Update `report_generator.py`
Benefits
Files to Modify
Acceptance Criteria