# Soc Caldera Operations

> Use when operating a MITRE Caldera server day to day for authorized adversary emulation. Covers installing and hardening the server, deploying agents to in-scope hosts, running and monitoring operations, managing facts and payloads, cleaning up agents and artifacts after an engagement, and keeping OPSEC and detection notes so defenders learn from every run. Use when a Caldera deployment needs to be set up, run safely, or torn down cleanly.

- Skill: `mizazhaider-ceh/soc-caldera-operations` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/soc-caldera-operations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/soc-caldera-operations/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/soc-caldera-operations

---


Caldera has three moving parts: the server (plans operations and
serves payloads), agents (small programs on target hosts that run
abilities and report back), and the UI and API (where operators build
adversaries, launch operations, and read results). This skill covers
running that stack for authorized work only: a hardened server on an
isolated network segment, agents only on in-scope hosts, every
operation logged, and a full cleanup when the engagement ends. An
agent left running after an engagement is a finding against you, not
a convenience.

## Quick Workflow

1. Install Caldera on a dedicated host on an isolated segment, never
   on a shared production server.
2. Harden the install: change the default API key, restrict network
   access to operator and agent hosts, and enable server logging.
3. Deploy agents only to in-scope hosts, one agent group per scope
   boundary, and confirm each agent checks in.
4. Build or import the adversary profile and review every ability
   command before the operation starts.
5. Run the operation, watch agent check-ins and ability results live,
   and keep defenders informed through the shared log.
6. Export the operation report and per-ability output for the
   engagement record and the detection backlog.
7. Clean up: stop operations, uninstall agents, remove payloads and
   artifacts from targets, and rotate the API key.
8. Write detection notes for every technique run, covered or not,
   and hand them to detection engineering.

## 1. Server setup and hardening

Install from the project repository into a dedicated directory, run
the server as a non-root user where possible, and put it behind a
firewall rule that allows only operator workstations and agent hosts.
The default API key in conf/local.yml must be replaced before any
agent connects, because anyone holding it can drive operations.
Keep the server off the internet-facing path entirely; agents connect
to it over the isolated segment, and operators reach the UI over VPN.

```bash
# Install Caldera on a dedicated host (Debian or Ubuntu).
sudo apt-get update && sudo apt-get install -y python3 python3-pip git
git clone https://github.com/mitre/caldera.git --recursive
cd caldera
pip3 install -r requirements.txt
# Generate a strong API key and set it in conf/local.yml before first run.
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
```

```bash
# Start the server and confirm it listens on the expected port.
python3 server.py --insecure &
sleep 10
curl -s -o /dev/null -w "server HTTP status: %{http_code}\n" http://localhost:8888/
# Harden: restrict port 8888 to operator and agent networks only.
sudo ufw allow from 10.20.30.0/24 to any port 8888
sudo ufw deny 8888
```

## 2. Agents: deploy, group, and monitor

Caldera agents (the stock agent is called Sandcat) phone home to the
server, receive instructions, run abilities, and return output. Deploy
with the server address and a group name baked in, so an agent can
only join the operation it belongs to. Group names are scope
boundaries: one group per engagement segment, never a shared group
across engagements. Watch check-ins during the run; an agent that
goes silent mid-operation is either blocked, cleaned by EDR, or
offline, and each of those is worth recording.

```bash
# Deploy a Sandcat agent on a Linux lab host, group lab-win.
# The server URL and group come from the engagement scope document.
curl -s -X POST -H "KEY: CALDERA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"paw": "lab-agent-01", "group": "lab-win", "platform": "linux"}' \
  "http://localhost:8888/api/v2/agents" | python3 -m json.tool
# On the target host, run the agent binary with the server address:
# ./sandcat -server http://CALDERA_SERVER:8888 -group lab-win -v
```

```bash
# List live agents and their last check-in before starting an operation.
curl -s -H "KEY: CALDERA_KEY" \
  "http://localhost:8888/api/v2/agents" | \
  python3 -c "import json,sys; [print(a.get('paw'), a.get('group'), \
    a.get('platform'), a.get('last_seen')) for a in json.load(sys.stdin)]"
```

## 3. Running and watching an operation

