How stoic-dad/project-erasmus works
Project type and purpose
• This is a containerized, full-stack “reasoning engine” that ingests SBOMs (Software Bill of Materials), enriches them with vulnerability & vendor-geo metadata, and exposes an interactive Streamlit dashboard augmented by local GenAI models (Ollama).
• Primary use-cases: offline SBOM parsing (via Syft CLI), CVE scanning (via Grype CLI), metadata joining (Python/pandas), data visualization (Streamlit), and contextual Q&A (Ollama LLM).
File structure
• Top level:
• Dockerfile, Dockerfile.dashboard, docker-compose.yml → container definitions
• app.py, src/… → application code
• *.sh scripts & Python scripts (generate_sboms.sh, generate_vulns.sh, auto_generate_vendor_geo.py, etc.) → data-prep & orchestration
• data/, vendor_geo.csv, unique_suppliers.txt, test_suppliers.py → sample data & tests
• requirements.txt → dependencies
• src/ folder:
• parse_sbom.py → SBOM parsing
• enrich_vendor.py → joining vendor geography
• .py, main.py → Streamlit UI entry points
• CI/Deployment:
• docker-compose.yml orchestrates multiple containers (app, possibly Ollama)
README for additional insights
• SBOM ingestion uses Syft CLI → CycloneDX JSON
• Vulnerability scanning uses Grype CLI
• Visualization in Streamlit (port 8501)
• Local LLMs served by Ollama, selectable via dropdown
• Fully Dockerized + offline
Main components & relationships
a. SBOM Generation & Vulnerability Scanning
• Syft CLI → SBOM JSON (“sbom-out.json”)
• Grype CLI → vulnerability report JSON
b. Data Enrichment Layer (Python/pandas)
• parse_sbom.py reads SBOM JSON → DataFrame
• run vulnerability JSON → DataFrame
• enrich_vendor.py joins vendor_geo.csv → enriched DataFrame
• persist intermediate CSVs (unique_suppliers.txt, vendor_geo.csv)
c. Streamlit Dashboard (app.py / src/main.py + src/display.py)
• Reads enriched data → interactive charts & tables
• Exposes dropdown to select Ollama model
• Sends prompts → Ollama API → receives textual summaries / answers
d. Local GenAI Engine (Ollama)
• qwen2.5-coder:7b, gemma:2b, openhermes:latest models
• Hosted locally or in a sidecar container
e. Orchestration & Containerization
• docker-compose.yml spawns:
– “erasmus-app” container (Python + Streamlit + CLI tools)
– “ollama” container (if used)
• Shared volumes for SBOMs, CSVs, and scripts
Architectural patterns & design principles
• Pipeline / ETL pattern for data ingestion → transform → load
• Modular separation:
• CLI wrappers & scripts for SBOM/vuln generation
• Domain logic in Python modules (parse, enrich)
• Presentation layer in Streamlit
• LLM integration via API adapter
• Containerized microservices (app vs. LLM engine)
• Data artifacts stored in files/volumes for reproducibility