[m365_defender] Enhance ECS Mappings and Refactor the Dashboards#16676
Conversation
🚀 Benchmarks reportTo see the full report comment with |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
| source: | | ||
| def processExecutable = new HashSet(); | ||
| for (evidence in ctx.json.evidence) { | ||
| if (evidence?.image_file?.path != null && evidence?.image_file?.name != null) { |
There was a problem hiding this comment.
| if (evidence?.image_file?.path != null && evidence?.image_file?.name != null) { | |
| if (evidence?.image_file?.path != null && evidence.image_file.name != null) { |
| ignore_missing: true | ||
| - script: | ||
| description: Set process.executable from evidence image_file path and name. | ||
| tag: script_set_process_executable_from_image_file |
There was a problem hiding this comment.
There's existing script processors for process and parent process: https://github.com/elastic/integrations/blob/main/packages/m365_defender/data_stream/alert/elasticsearch/ingest_pipeline/default.yml#L2449
Can you utilise them instead of a new one?
There was a problem hiding this comment.
I felt there was limited reusable logic in that script, so I separated it to handle the process and parent process fields independently. While it could be merged into the existing script, doing so would make it longer and harder to understand. Keeping it separate improves readability and maintainability.
There was a problem hiding this comment.
Can you add new script near this existing one? We can have most process fields logic in one place.
1. Update alert dashboard. 2. Remove custom duplicate fields of threat family in alert dataset. 3. Optimize the script to set process fields.
| ignore_missing: true | ||
| - script: | ||
| description: Set process.executable from evidence image_file path and name. | ||
| tag: script_set_process_executable_from_image_file |
There was a problem hiding this comment.
Can you add new script near this existing one? We can have most process fields logic in one place.
| for (evidence in ctx.json.evidence) { | ||
| if (evidence?.parent_process?.image_file?.path != null && evidence.parent_process.image_file.name != null) { | ||
| String path = evidence.parent_process.image_file.path; | ||
| String name = evidence.parent_process.image_file.name; | ||
| String separator = path.contains("\\") ? "\\" : "/"; | ||
| if (!path.endsWith(separator)) { | ||
| path = path + separator; | ||
| } | ||
| processParentExecutable.add(path + name); | ||
| } else if (evidence?.parent_process?.image_file?.name != null) { | ||
| processParentExecutable.add(evidence.parent_process.image_file.name); | ||
| } | ||
| } |
There was a problem hiding this comment.
This logic is same as above. Can we create a reusable function to improve maintainability?
💚 Build Succeeded
History
|
|
Package m365_defender - 5.5.0 containing this change is available at https://epr.elastic.co/package/m365_defender/5.5.0/ |
Proposed commit message
Checklist
changelog.ymlfile.How to test this PR locally
Related Issues
Screenshots