-
Notifications
You must be signed in to change notification settings - Fork 474
[windows] Windows Defender Antivirus Data Stream - Initial Add #10207
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
Have about 28 of these: /integrations/build/packages/windows-1.46.0.zip/data_stream/windows_defender/fields/winlog.yml" is invalid: field 0.fields.4.fields.111.name: Does not match pattern '^[-_/@A-Za-z0-9]+(.[-_/@A-Za-z0-9]+)*$' Since there are quite a few fields with spaces. Pipelines will need to be created to handle these since you cannot have spaces in field names for an integration, even though you can have spaces in fields names in Elasticsearch in general. |
Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform) |
If anyone knows how to rename a field in a pipeline with spaces I would gladly hear it. I would like to do something like this, but unsure if it will work.
Please advise, as this is nearly ready for testing - The spaces in field names is the remaining cleanup item before tests can begin. |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
Replaced spaces with _ for field names, and looks good. Ready to test! |
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.
LGMT.
Regarding remove the spaces from field names, you can also use the script processor that allows you to freely manipulate the data and have a generic solution instead of hardcoding all field names.
Filebeat also has got a script processor in case you want that done by Filebeat instead of ES.
packages/windows/data_stream/windows_defender/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/windows/data_stream/windows_defender/agent/stream/winlog.yml.hbs
Outdated
Show resolved
Hide resolved
Maybe something like this? Works, but unsure if efficient. Script processor for ingest pipeline. Doing this at the agent level would be more efficient, but unsure how to bake this into the integration on the filebeat side (the context of how this code operates).
|
Moved processing to client side, please review! |
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.
LGTM.
@nicpenning is there an easy way to test this PR? How can I generate the necessary data to test it?
I really would like to test this JS script, just to be on the safe side.
I tested locally on my device and it seemed to work. I do dev on Windows so I exposed my containerized stack to my localhost and installed an agent on my windows host and pointed to fleet:8220 using 127.0.0.1:8220 in the fleet settings (new fleet server) and elasticsearch:9200 using 127.0.0.1:9200 (new elasticsearch output) in the output options |
packages/windows/data_stream/windows_defender/agent/stream/winlog.yml.hbs
Show resolved
Hide resolved
So I did a manual test and @leehinman's code for the preserve original event did not work. I reverted back to what the other Windows datastreams had and it is now functioning. Please advise! |
What was the test, and how did it fail? I did check what you had merged and at least at the policy level it looked like the tags were being added correctly. |
I deployed the agent on my Windows workstation manually with those settings and the event.original was not being added to the event. |
When you added the suggestion, you removed this section:
without that, the winlog input won't give you the original event. The tags part is so that the default ingest pipeline doesn't delete it. |
Whoops! I will give it go as soon as I can! Sorry about that! |
Is this what I need for the entirety of the file then? Looks like my tests had this:
|
Sorry, I meant when you tests the code using
|
Re-added code. Will test later this evening. If you have a chance to give it a go again and validate the code looks good that would be great. |
Local tests look good. I can't get my manual tests to work. I am good to ship it as is with the built in tests passing. |
@leehinman - Any other updates needed here? Keep in mind that I did mark this data stream as Beta. Can take another run at it with any issues/fixes before dropping that flag on a future PR. |
Not from me, I "approved". I think you need someone from "sec-windows-platform" to review since they are codeowners. |
@efd6 - Is this your team? |
Hey @nfritts, could we have someone from your team to review here? |
/test |
/test |
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
History
|
|
Package windows - 1.46.0 containing this change is available at https://epr.elastic.co/search?package=windows |
Add Windows Defender data stream - more details to come.
Proposed commit message
See title.
Checklist
changelog.yml
file.Related issues
Screenshots