Calectr is a command-line tool that converts adversary simulation logs from MITRE Caldera into VECTR-compatible assessments. It transforms Caldera JSON logs into enriched CSVs using MITRE ATT&CK data and imports them into VECTR via the GraphQL API.
- Parse Caldera JSON logs and convert them into VECTR-formatted CSVs
- Enrich MITRE techniques with detection tips, URLs, and data sources
- Automatically upload test cases as assessments, campaigns, and test cases to VECTR
- Works with both older and newer VECTR versions (with or without Outcome Path support)
- Also supports direct import of VECTR-formatted CSVs
💡 Calectr is heavily inspired by the excellent work by Security Risk Advisors in their
vectr-toolsproject.
I’ve extended their work to:
- Add Caldera-to-VECTR transformation
- Automatically enrich data using MITRE CTI
- Provide a seamless command-line workflow
- Python 3.9+
- A running instance of VECTR with API key access
- Caldera JSON logs or VECTR-compatible CSVs
- Internet access (to fetch latest MITRE ATT&CK dataset)
-
Clone the repository:
git clone https://github.com/Bhanunamikaze/Calectr.git cd Calectr -
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
- Log into your VECTR instance.
- Click your profile in the top-right corner → API Keys.
- Click "Create API Key".
- Copy the Client ID and Secret — format them as:
API_KEY="CLIENT_ID:SECRET"
Create a .env file in the project root, and populate it like this:
API_KEY="XPHN67C778OD5NGTARI0XW:cOUbbjVDgJ4av78JTeNUK3QVAVsKbau4lsXdISHqom4="
VECTR_GQL_URL="https://vectr.internal/sra-purpletools-rest/graphql"
TARGET_DB="MY_USER_DB"
ORG_NAME="Security Risk Advisors"- Login to your Caldera server
- Go to the Operations tab
- Click on the operation you want to export
- Click Download Report (top right corner)
- In the dialog:
- ✅ Check "Include agent output"
- 📝 Select "Event logs"
- Click Download
Save the downloaded .json file and use it as input to Calectr:
python main.py --caldera-json Files/operation_event-logs.jsonpython main.py --caldera-json Files/operation_event-logs.jsonThis will:
- Download the latest MITRE ATT&CK dataset
- Convert the JSON logs to a VECTR-compatible CSV (
Files/vectr_mapped_output.csv) - Upload the data to your VECTR instance using the API
python main.py --vectr-csv Files/vectr_mapped_output.csvThis will:
- Skip the MITRE and Caldera transformation steps
- Directly upload the CSV to your VECTR instance
# Convert and import from Caldera JSON
python main.py --caldera-json Files/example-run.json
# Direct import from VECTR CSV
python main.py --vectr-csv Files/example-export.csvThis project is licensed under the MIT License.
Portions adapted from SecurityRiskAdvisors/vectr-tools.