[ML] Update Security ML jobs to use entity analytics fields for host and user fields#255339
[ML] Update Security ML jobs to use entity analytics fields for host and user fields#255339sodhikirti07 merged 47 commits intomainfrom
Conversation
jmcarlock
left a comment
There was a problem hiding this comment.
Requesting changes to block merging ATM
|
@rylnd @abhishekbhatia1710 @dplumlee Could you please review this PR for the changes relevant to your team? |
ymao1
left a comment
There was a problem hiding this comment.
Entity analytics changes LGTM
rylnd
left a comment
There was a problem hiding this comment.
With the understanding that requiring users to update their ML Rules/Jobs in 9.4 is an intentional choice, here: this looks good to me! For DE code this is mostly just a find/replace for those job_ids, which is a pretty straightforward review.
I did have one note on an anomalies archive that has a few job references that weren't updated, but other than that: LGTM
| // Note: In 9.4 the V3 jobs were replaced by Entity Analytics (_ea) variants that use | ||
| // Entity Analytics fields (host.id, user.id, event.module, etc.) as influencers. | ||
| // V3 non-EA jobs are now also considered affected. | ||
| export const affectedJobIds: string[] = [ |
There was a problem hiding this comment.
Thanks for updating this! I verified that users will continue to see the "new jobs available" callout in these new v3 cases 👍
There was a problem hiding this comment.
Note: I think this could be more accurately called:
| export const affectedJobIds: string[] = [ | |
| export const outdatedJobIds: string[] = [ |
And the description should be updated to reflect this new purpose, but: out of scope for this PR 👍
There was a problem hiding this comment.
I've made a note (created a SecML issue) to review how this affect_job_ids file works as we now have more precedences - but for now will leave this const as-is, thanks for pointing it out!
| "is_hidden": true | ||
| } | ||
| }, | ||
| "index": ".ml-anomalies-custom-v3_linux_anomalous_network_activity", |
There was a problem hiding this comment.
This mappings file (and corresponding data.json.gz) also contains references to
"index": ".ml-anomalies-custom-rare_process_by_host_linux_ecs",
which from my understanding is also migrating here to rare_process_by_host_linux_ea.
Do you want to change all of these references, or leave some "old" job data? I could see arguments either way; just want to make sure this is intentional/desired.
There was a problem hiding this comment.
Thanks for flagging this Ryland, I will test this again; my original intent was to change all references, but now I'm wondering if this isn't actually all used by the test cases, as the tests pass with the stuff that I did change (as of the last change on the tests)
So let me verify... if it's just that the test files have some extra info/mappings/fields, etc. that aren't actually used, then I may leave it for now 🤔 but depends on what I find
We'll keep you posted
There was a problem hiding this comment.
I think it’s fine to keep the reference rare_process_by_host_linux_ecs as is, since it appears to be older than the current version anyway.
There was a problem hiding this comment.
I don't recall if that data is used in any test (except perhaps to verify that rules are properly partitioning by job_id), but: I agree that having the "old" data is good and representative of what actual users would have, so I'm all for keeping it as is 👍
There was a problem hiding this comment.
For learning purposes I went to check the history and confirmed that this PR's change to this file follows the same patterns as the last time the jobs were changed in this file
And on the side, as you mentioned Kirti the last time this file was changed the rare_process_by_host_linux_ecs wasn't changed
So will leave it as is! I do appreciate the comment, Ryland, as you've worked with these files before
spong
left a comment
There was a problem hiding this comment.
Just a single test file change on the SecurityGenAI side -- LGTM! 👍
| // | ||
| // Note: In 9.4 the V3 jobs were replaced by Entity Analytics (_ea) variants that use | ||
| // Entity Analytics fields (host.id, user.id, event.module, etc.) as influencers. | ||
| // V3 non-EA jobs are now also considered affected. |
There was a problem hiding this comment.
If the change below is accepted, should this comment read V3 non-EA jobs are now also considered outdated.?
There was a problem hiding this comment.
For now we'll leave this file as-is, but I've created an internal issue to re-examine how this file works as there's now more precedence of replacing/deprecating ML jobs. We can discuss if we can make this affected/outdated jobs file cleaner
| "created_by": "ml-module-security-auth", | ||
| "security_app_display_name": "Spike in Logon Events", | ||
| "managed": true, | ||
| "job_revision": 4 |
There was a problem hiding this comment.
Is it worth incrementing the job_revision field for all the jobs edited in this PR? I don't know if it's used in any telemetry collected by Security? On the ML side we only use the created_by field for usage tracking of the jobs, and not currently job_revision.
There was a problem hiding this comment.
Thanks for mentioning this! I think that for this PR, since we’re already changing the job_id, it might not be necessary to bump the job_revision. This field could be useful for notifying users of job updates, as it’s already used by Observability jobs in a similar process. We’ll open a separate investigation to explore enabling a similar process under security and leveraging this field for user notifications.
maximpn
left a comment
There was a problem hiding this comment.
Rule Management Area LGTM
⏳ Build in-progress
Failed CI StepsTest Failures
History
|
…ra/kibana into dashboard_align_attachment_to_api * 'dashboard_align_attachment_to_api' of github.com:mbondyra/kibana: (45 commits) [OTel Tracing] HTTP instrumentation (elastic#258663) Replace deprecated EUI icons in files owned by @elastic/ml-ui (elastic#255624) [Codeowners] add missing codeowners for security_solution_api_integration tests (elastic#259223) [CI] fix bad imports that came from a merge-race (elastic#259383) Add `.claude/worktrees/` to `.gitignore` (elastic#259192) Improve unknown-key validation error message in @kbn/config-schema (elastic#258633) [ML] Update Security ML jobs to use entity analytics fields for host and user fields (elastic#255339) [Table sweep] Update table columns responsiveness in Index Management and Dashboards (elastic#259340) skip failing test suite (elastic#258790) skip failing test suite (elastic#259261) chore: util to clean cached images (elastic#259335) [Entity Store] Use last_seen for automated resolution watermark (elastic#258574) [One Workflow] Fix flaky alert trigger Scout test by removing order-dependent assertions (elastic#259299) Skip serverless Discover request counts tests for MKI (elastic#259333) [Security Solution] render header title in new document flyout in Security Solution and Discover (elastic#258166) [Agent Builder] register inference endpoint feature (elastic#259259) [Agent Builder] Skills Command Menu - Add descriptions and scope options to agent (elastic#258964) [Streams][Streamlang][API] Fully use meta({id}) to reuse schema partials in OAS output (elastic#259275) fix(files_example): add tableCaption to EuiInMemoryTable for a11y (elastic#258289) [Entity Store] Adding list endpoint with query filter (elastic#258320) ...
…and user fields (elastic#255339) ## Summary This PR updates the Security ML jobs and datafeeds to use Entity Analytics fields that are supported by the Entity store. **Changes included**: - Renames the ML jobs and datafeeds, adding a suffix of "_ea". - Add EA fields for host and user influencers - Modified the `manifest.json` files within the respective modules to reflect these changes. **Testing:** Tested the jobs in Kibana with test data <img width="1512" height="776" alt="image" src="https://github.com/user-attachments/assets/ed290458-031d-4d85-a33a-00454efa3cb4" /> ### Checklist Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: Susan Chang <shuhsuan.chang@elastic.co> Co-authored-by: Susan <23287722+susan-shu-c@users.noreply.github.com>
## Summary Update the list of influencers for Security ML jobs Related PR adding EA changes to ML jobs: #255339 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
## Summary Update the list of influencers for Security ML jobs Related PR adding EA changes to ML jobs: elastic#255339 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
## Summary Update the list of influencers for Security ML jobs Related PR adding EA changes to ML jobs: elastic#255339 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
… with EA changes (#5348) <!-- Thank you for contributing to the Elastic Docs! 🎉 Use this template to help us efficiently review your contribution. --> ## Summary <!-- Describe what your PR changes or improves. If your PR fixes an issue, link it here. If your PR does not fix an issue, describe the reason you are making the change. --> - Updated the ML jobs ID, description to reflect the changes we made for the new [Entity Analytics (EA) in our ML jobs](elastic/kibana#255339). - Added Privileged Access Detection under Security Integrations Relates to: - elastic/security-ml#1044 These changes are staged for `9.4` release. ## Generative AI disclosure <!-- To help us ensure compliance with the Elastic open source and documentation guidelines, please answer the following: --> 1. Did you use a generative AI (GenAI) tool to assist in creating this contribution? - [ ] Yes - [ ] No <!-- 2. If you answered "Yes" to the previous question, please specify the tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.). Tool(s) and model(s) used: --> --------- Co-authored-by: natasha-moore-elastic <natasha.moore@elastic.co> Co-authored-by: natasha-moore-elastic <137783811+natasha-moore-elastic@users.noreply.github.com>
## Summary Update the list of influencers for Security ML jobs Related PR adding EA changes to ML jobs: elastic#255339 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
Summary
This PR updates the Security ML jobs and datafeeds to use Entity Analytics fields that are supported by the Entity store.
Changes included:
manifest.jsonfiles within the respective modules to reflect these changes.Testing:
Tested the jobs in Kibana with test data
Checklist
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.