Repository navigation
feat(detection): guard egress rules + mcp-proxy auto-wrap of agentmetry-guard - #509
Merged
Merged
Conversation
…ry-guard Two new published rules consuming network_egress events from the agentmetry-guard sidecar: - credential-read-then-egress (critical): a credential-access tool call followed by a child process opening a connection, inside the sequence window. Closes the child-process escape where no single tool call looks like exfiltration. - guard-egress-denied (high): the sidecar refused a denylisted destination (outcome=denied). Corpus gains 3 cases (2 attack, 1 benign npm-egress) covering both rules; benchmark now 115 cases, 20 rules, 63/63 firings, 0 missed, 0 FP. Sigma pack regenerated (30 rules). README and detection-rules.md counts updated. mcp-proxy: with AGENTMETRY_GUARD=1 the wrapped MCP server runs under agentmetry-guard wrap (AGENTMETRY_GUARD_BIN, AGENTMETRY_GUARD_DENY), with the proxy session id passed as AGENTMETRY_CORRELATION_ID/SESSION_ID so guard events join the same trail correlation as the proxy's tool calls. Off and binary-missing both fall back to the raw command. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <[email protected]>
Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two new published detection rules consume
network_egressevents from the agentmetry-guard sidecar, andagentmetry mcp-proxycan now auto-wrap the MCP server in the guard.New rules (registered, in
BUILTIN_RULE_IDS, Sigma pack regenerated to 30 rules):credential-read-then-egress(critical): credential-access tool call, then anetwork_egressevent in the same session window. This is the child-process escape: a script the agent ran reads~/.sshand opens a tunnel without any single tool call looking like exfiltration.guard-egress-denied(high): the sidecar refused a denylisted destination (outcome=denied).Corpus: 3 new cases (credential-read-then-child-egress, guard-denied, benign npm egress). Benchmark: 115 cases, 20 rules covered, 63/63 firings, 0 missed, 0 false positives.
mcp-proxy auto-wrap:
AGENTMETRY_GUARD=1runs the server underagentmetry-guard wrap(AGENTMETRY_GUARD_BINto locate it,AGENTMETRY_GUARD_DENYfor the denylist). The proxy passes its session id asAGENTMETRY_CORRELATION_ID/AGENTMETRY_SESSION_ID, so guard egress events join the same trail correlation as the proxy's tool_call events. Disabled or missing binary falls back to the raw command; 4 new tests pin that.README / detection-rules.md counts updated (twenty published rules, 30 Sigma rules, 3052 tests collected).
Tests run locally: readme_claims 16, sigma_pack + benchmark + rule_identity + doctor/remediation + mcp_proxy 86, all passing; ruff clean on changed files.