-
Notifications
You must be signed in to change notification settings - Fork 435
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
[Amazon Security Lake] - OCSF v1.1 update with major refactor & adding support for dynamic template and mappings & system tests #10405
Conversation
… detect rerouted datastreams
… class support, ignore _dev folder
…into it's own file
…oxy_endpoint field, uupdated network activity class and segregated endpoint event mappings into separate files across all data streams. updated ocsf object as necessary across respective data streams
… data streams, added new fields to support newly added event class
…ta fields across all data streams, flattened ldap fields in event data stream to make room for more fields
…d finding_info in findings data stream
…ed resources object group, added new objects as required
…port for incitent findings event class
…ema version in comment and dashboard links to 1.1.0
…r file hosting activity class
🚀 Benchmarks reportTo see the full report comment with |
Quality Gate failedFailed conditions |
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.
Couple of general comments.
I looked at the README and dashboard diffs.
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 a lot of colour and movement in this change which makes it difficult to be confident of the review. I have looked at:
- updated root org templates
- reworked 'org' object mapping as tynamic template for all data streams
- segregated process fields in 'findings', added 'actor' fields for new class support, ignore _dev folder
- added fulnerability findings support and segregated 'resource' group into it's own file
- added ntp activity event class, deprecated proxy event class, aded proxy_endpoint field, uupdated network activity class and segregated endpoint event mappings into separate files across all data streams. updated ocsf object as necessary across respective data streams
- added os patch state event class, segregated device fields across all data streams, added new fields to support newly added event class
- added datastore activity event class, segregated actor, user & metadata fields across all data streams, flattened ldap fields in event data stream to make room for more fields
- added support for detection finding event class, segregated and mapped finding_info in findings data stream
- added support of compliance finding event class, segregated and updated resources object group, added new objects as required
- segregated and expanded api object across all data streams, added support for incitent findings event class
- added support for Device Config State Change event class, updated schema version in comment and dashboard links to 1.1.0
- added support for scan activity event class
- segregated file fields across required data streams, added support for file hosting activity class
- added cwe & epss objects as flattened to cve object
- converted feature object to follow dynamic mapping rules across all data streams
- converted feature object to follow dynamic mapping rules across all data streams
- added some missing fields after locally running system tests for discovery datastream
- reworked terrform deployer to support multi-bucket based system tests
- updated docs and changelog
- fixed timestamp issues across all data streams, added all system tests and updated missing mappings accorgingly
There are a variety of comments and suggestions. I'll take another look again tomorrow.
packages/amazon_security_lake/data_stream/event/_dev/deploy/tf/main.tf
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/discovery/fields/user-fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/event/fields/fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/iam/fields/user-fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/findings/fields/_dev/fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/event/fields/misc-fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/application_activity/fields/fields.yml
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/application_activity/fields/fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/event/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
…_id from integer to keyword
@efd6, I've updated the PR with the suggested changes |
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 but please wait for @chrisberkhout
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 checked over the things I raised when I started a review earlier, and Dan's comments, and had a quick look at everything else, focusing on the field definition files, the testing setup and just checking the general structure of things.
No big issues. Please feel free to disagree with me on points I've raised. This seems pretty done.
packages/amazon_security_lake/data_stream/application_activity/manifest.yml
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/event/fields/actor-fields.yml
Outdated
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/event/_dev/test/pipeline/test-iam.log-expected.json
Show resolved
Hide resolved
packages/amazon_security_lake/data_stream/event/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
I forgot to mention, regarding Elasticsearch will always let you provide an array of values rather than a single value. ECS can say that a field should be array rather than a single value (example) and That may gradually change in the future: [Meta] Better handling of single-valued fields elasticsearch#80825. |
…pings accordingly
@chrisberkhout, I've addressed all the PR suggestions except the system tests. Tests don't seem to be terminating with assert.hit_count: 0, so I've not updated that as of yet. |
💚 Build Succeeded
History
cc @ShourieG |
Quality Gate failedFailed conditions |
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.
🚢
Package amazon_security_lake - 2.0.0 containing this change is available at https://epr.elastic.co/search?package=amazon_security_lake |
Type of change
Proposed commit message
With the upgrade of OCSF schemas, we are enhancing our support to meet compatibility requirements for OCSF v1.1. We are also reworking the ingest pipeline to incorporate dynamic templates and mappings to enable faster OCSF upgrades in future.
Checklist
changelog.yml
file.Author's Checklist
- [ ] Update dashboards wherever required.(dashboards are at the category level and atm after inspection no changes are required since they operate on shared values).NOTE
Due to the nature and structure of the OCSF schema, this integration has limitations on how deep the mappings run. Some important objects like 'Actor', 'User' and 'Product' have more fleshed-out mappings compared to others which get flattened after the initial 2-3 levels of nesting to keep them maintainable in a YAML format. This will evolve on a need-by-need basis going forward.
The CI tests will pass once the respective elastic-package changes are implemented as defined here.
Approach
How to review this PR
Due to the scale of the changes, intermittent merges with main to resolve conflicts and reworks all across the board, re-writing the git history and consolidating the commits with git rebase is proving to be really challenging, hence I suggest the following approach to review this PR:-
Some commits have certain elements that could stand out and might have been reworked/removed later down stream. In those scenarios, feel free to review in the complete context or reach out to me in case of any confusion.
How to test this PR locally
Related issues
System Tests
Screenshots