Skip to content

feat: add elastic matcher#65

Merged
christophetd merged 8 commits into
DataDog:mainfrom
faloker:feat/elastic-matcher
Jun 19, 2026
Merged

feat: add elastic matcher#65
christophetd merged 8 commits into
DataDog:mainfrom
faloker:feat/elastic-matcher

Conversation

@faloker

@faloker faloker commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adding Elastic Security matcher, tested against Elastic Cloud v9.2.3. Also, adding a small refactor to extract secret.go into a separate package to avoid duplicating a bunch of code.

Motivation

Checklist

  • Unit tests
  • Documentation

@faloker
faloker requested review from a team as code owners June 18, 2026 21:25
@faloker
faloker force-pushed the feat/elastic-matcher branch 2 times, most recently from 2b26cb4 to 1d8a321 Compare June 18, 2026 21:43
@faloker
faloker force-pushed the feat/elastic-matcher branch from 1d8a321 to 950e674 Compare June 18, 2026 21:44
@christophetd christophetd self-assigned this Jun 19, 2026
Rename ElasticSecurityDetectionEngineSearchResponse to elasticSearchResponse
and drop the unused Took and Total fields — it's an implementation detail
with no reason to be exported.
- elastic_internal_test.go (package elastic): tests for unexported helpers
  alertMatchesExecution, buildElasticAlertQuery, buildAllOpenAlertsQuery
- elastic_test.go (package elastic_test): tests for the public API
  HasExpectedAlert and Cleanup, using the generated mocks package instead
  of a duplicate inline fakeAlertsAPI
@christophetd

christophetd commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

I pushed two (mostly cosmetic) changes, otherwise it's looking great!

  • Renamed ElasticSecurityDetectionEngineSearchResponse to elasticSearchResponse (unexported) and dropped the unused Took/Total fields
  • Split the test file into elastic_internal_test.go (white-box, tests unexported helpers) and elastic_test.go (black-box, tests the public API using the existing generated mock instead of a duplicate inline fakeAlertsAPI).

@christophetd
christophetd merged commit 18b08f7 into DataDog:main Jun 19, 2026
4 checks passed
This was referenced Jun 19, 2026
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.

3 participants