Launch operations from a reviewed adversary profile, never by
hand-picking abilities at run time, so the run is repeatable and the
report matches the plan. During the run, monitor the operation state
and per-link results (each executed ability is a link with output).
If a link produces unexpected output, pause the operation and check
before continuing; an unreviewed runaway chain is how scope
excursions happen.

```bash
# Start an operation and poll its state until it closes.
OPERATION_ID=$(curl -s -X POST -H "KEY: CALDERA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "emulation-run-01", "adversary_id": "ADVERSARY_ID",
       "agent_group": "lab-win", "auto_close": true}' \
  "http://localhost:8888/api/v2/operations" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
echo "operation: $OPERATION_ID"
curl -s -H "KEY: CALDERA_KEY" \
  "http://localhost:8888/api/v2/operations/$OPERATION_ID" | \
  python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('state'), d.get('name'))"
```

## 4. Cleanup, OPSEC, and detection notes

Cleanup is part of the operation, not an afterthought. Uninstall every
agent, delete payloads and staged files from targets, close or delete
operations on the server, and rotate the API key so a leaked key from
this engagement cannot drive the next one. OPSEC here means
operational hygiene, not stealth against defenders: defenders are
supposed to see you, and the shared log should let them reconstruct
every step. Detection notes record, per technique, the process tree,
command lines, network connections, and log events the run produced,
so each silent technique becomes a detection rule with real telemetry.

```bash
# End-of-engagement cleanup checklist, run and logged.
# 1. Stop any running operation through the UI or API.
curl -s -X POST -H "KEY: CALDERA_KEY" \
  "http://localhost:8888/api/v2/operations/OPERATION_ID/close" | head -c 200
echo
# 2. Remove agents from targets: kill the agent process, delete the
#    agent binary and working directory on each in-scope host.
# 3. Delete staged payloads from the server payload directory.
# 4. Rotate the API key in conf/local.yml and restart the server.
# 5. Confirm zero agents remain before declaring the engagement closed.
curl -s -H "KEY: CALDERA_KEY" \
  "http://localhost:8888/api/v2/agents" | python3 -c "import json,sys; print('agents remaining:', len(json.load(sys.stdin)))"
```

```python
#!/usr/bin/env python3
"""Detection notes template: one entry per technique run."""
notes = [
    {"technique": "T1059.001", "process": "powershell.exe",
     "parent": "sandcat agent process", "logs": "Event 4104, Sysmon 1",
     "detected": True, "rule": "EDR PowerShell alert"},
    {"technique": "T1087.001", "process": "powershell.exe Get-LocalUser",
     "parent": "sandcat agent process", "logs": "Event 4104 only",
     "detected": False, "rule": "EXAMPLE RULE (draft, tune before use): alert on Windows Event 4104 where ScriptBlockText contains Get-LocalUser"},
]
for n in notes:
    print(f"{n['technique']} | {n['process']} | logs: {n['logs']} | "
          f"detected: {n['detected']} | next: {n['rule']}")
```

## Edge cases

- The server will not start. Check the Python version, reinstall
  requirements, and read server logs before changing config; a
  missing plugin dependency is the usual cause.
- Agents never check in. Check the firewall rule for port 8888, the
  server address baked into the agent, and whether EDR quarantined
  the agent binary on the target.
- An agent appears from an unknown host. Treat it as out of scope:
  kill the operation, remove the agent, and report it to the
  engagement lead before anything else runs.
- Payloads fail to download to agents. Verify the payload directory
  and the server address the agent uses; agents fetch payloads from
  the server, so a wrong address breaks every payload ability.
- The operation stalls with unexecuted links. A missing fact is the
  usual cause: check which parser should have produced it and
  whether the producing ability actually ran.
- Cleanup misses an agent. Re-scan the agent list after cleanup and
  sweep in-scope hosts for the agent process and directory; do not
  close the engagement with agents unaccounted for.

## Key references

- MITRE Caldera documentation at https://caldera.readthedocs.io
- MITRE ATT&CK framework at https://attack.mitre.org
- Related skills in this repo: soc-adversary-emulation-caldera for
  planning the emulation itself, soc-red-team-planning for scope and
  rules of engagement, purple-team-exercises for the joint
  red and blue loop, detection-as-code for turning detection notes
  into rules.

