# xaitax/sploitscan architecture

> Architecture diagram of the GitHub repository xaitax/sploitscan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xaitax/sploitscan
- Repository: https://github.com/xaitax/sploitscan

## Overview

##### Project type and purpose
- SploitScan is a Python-based, command-line application (open-source tool) for retrieving vulnerability and exploit information for CVEs. It orchestrates multiple data-gathering methods (CISA KEV, EPSS, public exploits, HackerOne, AI risk assessments) and exports consolidated results in HTML, JSON, or CSV.

##### File structure
- Top-level:
- sploitscan.py – entry-point wrapper
- sploitscan/ – core package
└ __main__.py – CLI entry
└ sploitscan.py – orchestrator & method implementations
└ config.json – default settings schema
└ templates/report_template.html – Jinja2 HTML template
- Supporting files:
- Dockerfile – containerization
- pyproject.toml, requirements.txt – dependencies & packaging
- docs/ – man pages & changelog
- .github/workflows/release.yml – CI/CD release pipeline

##### README for additional insights
- The README lists all functional “methods” (CVE info, EPSS, CISA, public exploits, HackerOne, AI, patch priority, local CVE DB, scanner import), describes configuration resolution, export options, and Docker usage.

##### Main components & interactions
a. Components
1. CLI Front-end
2. Configuration Manager
3. Orchestrator / Controller
4. Data-Retrieval Modules (“Methods”):
- CVE Info Fetcher
- EPSS Service
- CISA KEV
- Public Exploit Aggregator (GitHub, ExploitDB, VulnCheck, Packet Storm, Nuclei)
- HackerOne GraphQL
- AI Risk Assessment (OpenAI, Google Gemini, Grok, DeepSeek)
- Vulnerability Scanner Importer (Nessus, Nexpose, OpenVAS, Docker Scout)
- Local CVE V5 Database Manager
5. Data Aggregator & Patching Priority Engine
6. Output Formatter & Exporters (HTML via Jinja2, JSON, CSV)
7. External Services & Data Sources (APIs and local repo)

b. Relationships / Data flow
- User invokes CLI → CLI Front-end
- CLI reads CLI args → Configuration Manager loads config.json (custom path/env/default)
- Orchestrator receives args + config → initializes selected Data-Retrieval Modules in parallel or sequence
- Each Module queries its external service or local DB → returns raw data
- Orchestrator forwards raw data to Data Aggregator → combined data object
- Patching Priority Engine computes patch priority (A+ through D)
- Output Formatter selects exporter (based on –export flag) → uses Jinja2 templates for HTML or serializes to JSON/CSV
- Results written to stdout or file

c. Architectural patterns and design principles
- Modular “plugin-like” data-retrieval methods
- Single Controller/Orchestrator dispatching to modules
- Configuration-first design (over multiple search paths)
- Separation of concerns: retrieval, aggregation, priority, templating, exporting
- Extensible: new methods or exporters can be added by dropping in a new module and updating orchestrator

d. Relevant technologies, frameworks, or libraries
- Python 3.x
- argparse (or click) for CLI parsing
- requests / httpx for HTTP API calls
- xmltodict (for Nessus/OpenVAS XML)
- Jinja2 for HTML templating
- pandas or built-in CSV / JSON modules
- Docker (for container image defined in Dockerfile)
- GitHub Actions for CI/CD (release workflow)

