Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.22 KB

File metadata and controls

44 lines (30 loc) · 1.22 KB

CAPE Sandbox Orchestrator API

This project exposes a small FastAPI service that submits files or URLs to a CAPE sandbox, polls the analysis task until the report is ready, stores the result in SQLite, and optionally asks a local Ollama endpoint for a short verdict.

What it does

  • Accepts a file upload or URL through POST /submit
  • Submits the sample to CAPE
  • Polls the CAPE task until the report is generated
  • Fetches the final CAPE report and screenshots
  • Stores the analysis result in analysis_results.db
  • Returns stored results through GET /results/{identifier}
  • Sends a compact report summary to Ollama for a JSON verdict

CAPE documentation

Official CAPE documentation: https://capev2.readthedocs.io/

Setup

  1. Create and edit the .env file if needed:
CAPE_URL=http://localhost:8000
DB_NAME=analysis_results.db
OLLAMA_URL=http://localhost:11434/api/generate
  1. Install dependencies:
pip install -r requriments.txt
  1. Run the API:
uvicorn CAPE_analysis:app --reload

Notes

  • The code expects a running CAPE instance and, if you want AI verdicts, a running Ollama server.
  • The SQLite database and other local runtime files are ignored by git so the repository stays clean.