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] Adding V3 modules for Security_Linux and Security_Windows #123274

Closed
wants to merge 14 commits into from

Conversation

dishadasgupta
Copy link

Summary

Files/Job Artifacts:


  • 2 updated manifest .json files - for both linux and windows

  • Updated/new ML Job configurations for 26 jobs - each with associated datafeed configuration files:

    • security_linux: 14 jobs

      • v3_linux_anomalous_network_activity
      • v3_linux_anomalous_network_port_activity_ecs
      • v3_linux_anomalous_process_all_hosts_ecs
      • v3_linux_anomalous_user_name_ecs
      • v3_linux_network_configuration_discovery
      • v3_linux_network_connection_discovery
      • v3_linux_rare_metadata_process
      • v3_linux_rare_metadata_user
      • v3_linux_rare_sudo_user
      • v3_linux_rare_user_compiler
      • v3_linux_system_information_discovery
      • v3_linux_system_process_discovery
      • v3_linux_system_user_discovery
      • v3_rare_process_by_host_linux_ecs
    • security_windows: 12 jobs

      • v3_rare_process_by_host_windows_ecs
      • v3_windows_anomalous_network_activity_ecs
      • v3_windows_anomalous_path_activity_ecs
      • v3_windows_anomalous_process_all_hosts_ecs
      • v3_windows_anomalous_process_creation
      • v3_windows_anomalous_script
      • v3_windows_anomalous_service
      • v3_windows_anomalous_user_name_ecs
      • v3_windows_rare_metadata_process
      • v3_windows_rare_metadata_user
      • v3_windows_rare_user_runas_event
      • v3_windows_rare_user_type10_remote_login

Tests:


Individual job test tracking stats available here: https://docs.google.com/spreadsheets/d/1JOUIVsitaMdEdhM3WT2Eag4ELI-rI2Jec7bXildJsdQ/edit#gid=0

@randomuserid to also post more updates as needed to this issue + regarding tests, thanks

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@dishadasgupta
Copy link
Author

@elastic/ml-ui - Referring to #85065, I see there are some other edits I need to make to ensure these show up in the UI, doing so

@dishadasgupta dishadasgupta requested a review from a team as a code owner January 18, 2022 18:30
@dishadasgupta
Copy link
Author

Also updated some descriptions/docs based on @szabosteve comments left from #123000

@dishadasgupta
Copy link
Author

dishadasgupta commented Jan 19, 2022

A few questions in order to progress on the errors I'm seeing above:

I'm failing this test from this code part here. My understanding is the reference module ids need to be updated to also include security_windows_v3. I'm a little unfamiliar with how to do this - is there a better point person I can work with to get this fixed? I'm anticipating a similar fix needed to include security_linux_v3 in other relevant areas too.

Happy to pair and provide more context, please let me know what I can do from my end to help, thank you!

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

@dishadasgupta I've looked into your two question and for the linter one find my suggested code change below.

For the test failures: I haven't looked too closely into the module definitions yet, but if the v3 modules are supposed to basically match the same data, then those failures are expected and the fix is to add security_linux_v3 to the expected recognized module everywhere we already recognize security_linux (and the same for the windows module). Note, that the order matters. Here's what worked for me locally: https://gist.github.com/pheyos/bb396d6b954c0af3ec26c202d2392efb
If the v3 module is not supposed to match the same data, we should take a closer look what's going on.

@bfilar
Copy link
Contributor

bfilar commented Jan 19, 2022

This is a new refactored job which works on ECS compatible events across multiple indices. This sentence appears in the description field for 14 of the jobs.

We should remove that language due to:

  1. It significantly increases the size of the overall description
  2. It is disjointed to read, compared to the rest of the description.

I believe we can capture the “refactor” sentiment in release notes.

dishadasgupta and others added 3 commits January 19, 2022 10:17
updated manifest description to be more informative & clear that these are the latest and current modules, and that the v2 module is no longer necessary with current data.
@sophiec20
Copy link
Contributor

sophiec20 commented Jan 19, 2022

Thanks for getting this ready for review well before FF. Some minor points

  1. Module description

This appears in the create job wizard tile. There is limited space in the tile - suggest we keep it succinct and descriptive.

Current: "Security: Linux v3 (2022). This module is a replacement for the v2 Linux module. This module contains all shipping ML jobs for Linux host based threat hunting and detection.."

V2 module description was
"Detect suspicious activity using ECS Linux events. Tested with Auditbeat and the Elastic agent."

Suggest something like "Detect suspicious activity using ECS Linux events. Replaces Security Linux V2." - (there is no need to repeat the module title).

  1. Standard configs

These comments apply to multiple job configs:

The following fields can be removed. Recommend standardising across all modules.
detector_index
categorization_examples_limit
time_format

The following fields are applicable. Recommend applying and standardising for all modules:
"allow_lazy_open": true
"created_by": "ml-module-security-linux" or "created_by": "ml-module-security-windows"

Note that the created_by field is used in ML telemetry. This was not versioned for V2 and for ML telemetry purposes, it is not needed to be versioned for V3.

reworked descriptions
@randomuserid
Copy link
Contributor

"created_by": "ml-module-security-linux" or "created_by": "ml-module-security-windows"

Note that the created_by field is used in ML telemetry. This was not versioned for V2 and for ML telemetry purposes, it is not needed to be versioned for V3.

@SourinPaul @donaherc where these are used for telemetry now, in ML job telemetry, what values should we be placing in the created_by field?

added  "allow_lazy_open": true, where it was missing
checked all model memory limits and set them equal to the values in the shipping jobs
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 4.6MB 4.6MB +42.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @randomuserid @dishadasgupta

@randomuserid
Copy link
Contributor

We're going to pause this and hold it for 8.2. See https://github.com/elastic/security-team/issues/1490

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.

7 participants