How cisagov/pentest-reporting-engine works
Project Type and Purpose
• This is a full-stack, containerized web application: the “Risk & Vulnerability Assessment Reporting Engine” (RE).
• Purpose: provide a Django-based backend (with REST API and HTML templates), a Vue3/Tailwind CSS frontend, and a report-generation engine for security assessment deliverables ( Word/PPTX/CSV).
• It’s packaged for both development and production via Docker Compose, with CLI tooling (ptp.py) to orchestrate setup, backup, restore, and container lifecycle.
File Structure Analysis
• Top-level “pentestportal” & “ptportal” directories: Django project (settings.py, wsgi.py) plus a Django app (models, views, templates, static, forms).
• “report_gen” directory: core report-generation modules and templates (Word, PPTX, CSV).
• “docker/” folder: Dockerfiles for dev (web & DB), prod (web, DB, nginx), env files, and helper scripts.
• “node/” and “node/dependencies/components-vue3”: bundled Vue3 component library + Tailwind CSS assets for the frontend.
• Top-level CLI script ptp.py and Makefile for high-level operations (run, dev, backup, restore, etc.).
• Configuration files: docker-compose.yml (dev) and docker-compose.prod.yml (prod), Nginx config, Python lint/format configs.
README Insights
• The README details prerequisites (Docker, Docker-Compose, Python, Django), setup steps (ptp.py run/dev), backup/restore via CLI, API endpoints, and development guidance.
• Emphasis on Docker Compose spinning up three services: web (Django app), db (PostgreSQL or similar), and nginx (reverse proxy/static server in prod).
Detail Guidance
• Network boundaries (Docker network), volume mounts (code, static, media)
• Docker Compose roles: which Compose YAML spins up which containers (dev vs. prod)
• Call out live-reload volume mounts in dev vs. baked-in code in prod images
• Ptp.py command flow for common operations (e.g., “ptp.py run → docker-compose up”)