Last updated: 2026-03-15
spuc jsonrpc exposes SPUC translation as a local HTTP API for analyst automation.
Important:
- Endpoint is
POST /rpcon localhost. - Authentication is mandatory via
Authorization: Bearer <token>. - This is a lightweight HTTP JSON endpoint (not JSON-RPC 2.0 method envelopes).
spuc jsonrpc --port 8080Optional fixed token:
spuc jsonrpc --port 8080 --token my-tokenAt startup SPUC prints:
- listening URL
- bearer token
- a valid
curlexample
- Method:
POST - Path:
/rpc - Content-Type:
application/json - Auth header:
Authorization: Bearer <token>
{
"rule": "[process:name = 'cmd.exe']",
"to": ["sigma", "kql"],
"description": "Optional analyst description",
"sigma_targets": ["splunk"],
"mode": "strict",
"rule_confidence": 80
}Field reference:
rule(string, required): STIX pattern.to(string[], optional): target outputs.- Native values:
sigma,eql,kql,snort,suricata,yara. - Dynamic values:
sigma-to-<backend>for compatible backends discovered fromsigma plugin listat process startup. - If omitted/empty: SPUC evaluates all targets.
- Native values:
description(string, optional): analyst context used by translators.sigma_targets(string[], optional): backend names forsigma convert(only applied whentoincludessigma).mode(string, optional):strict(default) orpartial.rule_confidence(number, optional):0..100.
{
"ok": true,
"results": [
{
"target": "sigma",
"runtime_status": "exact",
"conversion_confidence": 95,
"rule_confidence": 80,
"cause": null,
"summary": "Semantic mapping preserved",
"notes": [],
"output": "..."
}
],
"error": null
}Notes:
ok: truemeans request was processed.- Always inspect each
results[*].runtime_status:exactlossyunsupported
curl -X POST 'http://127.0.0.1:8080/rpc' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-raw "{\"rule\":\"[ipv4-addr:value = '1.1.1.1']\",\"to\":[\"sigma\"]}"curl -X POST 'http://127.0.0.1:8080/rpc' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-raw "{\"rule\":\"[process:name = 'cmd.exe']\",\"to\":[\"sigma\",\"kql\",\"eql\"]}"cat > /tmp/spuc_rpc_payload.json << 'EOF'
{
"rule": "[process:name = 'cmd.exe'] FOLLOWEDBY [process:name = 'powershell.exe']",
"to": ["sigma", "kql"],
"mode": "partial",
"rule_confidence": 75
}
EOF
curl -X POST 'http://127.0.0.1:8080/rpc' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-binary @/tmp/spuc_rpc_payload.json- Missing/incorrect bearer token.
- Verify token printed at startup and the exact header format.
- Payload is malformed JSON.
- Common mistake: using
\'inside JSON strings. JSON does not support escaping single quotes.
toonly contains unknown values.- Use native targets (
sigma,eql,kql,snort,suricata,yara) plus discoveredsigma-to-*values fromspuc sigma list-targets.
- Request is valid, but target backend semantics are not available for that STIX pattern.
- Review
cause,summary, andnotesfields.
- Start service and copy token.
- Send one minimal
curlcall first. - Check per-target
runtime_status(not onlyok). - If rule is complex, move payload to a JSON file and call with
--data-binary @file. - Track
rule_confidenceexplicitly when using results in reports.