Lesson 13.2

A scripted triage

Script an Arcsentry triage end to end: create a case, analyze collections, run checks with AQL and arrows, export CSV, and parse a collection to JSONL without a case.

15 minExperienced analysts
At a glance for experienced analysts
  • case create → analyze (add and parse, waits until done) → query / quiver run → --format csv.
  • analyze takes the format from the file: .arcx Collector, .tar.gz UAC, .zip Velociraptor, .vhdx KAPE, .csv/.jsonl. --source overrides it.
  • parse turns a collection into JSONL files with no case at all, for other tools.
Command line
arcsentry analyze --case "$CASE" --input web01.arcx --password "$PW"

This lesson builds a script that triages a collection with no one at the keyboard: the kind you run when twenty laptops come back from an incident.

The script

#!/usr/bin/env bash
set -euo pipefail

PW="$(cat /secure/collection.pw)"          # never hard-code the password
CASE=$(arcsentry case create --name "Triage $(date +%F)" \
         --path "/cases/triage-$(date +%F)" --format json | jq -r .id)

# 1. Add and analyze every collection; analyze waits until each run ends
for f in /evidence/incoming/*.arcx; do
  arcsentry analyze --case "$CASE" --input "$f" --password "$PW" --format table
done

# 2. Run the team's global arrows on everything
for id in webshell-thumb-cache rdp-brute; do
  arcsentry quiver run --case "$CASE" --id "$id" --format jsonl >> runs.jsonl
done

# 3. Ask the same question of every host, into one CSV per host
arcsentry evidence list --case "$CASE" --format json | jq -r '.items[].id' |
while read -r EV; do
  arcsentry query --case "$CASE" --evidence "$EV" --format csv \
    --aql 'filter event_type == "logs_nginx" | top 10 remote_addr' > "top-clients-$EV.csv" \
    || echo "no web server log on $EV" >&2
done

# 4. Keep the case log with the results
arcsentry case-log --case "$CASE" --format csv > case-log.csv

Then open the case in the desktop app to review the matches, the Timeline and the dashboard.

What each step does

Step Command Notes
Case case create Prints the case record; keep the UUID
Evidence analyze Adds, parses and waits. Narrow it with --include-processor, --exclude-processor, --from and --to
Detections quiver run Marks every match with the arrow’s action, labelled with the arrow
Questions query One evidence item at a time, so loop over hosts
Record case-log Every step above, with its time and actor

Without a case: parse

When another tool needs the records, skip the case:

arcsentry parse --input /evidence/web01.arcx --output /evidence/web01-jsonl --password-file /secure/collection.pw

You get one <parser_id>.jsonl per parser, plus manifest.json with every output and its record count. A parser that fails is recorded in the manifest while the run still succeeds; an unreadable input or a wrong password fails the command.

From a case: export

arcsentry evidence export --case "$CASE" --evidence-id "$EV" --output /exports/web01

This is the command-line form of Export records in the Evidence view.

Check yourself

1. What does analyze do that evidence add alone does not?
2. You need nginx and auditd records as JSONL for a SIEM, with no Arcsentry case. Which command?
Progress is saved in this browser only.