mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-05-26 18:48:04 +02:00
276 lines
7.3 KiB
Markdown
276 lines
7.3 KiB
Markdown
# FuzzForge Backend
|
|
|
|
A stateless API server for security testing workflow orchestration using Prefect. This system dynamically discovers workflows, executes them in isolated Docker containers with volume mounting, and returns findings in SARIF format.
|
|
|
|
## Architecture Overview
|
|
|
|
### Core Components
|
|
|
|
1. **Workflow Discovery System**: Automatically discovers workflows at startup
|
|
2. **Module System**: Reusable components (scanner, analyzer, reporter) with a common interface
|
|
3. **Prefect Integration**: Handles container orchestration, workflow execution, and monitoring
|
|
4. **Volume Mounting**: Secure file access with configurable permissions (ro/rw)
|
|
5. **SARIF Output**: Standardized security findings format
|
|
|
|
### Key Features
|
|
|
|
- **Stateless**: No persistent data, fully scalable
|
|
- **Generic**: No hardcoded workflows, automatic discovery
|
|
- **Isolated**: Each workflow runs in its own Docker container
|
|
- **Extensible**: Easy to add new workflows and modules
|
|
- **Secure**: Read-only volume mounts by default, path validation
|
|
- **Observable**: Comprehensive logging and status tracking
|
|
|
|
## Quick Start
|
|
|
|
### Prerequisites
|
|
|
|
- Docker and Docker Compose
|
|
- Python 3.11+
|
|
- UV package manager
|
|
- Prefect server running (via docker-compose.yaml)
|
|
|
|
### Installation
|
|
|
|
1. Start Prefect infrastructure:
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
2. Run the backend (uses UV internally):
|
|
```bash
|
|
cd backend
|
|
PREFECT_API_URL="http://localhost:4200/api" PREFECT_RESULTS_PERSIST_BY_DEFAULT="true" uv run uvicorn src.main:app --reload --port 8000
|
|
```
|
|
|
|
## API Endpoints
|
|
|
|
### Workflows
|
|
|
|
- `GET /workflows` - List all discovered workflows
|
|
- `GET /workflows/{name}/metadata` - Get workflow metadata and parameters
|
|
- `POST /workflows/{name}/submit` - Submit a workflow for execution
|
|
- `GET /workflows/{name}/parameters` - Get workflow parameter schema
|
|
|
|
### Runs
|
|
|
|
- `GET /runs/{run_id}/status` - Get run status
|
|
- `GET /runs/{run_id}/findings` - Get SARIF findings from completed run
|
|
- `GET /workflows/{name}/findings/{run_id}` - Alternative findings endpoint
|
|
|
|
### Metadata
|
|
|
|
- `GET /workflows/metadata/schema` - Get metadata.yaml schema
|
|
|
|
## Workflow Structure
|
|
|
|
Each workflow must have:
|
|
|
|
```
|
|
toolbox/workflows/{workflow_name}/
|
|
|