Overview
The storage API provides cloud object storage integration for source code upload/download and scan result archival. All objects are scoped to a project via theX-Project-UUID header and stored under <bucket>/<project-uuid>/.
Storage is disabled by default. Enable it by setting storage.enabled: true in vigolium-configs.yaml. All endpoints return 503 Service Unavailable when storage is not configured.
| Endpoint | Method | Role | Description |
|---|---|---|---|
/api/storage/upload-source | POST | Operator | Upload source code archive |
/api/storage/source/:key | GET | Viewer | Download source code by key |
/api/storage/results/:scan-uuid | GET | Viewer | Download scan result bundle (.tar.gz) |
/api/storage/presign | POST | Operator | Generate presigned upload/download URL |
Security
All storage operations enforce project-level isolation:- Every object path is prefixed with the authenticated project UUID (
<bucket>/<project-uuid>/<key>). The project UUID comes from theX-Project-UUIDheader, set by server middleware, clients cannot override the prefix. - Keys and UUIDs are validated against path traversal (
../,..\\,..) before any storage operation. Malicious keys are rejected with400 Bad Request. - Presigned URLs are scoped to the requesting project, a presigned URL for project A cannot access objects in project B.
GCP Setup
Vigolium uses S3-compatible HMAC keys to talk to GCS. You need to create HMAC credentials from a service account, then configure them invigolium-configs.yaml.
Step 1: Create HMAC Keys from a Service Account
If you have a service account JSON key (e.g.gcs-readwrite-key.json), activate it and create HMAC credentials:
accessId and secret. Save both, the secret is only shown once.
Step 2: Create a GCS Bucket
Step 3: Configure Vigolium
Set the credentials and bucket name as environment variables:~/.vigolium/vigolium-configs.yaml:
Step 4: Verify Connectivity
AWS S3 / MinIO
For AWS S3, change the driver and region:Storage Object Layout
All objects are prefixed with the project UUID for multi-tenant isolation:.tar.gz format (gzip-compressed tar), matching the vigolium db export --format bundle format.
CLI Usage
Source Download from Storage
Usegs:// URIs with --source to download and extract source code from cloud storage before scanning:
source_type field in the DB records "gcs".
Result Upload to Storage
Add--upload-results to upload scan results to cloud storage after completion:
- Native scans:
gs://<project-uuid>/native-scans/<scan-uuid>/results.tar.gz - Agentic scans:
gs://<project-uuid>/agentic-scans/<run-uuid>/results.tar.gz
storage_url field on the Scan / AgenticScan DB record is updated with the gs:// URL after upload.
POST /api/storage/upload-source
Uploads a source code archive to cloud storage, scoped to the project. Content-Type:multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Source code archive to upload |
storage_url can be passed directly to --source (CLI) or the source field (API).
GET /api/storage/source/:key
Downloads a previously uploaded source file.application/octet-stream with Content-Disposition: attachment.
Returns 400 if the key contains path traversal sequences.
GET /api/storage/results/:scan-uuid
Downloads the result bundle for a native scan or agentic scan. Searchesnative-scans/<uuid>/results.tar.gz first, then agentic-scans/<uuid>/results.tar.gz.
application/gzip with Content-Disposition: attachment.
Returns 404 if no results have been uploaded for the given UUID.
Extract the bundle:
POST /api/storage/presign
Generates a presigned URL for direct upload or download, bypassing the API server. Useful for large files or client-side uploads. Request body:| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Object key (e.g. ugc/source-code.tar.gz) |
method | string | No | GET (default) or PUT |
expiry_seconds | int | No | URL expiry in seconds (default: 3600 / 1 hour) |
../ or similar sequences are rejected with 400.
Using Storage with Agentic Scans (API)
Upload Source, Then Run Agentic Scan
Run Autopilot with Local Source + Upload Results
Run Swarm with GCS Source
Storage URL in Scan Records
Whenupload_results is enabled, the storage_url field is populated on the Scan or AgenticScan record after upload completes.
Native scan:
