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

[ML] Adds new security module to detect anomalous activity in host-based logs #195582

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

sodhikirti07
Copy link
Contributor

@sodhikirti07 sodhikirti07 commented Oct 9, 2024

Summary

Adds a new security module Security: Host to the prebuilt security jobs. The module has the following jobs:

  • Detect Spike in Host based traffic
  • Detect Decrease in Host based traffic

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@sodhikirti07 sodhikirti07 marked this pull request as ready for review October 9, 2024 16:11
@sodhikirti07 sodhikirti07 requested a review from a team as a code owner October 9, 2024 16:11
@@ -0,0 +1,60 @@
{
"id": "security_host",
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to make edits to a couple of the test files to fix the test errors:

https://github.com/elastic/kibana/blob/main/x-pack/test/functional/services/ml/supplied_configurations.ts#L30 - up the expected length to 19 for the new module.

https://github.com/elastic/kibana/blob/main/x-pack/test/api_integration/apis/ml/modules/get_module.ts#L15 - add in security_host to the two arrays in this file (module IDs need to be in alphabetical order, so it will need to go in after security_cloudtrail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I missed this one which will also need updating - https://github.com/elastic/kibana/blob/main/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts#L136 - add in security_host to the expected array in this file, after security_auth.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Overall looks good - managed to test locally by making a small edit to the manifest and datafeed queries.

Left a couple of suggestions on the detector descriptions, and you'll need to fix the tests, but otherwise looks good.

Copy link
Member

@susan-shu-c susan-shu-c left a comment

Choose a reason for hiding this comment

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

Looks good, though it seems that you'll need to add the version label and backport labels to the issue. I think you'll have to add the newest versions this is to go out in, but if in doubt let's check with Stack ML.

I'd also suggest editing the PR description body Detect Stoppages in Host based traffic to Detect decrease in host based traffic to better fit the actual change, for those that come look for this PR later on.

@susan-shu-c susan-shu-c added the release_note:feature Makes this part of the condensed release notes label Oct 11, 2024
@sodhikirti07
Copy link
Contributor Author

@dhru42 Could you take a look at the jobs? Also, what version are we aiming to release this new module?

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson peteharverson added v9.0.0 backport:version Backport to applied version labels labels Oct 11, 2024
@peteharverson
Copy link
Contributor

you'll need to add the version label and backport labels to the issue

I've added our ml labels to this, and also v9.0.0 and backport:version. Once you know whether you are targeting v8.16.0 or v8.17.0, just add the extra version label in.

You should also give the PR a more specific description, like [ML] Adds new security module to detect anomalous activity in host-based logs.

@sodhikirti07 sodhikirti07 changed the title [ML] Add new prebuilt security module [ML] Adds new security module to detect anomalous activity in host-based logs Oct 11, 2024
@dhru42
Copy link

dhru42 commented Nov 20, 2024

you'll need to add the version label and backport labels to the issue

I've added our ml labels to this, and also v9.0.0 and backport:version. Once you know whether you are targeting v8.16.0 or v8.17.0, just add the extra version label in.

You should also give the PR a more specific description, like [ML] Adds new security module to detect anomalous activity in host-based logs.

Hi, If I'm not mistaken we are not supposed to ship any new functionality in 8.17 so we will have to do it in 8.18

@jamesspi can you please confirm?

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for adjusting the ML tests.

@sodhikirti07
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@sodhikirti07 sodhikirti07 merged commit 5ed4297 into main Nov 27, 2024
21 checks passed
@sodhikirti07 sodhikirti07 deleted the kirti/prebuilt_security_jobs_add_new_module branch November 27, 2024 00:24
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12041349870

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 27, 2024
…sed logs (elastic#195582)

## Summary

Adds a new security module `Security: Host` to the prebuilt security
jobs. The module has the following jobs:
- Detect Spike in Host based traffic
- Detect Decrease in Host based traffic

(cherry picked from commit 5ed4297)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 27, 2024
…ost-based logs (#195582) (#201898)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Adds new security module to detect anomalous activity in
host-based logs
(#195582)](#195582)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kirti
Sodhi","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-27T00:24:35Z","message":"[ML]
Adds new security module to detect anomalous activity in host-based logs
(#195582)\n\n## Summary\r\n\r\nAdds a new security module `Security:
Host` to the prebuilt security\r\njobs. The module has the following
jobs:\r\n- Detect Spike in Host based traffic\r\n- Detect Decrease in
Host based
traffic","sha":"5ed42978f8f4471f1f1852ffe90e04bcbb0713e6","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","Feature:Anomaly
Detection","v9.0.0","release_note:feature","backport:version","v8.18.0"],"title":"[ML]
Adds new security module to detect anomalous activity in host-based
logs","number":195582,"url":"https://github.com/elastic/kibana/pull/195582","mergeCommit":{"message":"[ML]
Adds new security module to detect anomalous activity in host-based logs
(#195582)\n\n## Summary\r\n\r\nAdds a new security module `Security:
Host` to the prebuilt security\r\njobs. The module has the following
jobs:\r\n- Detect Spike in Host based traffic\r\n- Detect Decrease in
Host based
traffic","sha":"5ed42978f8f4471f1f1852ffe90e04bcbb0713e6"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195582","number":195582,"mergeCommit":{"message":"[ML]
Adds new security module to detect anomalous activity in host-based logs
(#195582)\n\n## Summary\r\n\r\nAdds a new security module `Security:
Host` to the prebuilt security\r\njobs. The module has the following
jobs:\r\n- Detect Spike in Host based traffic\r\n- Detect Decrease in
Host based
traffic","sha":"5ed42978f8f4471f1f1852ffe90e04bcbb0713e6"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Kirti Sodhi <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…sed logs (elastic#195582)

## Summary

Adds a new security module `Security: Host` to the prebuilt security
jobs. The module has the following jobs:
- Detect Spike in Host based traffic
- Detect Decrease in Host based traffic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Anomaly Detection ML anomaly detection :ml release_note:feature Makes this part of the condensed release notes v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants