Skip to content
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

[Filebeat][New Module] Threat intel module for filebeat #21795

Merged
merged 31 commits into from
Feb 15, 2021

Conversation

P1llus
Copy link
Member

@P1llus P1llus commented Oct 14, 2020

What does this PR do?

This PR adds a new module for threat intel, using each TI source as a fileset.

Why is it important?

Adds possibility to ingest Threat Intel data to be used for security usecases

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Resolves #23406

@P1llus P1llus added in progress Pull request is currently in progress. Filebeat Filebeat Team:SIEM labels Oct 14, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 14, 2020
@P1llus P1llus marked this pull request as draft October 14, 2020 13:10
@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 14, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #21795 updated

  • Start Time: 2021-02-15T11:04:23.117+0000

  • Duration: 47 min 4 sec

  • Commit: 500b4ac

Test stats 🧪

Test Results
Failed 0
Passed 13014
Skipped 2033
Total 15047

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 13014
Skipped 2033
Total 15047

@P1llus
Copy link
Member Author

P1llus commented Oct 19, 2020

@FrankHassanabad and @leehinman Added in your comments, feel free to let me know if its anything else we should change as well.

@leehinman
Copy link
Contributor

Looks like larted is still getting stored as a string:

"threatintel.larted": "true",

Might be a good idea to use a convert to store it as a boolean so it doesn't have to be converted when used.

@shimonmodi
Copy link

@P1llus - I have a threat intel ECS RFC in progress right now, and want to apply those ECS fields to this module. the mapping is available here https://github.com/elastic/security-team/issues/177 . Whats the best way to reconcile the mappings you have used with the one's in the RFC?

@P1llus
Copy link
Member Author

P1llus commented Oct 19, 2020

@shimonmodi If we want to support the ECS RFC for threat intel whenever we release the module then I don't mind converting it.

I was just unsure if this RFC was complete enough yet to use, if it is then I can convert this module before we proceed :)

@P1llus
Copy link
Member Author

P1llus commented Oct 19, 2020

Sorry about that @leehinman . I only updated the field mapping and didn't actually convert it. Added the update now. Hopefully everything else is alright? :)

@P1llus
Copy link
Member Author

P1llus commented Oct 19, 2020

Let's not merge it yet though, but good to know if its "LGTM" or not!

@leehinman
Copy link
Contributor

Sorry about that @leehinman . I only updated the field mapping and didn't actually convert it. Added the update now. Hopefully everything else is alright? :)

LGTM

@shimonmodi
Copy link

@P1llus - perfect, lets chat about it on Wednesday when we meet. My goal is to validate that the proposed ECS fields work for this feed and identify gaps.

@P1llus
Copy link
Member Author

P1llus commented Oct 30, 2020

I think I will leave this PR as draft for now, that way we can modify it a bit more while testing and discussing with different teams. There might be some breaking changes and temp content in here, so I think for any new content we can hold off new reviews for now.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 30, 2020

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 4488
Skipped 561
Total 5049

@P1llus P1llus marked this pull request as ready for review February 8, 2021 11:07
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@P1llus
Copy link
Member Author

P1llus commented Feb 8, 2021

The module is now ready for review!

@P1llus
Copy link
Member Author

P1llus commented Feb 8, 2021

jenkins run tests please

@P1llus
Copy link
Member Author

P1llus commented Feb 8, 2021

Added some fixes above for general feedback received outside of the PR. All planned changes has been applied.

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the module, but not the data mappings. It looks like it's in good shape with the exception of a few really minor comments below. Before merging please create a ticket to track the work necessary to add automated integration tests for the httpjson side of the filesets.

Copy link
Contributor

@adriansr adriansr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@P1llus P1llus added enhancement and removed in progress Pull request is currently in progress. labels Feb 15, 2021
@P1llus P1llus merged commit 70d00b9 into elastic:master Feb 15, 2021
P1llus added a commit to P1llus/beats that referenced this pull request Feb 15, 2021
* inital MVP commit for threat intel module for filebeat

* Fixing typos based on PR comments

* adding converter for larted field

* adding concept for a new MISP module

* setting correct field type for misp group sharing id

* setting timestamp to age of attribute timestamp

* stashing initial support for AlienVault OTX

* add threatintel.otx to timestamp bypass for testing

* stashing upcoming changes for new httpjson format

* updating settings with pagination

* big overwrite of the whole module to fit the new TI ECS fields, add new test data, and make the ingest pipelines more sturdy

* update default url for anomali

* updating field names based on feedback

* final commit fixing certain bugs, adding the missing field mapping etc

* updating field defintion, it had a duplicate field

* updating the anomali config to access the header in a safer way, allowing for special characters

* added stripping of null values and made sure it looked at the correct document field

* updating field mapping to default_field false

* updating default config descriptions

* disable default_field for top group

* updating changelog

* adding fallback for uri_parts when using older ES version

* updating test_modules to ignore timestamps

* adding support for uri_parts for all relevant ingest pipelines, and fallbacks

* updating default config templates and docs based on PR comments

* Update x-pack/filebeat/module/threatintel/_meta/docs.asciidoc

Co-authored-by: Adrian Serrano <[email protected]>

* mage update

Co-authored-by: Adrian Serrano <[email protected]>
(cherry picked from commit 70d00b9)
@P1llus P1llus added the v7.12.0 label Feb 15, 2021
P1llus added a commit that referenced this pull request Feb 15, 2021
… for filebeat (#24039)

* [Filebeat][New Module] Threat intel module for filebeat (#21795)

* inital MVP commit for threat intel module for filebeat

* Fixing typos based on PR comments

* adding converter for larted field

* adding concept for a new MISP module

* setting correct field type for misp group sharing id

* setting timestamp to age of attribute timestamp

* stashing initial support for AlienVault OTX

* add threatintel.otx to timestamp bypass for testing

* stashing upcoming changes for new httpjson format

* updating settings with pagination

* big overwrite of the whole module to fit the new TI ECS fields, add new test data, and make the ingest pipelines more sturdy

* update default url for anomali

* updating field names based on feedback

* final commit fixing certain bugs, adding the missing field mapping etc

* updating field defintion, it had a duplicate field

* updating the anomali config to access the header in a safer way, allowing for special characters

* added stripping of null values and made sure it looked at the correct document field

* updating field mapping to default_field false

* updating default config descriptions

* disable default_field for top group

* updating changelog

* adding fallback for uri_parts when using older ES version

* updating test_modules to ignore timestamps

* adding support for uri_parts for all relevant ingest pipelines, and fallbacks

* updating default config templates and docs based on PR comments

* Update x-pack/filebeat/module/threatintel/_meta/docs.asciidoc

Co-authored-by: Adrian Serrano <[email protected]>

* mage update

Co-authored-by: Adrian Serrano <[email protected]>
(cherry picked from commit 70d00b9)

* mage fmt update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Threat Filebeat Module
8 participants