EntityAnalytics AD: add support for ECS entity fields#18337
EntityAnalytics AD: add support for ECS entity fields#18337chemamartinez wants to merge 8 commits intoelastic:mainfrom
Conversation
Vale Linting ResultsSummary: 2 warnings found
|
| File | Line | Rule | Message |
|---|---|---|---|
| packages/entityanalytics_ad/docs/README.md | 350 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
| packages/entityanalytics_ad/docs/README.md | 351 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
|
| int start = 0; | ||
| def dcParts = new ArrayList(); | ||
| boolean cnFound = false; | ||
| while (start < dn.length()) { |
There was a problem hiding this comment.
🟢 Low ingest_pipeline/device.yml:265
The parseDn function in the set_device_relationships script splits Distinguished Names by searching for bare commas with dn.indexOf(',', start). Active Directory DNs can contain escaped commas within values (e.g., CN=Smith\, John,DC=example,DC=com). When a DN contains an escaped comma, the parser incorrectly splits at the escaped comma, producing wrong name and domain values in host.entity.relationships.
🤖 Copy this AI Prompt to have your agent fix this:
In file packages/entityanalytics_ad/data_stream/entity/elasticsearch/ingest_pipeline/device.yml around line 265:
The `parseDn` function in the `set_device_relationships` script splits Distinguished Names by searching for bare commas with `dn.indexOf(',', start)`. Active Directory DNs can contain escaped commas within values (e.g., `CN=Smith\, John,DC=example,DC=com`). When a DN contains an escaped comma, the parser incorrectly splits at the escaped comma, producing wrong `name` and `domain` values in `host.entity.relationships`.
| } | ||
| return result; | ||
| } | ||
| def buildRel(def dns) { |
There was a problem hiding this comment.
🟢 Low ingest_pipeline/device.yml:286
In the buildRel function, when a DN lacks a CN= or DC= component, the corresponding name or domain entry is skipped entirely while id is still added. This produces arrays of mismatched lengths — for example, 3 IDs but only 2 names — making it impossible for consumers to correlate which name belongs to which ID by index. Consider restructuring to emit parallel arrays where each position corresponds across fields, such as an array of objects where each object contains the matched id, name, and domain for a single DN.
🤖 Copy this AI Prompt to have your agent fix this:
In file packages/entityanalytics_ad/data_stream/entity/elasticsearch/ingest_pipeline/device.yml around line 286:
In the `buildRel` function, when a DN lacks a `CN=` or `DC=` component, the corresponding `name` or `domain` entry is skipped entirely while `id` is still added. This produces arrays of mismatched lengths — for example, 3 IDs but only 2 names — making it impossible for consumers to correlate which name belongs to which ID by index. Consider restructuring to emit parallel arrays where each position corresponds across fields, such as an array of objects where each object contains the matched `id`, `name`, and `domain` for a single DN.
Proposed commit message
Checklist
changelog.ymlfile.Related issues