Repository navigation
Add Agentmetry Wazuh 4.14 integration - #127
Open
blitzcrieg1 wants to merge 1 commit into
Open
blitzcrieg1 wants to merge 1 commit into
blitzcrieg1 wants to merge 1 commit into
Conversation
Alerts on the detection events in an Agentmetry trail, read through a localfile. Rules use the 997600-997699 range and key on detection events, because tool arguments are hashed by default. No custom decoder is needed. Tested on wazuh/wazuh-manager:4.14.9 with Agentmetry 0.10.6: 15 of 15 logtest cases pass, and 14 of 14 detection samples alert over the live localfile path. The samples come from a real recorder replaying Agentmetry's scripted attack sessions, not a live agent session.
8 tasks
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.
Description
Agentmetry is an Apache-2.0 sensor for AI coding agents. It records the tool calls agents report through their hooks in a hash-chained local trail, and correlates sequences into detections mapped to MITRE ATT&CK.
This package reads that trail with a
localfileand alerts on the detection events. It follows the guidance in wazuh/wazuh#41217: a separate package, starting with 4.14 and with detection events, using rule IDs outside the reserved ranges.SCHEMA.mdtechnique_idson the detection eventsagentmetrysection inVERIFY.mdTesting
Tested on a real
wazuh/wazuh-manager:4.14.9container with Agentmetry 0.10.6 from PyPI.scripts/capture_and_test.shreproduces the whole run.agentmetry.inithroughwazuh-logtestlocalfilepath intoalerts.jsonLimits to check in review
The samples are not from a live agent session. You asked for real captured samples. Every line was written and hash-chained by a real recorder, but the sessions are Agentmetry's scripted attack cases, replayed through its ingest route. If you need samples from a live agent, tell me and I will capture them.
Collection path. The test reported above uses
localfileon the Wazuh manager. Agent-side collection is outside the scope of that test.Two rules have no sample.
host-subagent-swarm-burstandoff-hours-activitydid not fire in the replay, so they have no specific rule and alert by severity with no MITRE mapping. The severity rules 997602 to 997605 are never the final match in the samples, because each tested detection has a specific rule.Nobody is known to run this yet. I still know of no one running Agentmetry with Wazuh.
Replay and rotation. The submitted rules evaluate each copy of a saved record independently, so rereading one can create another alert. The saved Agentmetry event keeps its source ID, which Wazuh exposes at
data.event.event_id. The replay and rotation validation plan is tracked in Agentmetry #410.Wazuh 5.0 is not included and would follow as a separately tested package.
Provenance
claude_code_wazuh_v4.14