Skip to content

feat(core, matchers): Telemetry types & discovery mode - #78

Open
Minosity-VR wants to merge 4 commits into
mainfrom
minosity/telemetry-discovery
Open

feat(core, matchers): Telemetry types & discovery mode#78
Minosity-VR wants to merge 4 commits into
mainfrom
minosity/telemetry-discovery

Conversation

@Minosity-VR

@Minosity-VR Minosity-VR commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Warning

This PR changes the core matcher interface. It is a breaking change for any code calling threatest as a library and using the matchers directly.

It is not a breaking change for CLI users. Commands and scenario files stay identical. The json output gained an additional json field

Enhancements:

  • Create a unified object to expand the matchers to new telemetry types (logs, events...)
  • Add new datadog matchers for agent events and logs
  • Add a discovery mode that polls telemetry and return the contents (not just a boolean). Query used for the discovery controllable by the user, with a default provided

Motivation

  • Discovery mode: when using in purple team exercises, attackers often detonate TTPs without knowing exactly what will be triggered. With this feature, they can tell the blue teams what telemetry they found, if they were seen, etc.
  • More telemetry types: alerts are often the 'end' of the processing pipeline, but earlier resources are useful for the user too. Tried to stay generic and stick to OpenTelemetry's Events format so almost any matcher can be added

Checklist

Agent events discovery:
Using some internal stratus-red-team technique (I will try to opensource it at some point), I launched a k8s pod that starts a xmrig cryptominer. Didn't want to relaunch it all the time so I 'cheated' and use a local scenario launching a benign command, but fetching the events as if it was a normal scenario:
image

Logs and signals discovery: launched the aws.defense-evasion.dns-delete-logs stratus TTP:
image
(note: this screenshot is not from the latest commit, now the objects appear under their own assertion category instead of being mixed up at the end)

@Minosity-VR
Minosity-VR requested review from a team as code owners September 2, 2026 09:42
@Minosity-VR
Minosity-VR force-pushed the minosity/telemetry-discovery branch 2 times, most recently from cb4ebe8 to 5603e9a Compare September 2, 2026 09:59
@Minosity-VR Minosity-VR changed the title Minosity/telemetry discovery feat(core, matchers): Telemetry types & discovery mode Sep 2, 2026
Co-Authored-By: A LLM Agent
@Minosity-VR
Minosity-VR force-pushed the minosity/telemetry-discovery branch 3 times, most recently from d013493 to f3e428f Compare September 2, 2026 12:38
@Minosity-VR
Minosity-VR force-pushed the minosity/telemetry-discovery branch from f3e428f to a12d482 Compare September 2, 2026 12:40
@Minosity-VR
Minosity-VR force-pushed the minosity/telemetry-discovery branch from a12d482 to 73b7c34 Compare September 2, 2026 12:46
Comment on lines +18 to +19
const lookbackWindow = 15 * time.Minute
const maxResults = 1000

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this should be hard coded at this level. In particular, don't we want the lookbackWindow to be editable by the caller and to be shared among all modules?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caller can control the time range in library mode (WithTimeRange option). I didn't expose it in the scenario yaml/CLI because I didn't want to overload it, but we could.

And for the shared value, I think it's better to control it per matcher: depending of the expected amount of resources, the processing time and other factors, it could make sense to have a longer search window for signals than logs for instance

Good catch though, because I missed it during the refactor: I changed the default timewindow of datadog signals from 1h to 15min. Will revert to 1h

Adds a datadogLog discovery expectation with a custom query to the
security group scenario, and a datadogEvent discovery expectation
without query to the curl metadata service scenario. Includes a
sample JSON output file.

Co-Authored-By: A LLM Agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants