Skip to content

feat: Linux/macOS one-flow install + Claude Code native OTel ingest (prototype) - #192

Merged
blitzcrieg1 merged 3 commits into
masterfrom
feat/linux-install-and-otel-ingest
Sep 22, 2026
Merged

blitzcrieg1 merged 3 commits into
masterfrom
feat/linux-install-and-otel-ingest

Conversation

@blitzcrieg1

Copy link
Copy Markdown
Owner

What

Two related steps toward making the recorder reachable outside Windows, plus the first ingest path that is not a hook.

1. Linux/macOS one-flow install

  • scripts/install.sh mirrors install.ps1: venv, Python + dashboard deps, .env from example, IDE hooks, doctor --fix. POSIX flags: --skip-hooks, --skip-dashboard, --no-doctor, --tool-policy-block, --dlp-block.
  • Hooks install via agentmetry hooks install (cross-platform), so coverage is the seven-agent set, not the two the PowerShell pair writes. Failure still fails the install (the install: hook setup uses global Python, then install.ps1 reports success after failure #137 semantics).
  • scripts/start-dev.sh / scripts/stop-dev.sh: background orchestrator + dashboard, pid file, logs under data/logs/.
  • .gitattributes pins *.sh/*.py to LF — autocrlf on Windows would otherwise be free to CRLF the shell scripts on a future re-commit.

2. Claude Code native OTel ingest (prototype)

  • scripts/otel_receiver.py: local OTLP/HTTP-JSON receiver (127.0.0.1:4318). Claude Code's telemetry docs state detection/correlation/alerting are the backend's responsibility; this is the first cut of that backend for the native stream.
  • Mapped: tool_result → tool_called/tool_failed (args hashed in-process, traits, MITRE, ATLAS — same enrichment the hook path applies), tool_decision → approval_response, mcp_server_connection → mcp_schema (partial). The other documented event types are counted and listed via --print-mapping, never dropped — that list is schema v1.3 input.
  • Prompts and responses are never forwarded.

Verification

End-to-end on a disposable orchestrator instance (port 8010, temp data dir): a synthetic Claude Code OTel payload carrying Bash cat ~/.ssh/id_rsa followed by WebFetch egress produced, on the hash-chained trail: tool_called Bash (traits private_key, T1552.004, ATLAS) → tool_called WebFetch (T1071.001) → credential-exfil CRITICAL, with input_hash present and no plaintext command stored. GET /audit/detections/{correlation_id} returns the finding with untriaged: 1.

Not in this PR (deliberate)

  • The receiver stays a scripts/ prototype: promotion into the package (proper module, tests, config surface) is the 0.9.0 work. This PR ships it in runnable, documented form so it can be exercised against real Claude Code traffic first.
  • CI does not yet run the shell installer on Linux; the clean-environment lesson from 0.8.0 applies here too, and an install-matrix job is the natural follow-up.

install.sh mirrors install.ps1 (venv, deps, .env, hooks, doctor --fix)
with POSIX flags; hooks go through `agentmetry hooks install` so the
seven-agent coverage applies, not the two the PowerShell pair writes.
start-dev.sh/stop-dev.sh replace start-dev.bat with background
processes, pid file, and logs under data/logs/.
Claude Code's telemetry docs delegate anomaly detection, correlation and
alerting to the backend. scripts/otel_receiver.py is the first cut of
that backend for the native stream: OTLP/HTTP-JSON in, canonical events
out, with the hook path's full enrichment (args hashed in-process,
traits, MITRE/ATLAS) so sequence rules see OTel traffic too.

Mapped: tool_result -> tool_called/tool_failed, tool_decision ->
approval_response, mcp_server_connection -> mcp_schema (partial). The
other documented event types are counted and listed, never dropped --
that list is schema v1.3 input.

Verified end-to-end: credential-read-then-egress carried entirely on
the native OTel stream fires credential-exfil (CRITICAL) onto the
hash-chained trail.
autocrlf on a Windows checkout is free to flip shell scripts to CRLF on
re-commit, which kills them on Linux/macOS with "/usr/bin/env bash\r".
The installer shipped in the previous commit only stays runnable because
the blob happened to be written before any CRLF checkout touched it.
@blitzcrieg1
blitzcrieg1 merged commit 42f6177 into master Sep 22, 2026
9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant