Repository navigation
feat: Linux/macOS one-flow install + Claude Code native OTel ingest (prototype) - #192
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shmirrorsinstall.ps1: venv, Python + dashboard deps,.envfrom example, IDE hooks,doctor --fix. POSIX flags:--skip-hooks,--skip-dashboard,--no-doctor,--tool-policy-block,--dlp-block.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 underdata/logs/..gitattributespins*.sh/*.pyto 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.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.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_rsafollowed by WebFetch egress produced, on the hash-chained trail:tool_called Bash(traitsprivate_key, T1552.004, ATLAS) →tool_called WebFetch(T1071.001) →credential-exfilCRITICAL, withinput_hashpresent and no plaintext command stored.GET /audit/detections/{correlation_id}returns the finding withuntriaged: 1.Not in this PR (deliberate)
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.