##### Detailed capture of essential elements
- Do not oversimplify: represent each of the ~8 data-retrieval methods as its own element.
- Local CVE DB repo clone as a storage component.
- Docker container boundary when illustrating containerized deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Docker Container" 
        direction TB
        EntryPoint["Entry‐point Wrapper"]:::internal
        CLI["CLI Front-end"]:::internal
        ConfigMgr["Configuration Manager"]:::config
        Orchestrator["Orchestrator / Controller"]:::internal

        subgraph "Data‐Retrieval Modules" 
            direction TB
            CVEInfo["CVE Info Fetcher"]:::internal
            EPSS["EPSS Service"]:::internal
            CISA["CISA KEV"]:::internal
            PublicExploits["Public Exploit Aggregator"]:::internal
            HackerOne["HackerOne GraphQL"]:::internal
            AIRisk["AI Risk Assessment"]:::internal
            ScannerImport["Vulnerability Scanner Importer"]:::internal
            LocalDB["Local CVE V5 DB Manager"]:::internal
        end

        Aggregator["Data Aggregator"]:::internal
        Priority["Patching Priority Engine"]:::internal

        subgraph "Output Formatter & Exporters"
            direction TB
            JinjaTemplate["HTML Exporter (Jinja2)"]:::exporter
            JSONExp["JSON Exporter"]:::exporter
            CSVExp["CSV Exporter"]:::exporter
        end

        Output["Stdout / File Output"]:::exporter
    end

    subgraph "External Services & Data Sources"
        direction TB
        ExtAPIs["APIs (CVE, EPSS, CISA, GitHub, ExploitDB, etc.)"]:::external
        LocalRepo["Local CVE Repo"]:::external
    end

    subgraph "CI/CD & Releasing"
        CICD["GitHub Actions"]:::external
        PyPI["PyPI / DockerHub"]:::external
    end

    subgraph "Supporting Files"
        DockerfileNode["Dockerfile"]:::config
        PyProj["pyproject.toml"]:::config
        Requirements["requirements.txt"]:::config
        Manual["CLI Manual"]:::config
        Changelog["CHANGELOG.md"]:::config
    end

    %% Data Flow
    EntryPoint -->|invokes| CLI
    CLI -->|reads args| ConfigMgr
    CLI -->|passes to| Orchestrator
    ConfigMgr -->|provides config| Orchestrator
    Orchestrator -->|initializes| CVEInfo
    Orchestrator -->|initializes| EPSS
    Orchestrator -->|initializes| CISA
    Orchestrator -->|initializes| PublicExploits
    Orchestrator -->|initializes| HackerOne
    Orchestrator -->|initializes| AIRisk
    Orchestrator -->|initializes| ScannerImport
    Orchestrator -->|initializes| LocalDB

    CVEInfo -->|fetches| ExtAPIs
    EPSS -->|fetches| ExtAPIs
    CISA -->|fetches| ExtAPIs
    PublicExploits -->|fetches| ExtAPIs
    HackerOne -->|fetches| ExtAPIs
    AIRisk -->|fetches| ExtAPIs
    ScannerImport -->|reads from| ExtAPIs
    LocalDB -->|reads from| LocalRepo

    CVEInfo --> Aggregator
    EPSS --> Aggregator
    CISA --> Aggregator
    PublicExploits --> Aggregator
    HackerOne --> Aggregator
    AIRisk --> Aggregator
    ScannerImport --> Aggregator
    LocalDB --> Aggregator

    Aggregator --> Priority
    Priority --> JinjaTemplate
    Priority --> JSONExp
    Priority --> CSVExp

    JinjaTemplate --> Output
    JSONExp --> Output
    CSVExp --> Output

    CICD -->|publishes| PyPI

    %% Click Events
    click CLI "https://github.com/xaitax/sploitscan/blob/main/sploitscan/__main__.py"
    click EntryPoint "https://github.com/xaitax/sploitscan/blob/main/sploitscan.py"
    click ConfigMgr "https://github.com/xaitax/sploitscan/blob/main/sploitscan/config.json"
    click Orchestrator "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click CVEInfo "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click EPSS "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click CISA "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click PublicExploits "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click HackerOne "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click AIRisk "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click ScannerImport "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click LocalDB "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click JinjaTemplate "https://github.com/xaitax/sploitscan/blob/main/sploitscan/templates/report_template.html"
    click JSONExp "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click CSVExp "https://github.com/xaitax/sploitscan/blob/main/sploitscan/sploitscan.py"
    click DockerfileNode "https://github.com/xaitax/sploitscan/tree/main/Dockerfile"
    click PyProj "https://github.com/xaitax/sploitscan/blob/main/pyproject.toml"
    click Requirements "https://github.com/xaitax/sploitscan/blob/main/requirements.txt"
    click Manual "https://github.com/xaitax/sploitscan/blob/main/docs/sploitscan.1"
    click Changelog "https://github.com/xaitax/sploitscan/blob/main/CHANGELOG.md"
    click CICD "https://github.com/xaitax/sploitscan/blob/main/.github/workflows/release.yml"

    classDef internal fill:#ccf,stroke:#3399ff,stroke-width:1px;
    classDef external fill:#cfc,stroke:#33cc33,stroke-width:1px;
    classDef config fill:#fcf3cf,stroke:#f1c40f,stroke-width:1px;
    classDef exporter fill:#e5ccff,stroke:#9b59b6,stroke-width:1px;
```
