
Modellazione del mondo per la difesa dalle minacce informatiche
Sistema di modellazione mondiale della difesa dalle minacce informatiche
Bandjacks è un sistema completo di intelligence sulle minacce informatiche (CTI) che:
| Guida | Descrizione |
|---|---|
| Avvio rapido | Avvio in 5 minuti |
| Configurazione completa | Configurazione completa dell'ambiente |
| Uso CLI | Guida all'interfaccia a riga di comando |
| Riferimento API | Documentazione delle API REST |
| Analisi di co-occorrenza | Documentazione delle analisi |
| Generazione AttackFlow | Guida alla generazione dei flussi |
| Sistema di revisione | Revisione human-in-the-loop |
git clone https://github.com/yourusername/bandjacks.git cd bandjacks
uv sync
pip install -e .
cd ui && npm install && cd ..
### Configurazione dell'ambiente
**IMPORTANTE:** È necessario configurare le variabili d'ambiente prima di avviare l'applicazione. L'applicazione richiede che `NEO4J_PASSWORD` sia impostata.
Crea un file `.env` nella root del progetto:```bash
# Copy the sample file
cp infra/env.sample .env
# Edit .env and set your actual passwords
nano .env
Configurazione richiesta in .env:```bash
NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=your-actual-neo4j-password # MUST BE SET - no default provided
OPENSEARCH_URL=http://localhost:9200 OPENSEARCH_USER=admin OPENSEARCH_PASSWORD=your-opensearch-password # Optional if security is disabled
LOCAL_LLM_API_BASE=http://192.168.1.100:8080/v1 # Base URL of your local server LOCAL_LLM_MODEL=mistral-nemo # Model name as the server reports it LOCAL_LLM_API_KEY=no-key # Most local servers accept any value
PRIMARY_LLM=gemini GOOGLE_API_KEY=your-gemini-api-key
OPENAI_API_KEY=your-openai-api-key
ATTACK_INDEX_URL=https://raw.githubusercontent.com/mitre-attack/attack-stix-data/master/index.json ATTACK_COLLECTION=enterprise-attack ATTACK_VERSION=latest
REDIS_URL=redis://localhost:6379
**Nota:** L'applicazione non si avvierà se `NEO4J_PASSWORD` non è impostata. Vedere [Correzione delle variabili d'ambiente](https://github.com/blevene/bandjacks/blob/main/ENV_VARIABLES_FIX.md) per i dettagli.
### Avvio dei servizi```bash
# Start the FastAPI backend server
uv run uvicorn bandjacks.services.api.main:app --reload --port 8000
# In another terminal, start the Next.js frontend
cd ui && npm run dev
# Access the applications
open http://localhost:8000/docs # API documentation
open http://localhost:3000 # Frontend UI
Bandjacks include una CLI completa per le operazioni di threat intelligence:```bash
uv run python -m bandjacks.cli.main --help
> **Nota:** La CLI richiede che le variabili d'ambiente siano impostate (NEO4J_PASSWORD, ecc.). Eseguire dalla root del progetto dove si trova `.env`.
### Comandi di query```bash
# Search for threat intelligence
uv run python -m bandjacks.cli.main query search "ransomware encryption techniques" --top-k 10
# Explore graph relationships
uv run python -m bandjacks.cli.main query graph "attack-pattern--abc123" --depth 2
uv run python -m bandjacks.cli.main review queue --status pending --limit 20
uv run python -m bandjacks.cli.main review approve "candidate-123" --reviewer analyst-1
uv run python -m bandjacks.cli.main review reject "candidate-456" --reviewer analyst-1 --reason "False positive"
### Estrazione dei documenti```bash
# Extract CTI from a document
uv run python -m bandjacks.cli.main extract document ./report.pdf --confidence-threshold 80 --show-evidence
Nota: I comandi di analisi richiedono dati
AttackEpisodein Neo4j per restituire risultati.```bash
uv run python -m bandjacks.cli.main analytics top-cooccurrence --limit 25 --min-episode-size 2
uv run python -m bandjacks.cli.main analytics conditional "attack-pattern--abc123" --limit 25
uv run python -m bandjacks.cli.main analytics actor "intrusion-set--xyz789" --metric npmi
uv run python -m bandjacks.cli.main analytics bundles --min-support 3 --min-size 3 --max-size 5 --format json --output bundles.json
uv run python -m bandjacks.cli.main analytics global --min-support 2 --limit 50 --format csv --output pairs.csv
### Comandi del flusso di lavoro```bash
# Process a directory of reports with analytics
uv run python -m bandjacks.cli.main workflow process-reports ./reports/ --workers 3 --analyze --export-dir ./results/
# Bulk export all analytics data
uv run python -m bandjacks.cli.main workflow bulk-export --export-dir ./analytics_export/
uv run python -m bandjacks.cli.main admin health
uv run python -m bandjacks.cli.main admin cache-stats
uv run python -m bandjacks.cli.main admin cache-clear --pattern "search:*"
uv run python -m bandjacks.cli.main admin optimize
## Interfaccia frontend