-
Notifications
You must be signed in to change notification settings - Fork 497
{m365_defender,microsoft_defender_endpoint}: Add mapping and transform for CDR workflows #14809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Benchmarks reportTo see the full report comment with |
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxcold, for microsoft_defender_endpoint
integration, I had to shorten the transform name as latest_cdr_vuln
because if not, the system tests would throw an error during package installation:
Error: failed to setup system runner: can't install the package: there was an apply error: installation failed: can't install the package: could not zip-install package; API status code = 500; response body = {"statusCode":500,"error":"Internal Server Error","message":"action_request_validation_exception\n\tRoot causes:\n\t\taction_request_validation_exception: Validation Failed: 1: The id cannot contain more than 64 characters.;"}
Its coming from Kibana (logs below):
2025-08-05 19:18:07 [2025-08-05T13:48:07.229+00:00][WARN ][plugins.fleet] Error during execution of state "install_transforms" with status "failed": action_request_validation_exception
2025-08-05 19:18:07 Root causes:
2025-08-05 19:18:07 action_request_validation_exception: Validation Failed: 1: The id cannot contain more than 64 characters.;
2025-08-05 19:18:07 [2025-08-05T13:48:07.246+00:00][DEBUG][plugins.fleet] Created transform: logs-microsoft_defender_endpoint.latest_action-default-1.0.0
2025-08-05 19:18:07 [2025-08-05T13:48:07.311+00:00][DEBUG][plugins.fleet] Started transform: logs-microsoft_defender_endpoint.latest_action-default-1.0.0
2025-08-05 19:18:08 [2025-08-05T13:48:08.138+00:00][WARN ][plugins.fleet] Failure to install package [microsoft_defender_endpoint]: [ResponseError: action_request_validation_exception
2025-08-05 19:18:08 Root causes:
2025-08-05 19:18:08 action_request_validation_exception: Validation Failed: 1: The id cannot contain more than 64 characters.;]
2025-08-05 19:18:09 [2025-08-05T13:48:09.163+00:00][ERROR][plugins.fleet] Uninstalling microsoft_defender_endpoint-3.0.0 after error installing: [ResponseError: action_request_validation_exception
2025-08-05 19:18:09 Root causes:
2025-08-05 19:18:09 action_request_validation_exception: Validation Failed: 1: The id cannot contain more than 64 characters.;] with install type: install
Hope the shortened name is okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's ok I think. Don't know if we need to come up with a common way to name it or not. We had the same issue with our native transform https://github.com/elastic/integrations/blob/main/packages/cloud_security_posture/elasticsearch/transform/misconfiguration/manifest.yml and named it simply misconfiguration
, don't know if it has some effect on the UX for the users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the confirmation.
packages/m365_defender/manifest.yml
Outdated
subscription: basic | ||
kibana: | ||
version: "^8.18.0 || ^9.0.0" | ||
version: "^8.19.0 || ^9.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently both integrations are not added to permissions list in Elasticsearch.
I created the PR: elastic/elasticsearch#132445 to add them. Once approved and backported, I will update these versions accordingly. Until then the system tests will fail because of permissions error inside transform.
cc: @maxcold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added run_as_kibana_system: false
for now to test. Will send you the credentials for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I made a few comments in microsoft_defender_endpoint, but they apply to both.
...rosoft_defender_endpoint/data_stream/vulnerability/elasticsearch/ingest_pipeline/default.yml
Show resolved
Hide resolved
...rosoft_defender_endpoint/data_stream/vulnerability/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
...rosoft_defender_endpoint/data_stream/vulnerability/elasticsearch/ingest_pipeline/default.yml
Show resolved
Hide resolved
...s/microsoft_defender_endpoint/elasticsearch/transform/latest_cdr_vuln/fields/base-fields.yml
Show resolved
Hide resolved
CI seems to be having problems with docker; I've been seeing problems in beats too. |
Actually I thought it was because images for |
copy_from: m365_defender.vulnerability.id | ||
ignore_empty_value: true | ||
- set: | ||
field: vulnerability.cve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kcreddy it is supposed to be field: vulnerability.id
, this it were we store cve data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexreal1314, we also store CVE ids inside vulnerability.id
field right above this processor.
Lines 689 to 693 in 2f27420
- set: | |
field: vulnerability.id | |
tag: set_vulnerability_id_from_vulnerability_id | |
copy_from: m365_defender.vulnerability.id | |
ignore_empty_value: true |
In here, we are populating vulnerability.cve
whenever ctx.vulnerability.id.toUpperCase().contains('CVE')
. This is discussed in the spreadsheet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kcreddy Thanks, I didn't see it as it was not part of the changes.
Why are we adding vulnerability.cve it only for some of the 3p integrations? I see it in aws inspectr, google scc, microsoft defender and here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely be adding for all 3p integrations where applicable. It may have been missed because it wasn't Must Have. But will take a look for other integrations and add accordingly. Its also possible that for those other integrations, the vulnerbaility.id
isn't given as a CVE.
} | ||
} | ||
- set: | ||
field: vulnerability.title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kcreddy I wonder what is the added value to the user seeing a title in this format:
'Vulnerability found in {{{package.name}}} {{{package.version}}}'
Since we already have package.name and package.version fields which appear in the flyout and data grid already and describe basically the same. This is kinda a duplication of data.
I understand that the title might be quite long - i'll check how we handle it today in the UI.
cc @maxcold

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no field from the raw data to derive the title
from. The integration previously added it from Summary:
part of vulnerability.description
field. But this alone is quite huge.
Sample value: The bzip2 utility, up to version 1.0.6, contains a vulnerability (CVE-2019-12900) in the BZ2_decompress function within decompress.c. This flaw involves an out-of-bounds write when processing files with numerous selectors, potentially leading to data integrity errors during decompression.
After discussing with @maxcold and @nick-alayil inside the spreadsheet, we updated it to avoid large multiline titles.
], | ||
"vulnerability": { | ||
"classification": "CVSS", | ||
"cve": "CVE-2025-3074", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "id": "CVE-2025-3074",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same explanation as #14809 (comment).
], | ||
"vulnerability": { | ||
"classification": "CVSS", | ||
"cve": "CVE-2025-3074", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "id": "CVE-2025-3074",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same explanation as #14809 (comment)
- name: vulnerability | ||
type: group | ||
fields: | ||
- name: cve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same explanation as #14809 (comment)
move_on_creation: true | ||
latest: | ||
unique_key: | ||
- vulnerability.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going for consistency with CDR guide on this. Let me know if you want me to change to event.id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes. Would like to get @maxcold opinion regarding it also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking: as in our native integrations, we rely on this combination of fields, we went with this set of fields for 3p integrations as well. Then we discovered that for some integrations where some of these fields can be multivalue, we looked for a workaround and decided to use the event.id, but before we made sure it doesn't break our flows, eg. it's not a generated value that changes for the same vulnerability.id, package.name and package.version as we would see the duplication in that case. But in my opinion, in integrations where these fields are not multivalue, it's better to use the combination instead of event.id
even if event.id
covers exactly these fields for the following reasons:
- It's much clearer from looking at the current transform what the unique logic is. Because
event.id
can be anything and differ from provider to provider. So one needs to look into the ingest pipeline or even in the provider docs to understand what this event.id is, if it's unique and so on event.id
implementation (if it's created via some logic in the ingest pipeline) can change and then it can stop providing the necessary qualities to be used in the unique setting. Again, with the combination of fields, it's much more transparent
@alexreal1314 do you have any specific reason that you think event.id
would be a better fit here?
/test |
cursor: | ||
lastUpdateTime: | ||
value: "[[.last_response.body.lastUpdateTime]]" | ||
value: '[[with $f := (index .last_response.body "lastUpdateTime")]][[if (ne $f "")]][[.last_response.body.lastUpdateTime]][[end]][[end]]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be simpler.
value: '[[with $f := (index .last_response.body "lastUpdateTime")]][[if (ne $f "")]][[.last_response.body.lastUpdateTime]][[end]][[end]]' | |
value: '[[with (index .last_response.body "lastUpdateTime")]][[.]][[end]]' |
From "text/template"
{{with pipeline}} T1 {{end}} If the value of the pipeline is empty, no output is generated; otherwise, dot is set to the value of the pipeline and T1 is executed.
Probably (untested), it could actually be [[index .last_response.body "lastUpdateTime"]]
, but I don't think it's worth it since it relies on clear knowledge of the details of the template handler in the input; the with
implementation is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense. I updated as per your suggestion 0e47471
💚 Build Succeeded
History
cc @kcreddy |
|
Package m365_defender - 4.0.0 containing this change is available at https://epr.elastic.co/package/m365_defender/4.0.0/ |
Package microsoft_defender_endpoint - 3.0.0 containing this change is available at https://epr.elastic.co/package/microsoft_defender_endpoint/3.0.0/ |
Proposed commit message
Checklist
changelog.yml
file.How to test this PR locally
Run pipeline tests:
m365_defender
:microsoft_defender_endpoint
:Run system tests:
m365_defender
:microsoft_defender_endpoint
:Related issues
Screenshots