From 4dc21e5589067fe68ca2767204759e8579914c16 Mon Sep 17 00:00:00 2001
From: Apoorva Joshi <30438249+ajosh0504@users.noreply.github.com>
Date: Mon, 24 Apr 2023 06:51:06 -0700
Subject: [PATCH 06/13] Updates to pre-built Security ML jobs (#154596)
## Summary
This PR makes the following updates to the pre-built Security ML jobs:
- Making the `security-packetbeat` compatible with Agent
- Removing superfluous fields from the job configurations to make them
consistent
- Updating the `detector_description` field for almost all jobs
- Adding influencers where missing and/or relevant
- Adding a `job_revision` custom setting similar to the Logs
[jobs](https://github.com/elastic/kibana/blob/main/x-pack/plugins/ml/server/models/data_recognizer/modules/logs_ui_analysis/ml/log_entry_rate.json#L29).
Moving forward, this number will be updated each time a job is updated.
We are starting with 4 since the `linux` and `windows` jobs are at v3
right now
- Adding a `managed`: `true` tag to indicate that these jobs are
pre-configured by Elastic and so users will see the warnings added in
[this](https://github.com/elastic/kibana/pull/122305) PR if users choose
to delete, or modify these jobs
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
---
.../modules/security_auth/manifest.json | 4 +-
.../ml/auth_high_count_logon_events.json | 14 ++---
...gh_count_logon_events_for_a_source_ip.json | 18 ++----
.../ml/auth_high_count_logon_fails.json | 14 ++---
.../ml/auth_rare_hour_for_a_user.json | 18 +++---
.../ml/auth_rare_source_ip_for_a_user.json | 18 +++---
.../security_auth/ml/auth_rare_user.json | 18 +++---
.../datafeed_suspicious_login_activity.json | 9 +--
.../ml/suspicious_login_activity.json | 27 +++------
.../modules/security_cloudtrail/manifest.json | 12 ++--
.../ml/high_distinct_count_error_message.json | 21 +++----
.../ml/rare_error_code.json | 20 +++----
.../ml/rare_method_for_a_city.json | 20 +++----
.../ml/rare_method_for_a_country.json | 20 +++----
.../ml/rare_method_for_a_username.json | 17 +++---
.../modules/security_linux/manifest.json | 7 +--
.../v3_linux_anomalous_network_activity.json | 49 +++--------------
...linux_anomalous_network_port_activity.json | 49 +++--------------
.../v3_linux_anomalous_process_all_hosts.json | 49 +++--------------
.../ml/v3_linux_anomalous_user_name.json | 48 +++-------------
...linux_network_configuration_discovery.json | 51 +++--------------
...v3_linux_network_connection_discovery.json | 51 +++--------------
.../ml/v3_linux_rare_metadata_process.json | 30 +++-------
.../ml/v3_linux_rare_metadata_user.json | 29 +++-------
.../ml/v3_linux_rare_sudo_user.json | 51 +++--------------
.../ml/v3_linux_rare_user_compiler.json | 43 +++------------
...v3_linux_system_information_discovery.json | 51 +++--------------
.../ml/v3_linux_system_process_discovery.json | 51 +++--------------
.../ml/v3_linux_system_user_discovery.json | 49 +++--------------
.../ml/v3_rare_process_by_host_linux.json | 48 +++-------------
.../modules/security_network/manifest.json | 4 +-
.../ml/high_count_by_destination_country.json | 14 ++---
.../ml/high_count_network_denies.json | 14 ++---
.../ml/high_count_network_events.json | 14 ++---
.../ml/rare_destination_country.json | 11 ++--
.../modules/security_packetbeat/manifest.json | 10 ++--
.../ml/datafeed_packetbeat_dns_tunneling.json | 16 +++---
...datafeed_packetbeat_rare_dns_question.json | 16 +++---
.../datafeed_packetbeat_rare_user_agent.json | 16 +++---
.../ml/packetbeat_dns_tunneling.json | 29 +++-------
.../ml/packetbeat_rare_dns_question.json | 22 ++------
.../ml/packetbeat_rare_server_domain.json | 24 ++------
.../ml/packetbeat_rare_urls.json | 23 ++------
.../ml/packetbeat_rare_user_agent.json | 23 ++------
.../ml/v3_rare_process_by_host_windows.json | 53 +++---------------
...v3_windows_anomalous_network_activity.json | 53 +++---------------
.../v3_windows_anomalous_path_activity.json | 52 +++---------------
...3_windows_anomalous_process_all_hosts.json | 55 +++----------------
...v3_windows_anomalous_process_creation.json | 53 +++---------------
.../ml/v3_windows_anomalous_script.json | 42 +++-----------
.../ml/v3_windows_anomalous_service.json | 37 +++----------
.../ml/v3_windows_anomalous_user_name.json | 53 +++---------------
.../ml/v3_windows_rare_metadata_process.json | 34 +++---------
.../ml/v3_windows_rare_metadata_user.json | 33 +++--------
.../ml/v3_windows_rare_user_runas_event.json | 46 ++--------------
...windows_rare_user_type10_remote_login.json | 46 ++--------------
56 files changed, 386 insertions(+), 1313 deletions(-)
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json
index b3395d82a9c29..d600e4a637acf 100755
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json
@@ -2,7 +2,7 @@
"id": "security_auth",
"title": "Security: Authentication",
"description": "Detect anomalous activity in your ECS-compatible authentication logs.",
- "type": "auth data",
+ "type": "Auth data",
"logoFile": "logo.json",
"defaultIndexPattern": "auditbeat-*,logs-*,filebeat-*,winlogbeat-*",
"query": {
@@ -14,7 +14,7 @@
}
}
],
- "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } }
+ "must_not": { "terms": { "_tier": ["data_frozen", "data_cold"] } }
}
},
"jobs": [
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events.json
index 7ca7a5ebd71e4..ac50e2f53535c 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events.json
@@ -1,20 +1,16 @@
{
"description": "Security: Authentication - Looks for an unusually large spike in successful authentication events. This can be due to password spraying, user enumeration, or brute force activity.",
- "groups": [
- "security",
- "authentication"
- ],
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high count of logon events",
+ "detector_description": "Detects high count of logon events.",
"function": "high_non_zero_count",
"detector_index": 0
}
],
- "influencers": [],
- "model_prune_window": "30d"
+ "influencers": ["source.ip", "winlog.event_data.LogonType", "user.name", "host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -25,6 +21,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-auth",
- "security_app_display_name": "Spike in Logon Events"
+ "security_app_display_name": "Spike in Logon Events",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events_for_a_source_ip.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events_for_a_source_ip.json
index 47096f4c6413f..d23f8df88ef6a 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events_for_a_source_ip.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_events_for_a_source_ip.json
@@ -1,25 +1,17 @@
{
"description": "Security: Authentication - Looks for an unusually large spike in successful authentication events from a particular source IP address. This can be due to password spraying, user enumeration, or brute force activity.",
- "groups": [
- "security",
- "authentication"
- ],
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high count of auth events for a source IP",
+ "detector_description": "Detects high count of auth events for a source IP.",
"function": "high_non_zero_count",
"by_field_name": "source.ip",
"detector_index": 0
}
],
- "influencers": [
- "source.ip",
- "winlog.event_data.LogonType",
- "user.name"
- ],
- "model_prune_window": "30d"
+ "influencers": ["source.ip", "winlog.event_data.LogonType", "user.name", "host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -30,6 +22,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-auth",
- "security_app_display_name": "Spike in Logon Events from a Source IP"
+ "security_app_display_name": "Spike in Logon Events from a Source IP",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_fails.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_fails.json
index 48586ef642ca6..db2db5ea00832 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_fails.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_high_count_logon_fails.json
@@ -1,20 +1,16 @@
{
"description": "Security: Authentication - Looks for an unusually large spike in authentication failure events. This can be due to password spraying, user enumeration, or brute force activity and may be a precursor to account takeover or credentialed access.",
- "groups": [
- "security",
- "authentication"
- ],
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high count of logon fails",
+ "detector_description": "Detects high count of logon fails.",
"function": "high_non_zero_count",
"detector_index": 0
}
],
- "influencers": [],
- "model_prune_window": "30d"
+ "influencers": ["source.ip", "user.name", "host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -25,6 +21,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-auth",
- "security_app_display_name": "Spike in Failed Logon Events"
+ "security_app_display_name": "Spike in Failed Logon Events",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_hour_for_a_user.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_hour_for_a_user.json
index 1f421ed298b9f..57477497aeb62 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_hour_for_a_user.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_hour_for_a_user.json
@@ -1,23 +1,17 @@
{
- "description": "Security: Authentication - looks for a user logging in at a time of day that is unusual for the user. This can be due to credentialed access via a compromised account when the user and the threat actor are in different time zones. In addition, unauthorized user activity often takes place during non-business hours.",
- "groups": [
- "security",
- "authentication"
- ],
+ "description": "Security: Authentication - Looks for a user logging in at a time of day that is unusual for the user. This can be due to credentialed access via a compromised account when the user and the threat actor are in different time zones. In addition, unauthorized user activity often takes place during non-business hours.",
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare hour for a user",
+ "detector_description": "Detects rare hour for a user.",
"function": "time_of_day",
"by_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "source.ip",
- "user.name"
- ]
+ "influencers": ["source.ip", "user.name", "host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -28,6 +22,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-auth",
- "security_app_display_name": "Unusual Hour for a User to Logon"
+ "security_app_display_name": "Unusual Hour for a User to Logon",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_source_ip_for_a_user.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_source_ip_for_a_user.json
index 98a249074a67a..81185ef5039c7 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_source_ip_for_a_user.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_source_ip_for_a_user.json
@@ -1,24 +1,18 @@
{
- "description": "Security: Authentication - looks for a user logging in from an IP address that is unusual for the user. This can be due to credentialed access via a compromised account when the user and the threat actor are in different locations. An unusual source IP address for a username could also be due to lateral movement when a compromised account is used to pivot between hosts.",
- "groups": [
- "security",
- "authentication"
- ],
+ "description": "Security: Authentication - Looks for a user logging in from an IP address that is unusual for the user. This can be due to credentialed access via a compromised account when the user and the threat actor are in different locations. An unusual source IP address for a username could also be due to lateral movement when a compromised account is used to pivot between hosts.",
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare source IP for a user",
+ "detector_description": "Detects rare source IP for a user.",
"function": "rare",
"by_field_name": "source.ip",
"partition_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "source.ip",
- "user.name"
- ]
+ "influencers": ["source.ip", "user.name", "host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -29,6 +23,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-auth",
- "security_app_display_name": "Unusual Source IP for a User to Logon from"
+ "security_app_display_name": "Unusual Source IP for a User to Logon from",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_user.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_user.json
index e2488480e61d1..58530fe085014 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_user.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/auth_rare_user.json
@@ -1,23 +1,17 @@
{
- "description": "Security: Authentication - looks for an unusual user name in the authentication logs. An unusual user name is one way of detecting credentialed access by means of a new or dormant user account. A user account that is normally inactive, because the user has left the organization, which becomes active, may be due to credentialed access using a compromised account password. Threat actors will sometimes also create new users as a means of persisting in a compromised web application.",
- "groups": [
- "security",
- "authentication"
- ],
+ "description": "Security: Authentication - Looks for an unusual user name in the authentication logs. An unusual user name is one way of detecting credentialed access by means of a new or dormant user account. A user account that is normally inactive, because the user has left the organization, which becomes active, may be due to credentialed access using a compromised account password. Threat actors will sometimes also create new users as a means of persisting in a compromised web application.",
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare user",
+ "detector_description": "Detects rare user authentication.",
"function": "rare",
"by_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "source.ip",
- "user.name"
- ]
+ "influencers": ["source.ip", "user.name", "host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -28,6 +22,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-auth",
- "security_app_display_name": "Rare User Logon"
+ "security_app_display_name": "Rare User Logon",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/datafeed_suspicious_login_activity.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/datafeed_suspicious_login_activity.json
index 386b9fab25667..59a9129e7b7bf 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/datafeed_suspicious_login_activity.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/datafeed_suspicious_login_activity.json
@@ -1,15 +1,10 @@
{
"job_id": "JOB_ID",
- "indices": [
- "INDEX_PATTERN_NAME"
- ],
+ "indices": ["INDEX_PATTERN_NAME"],
"max_empty_searches": 10,
"query": {
"bool": {
- "filter": [
- {"term": { "event.category": "authentication" }},
- {"term": { "agent.type": "auditbeat" }}
- ]
+ "filter": [{ "term": { "event.category": "authentication" } }]
}
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/suspicious_login_activity.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/suspicious_login_activity.json
index 00e810b5348e7..bbe420b3ec0eb 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/suspicious_login_activity.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/ml/suspicious_login_activity.json
@@ -1,24 +1,17 @@
{
- "description": "Security: Auditbeat - Detect unusually high number of authentication attempts.",
- "groups": [
- "security",
- "auditbeat",
- "authentication"
- ],
+ "description": "Security: Authentication - Detects unusually high number of authentication attempts.",
+ "groups": ["security", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high number of authentication attempts",
+ "detector_description": "Detects high number of authentication attempts for a host.",
"function": "high_non_zero_count",
- "partition_field_name": "host.name"
+ "partition_field_name": "host.name",
+ "detector_index": 0
}
],
- "influencers": [
- "host.name",
- "user.name",
- "source.ip"
- ],
+ "influencers": ["host.name", "user.name", "source.ip"],
"model_prune_window": "30d"
},
"allow_lazy_open": true,
@@ -31,11 +24,7 @@
"custom_settings": {
"created_by": "ml-module-security-auth",
"security_app_display_name": "Unusual Login Activity",
- "custom_urls": [
- {
- "url_name": "IP Address Details",
- "url_value": "security/network/ml-network/ip/$source.ip$?_g=()&query=!n&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ]
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/manifest.json
index 93797b9e3e758..52b406a0da7cb 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/manifest.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/manifest.json
@@ -1,16 +1,14 @@
{
"id": "security_cloudtrail",
"title": "Security: Cloudtrail",
- "description": "Detect suspicious activity recorded in your cloudtrail logs.",
- "type": "Filebeat data",
+ "description": "Detect suspicious activity recorded in Cloudtrail logs.",
+ "type": "Cloudtrail data",
"logoFile": "logo.json",
- "defaultIndexPattern": "filebeat-*",
+ "defaultIndexPattern": "logs-*,filebeat-*",
"query": {
"bool": {
- "filter": [
- {"term": {"event.dataset": "aws.cloudtrail"}}
- ],
- "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } }
+ "filter": [{ "term": { "event.dataset": "aws.cloudtrail" } }],
+ "must_not": { "terms": { "_tier": ["data_frozen", "data_cold"] } }
}
},
"jobs": [
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/high_distinct_count_error_message.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/high_distinct_count_error_message.json
index 11b5f4625a484..2ba7c4fdf4085 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/high_distinct_count_error_message.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/high_distinct_count_error_message.json
@@ -1,24 +1,17 @@
{
"description": "Security: Cloudtrail - Looks for a spike in the rate of an error message which may simply indicate an impending service failure but these can also be byproducts of attempted or successful persistence, privilege escalation, defense evasion, discovery, lateral movement, or collection activity by a threat actor.",
- "groups": [
- "security",
- "cloudtrail"
- ],
+ "groups": ["security", "cloudtrail"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high_distinct_count(\"aws.cloudtrail.error_message\")",
+ "detector_description": "Detects high distinct count of Cloudtrail error messages.",
"function": "high_distinct_count",
- "field_name": "aws.cloudtrail.error_message"
+ "field_name": "aws.cloudtrail.error_message",
+ "detector_index": 0
}
],
- "influencers": [
- "aws.cloudtrail.user_identity.arn",
- "source.ip",
- "source.geo.city_name"
- ],
- "model_prune_window": "30d"
+ "influencers": ["aws.cloudtrail.user_identity.arn", "source.ip", "source.geo.city_name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -29,6 +22,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-cloudtrail",
- "security_app_display_name": "Spike in AWS Error Messages"
+ "security_app_display_name": "Spike in AWS Error Messages",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_error_code.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_error_code.json
index c54c8e8378f2c..7752430876e3f 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_error_code.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_error_code.json
@@ -1,23 +1,17 @@
{
"description": "Security: Cloudtrail - Looks for unusual errors. Rare and unusual errors may simply indicate an impending service failure but they can also be byproducts of attempted or successful persistence, privilege escalation, defense evasion, discovery, lateral movement, or collection activity by a threat actor.",
- "groups": [
- "security",
- "cloudtrail"
- ],
+ "groups": ["security", "cloudtrail"],
"analysis_config": {
"bucket_span": "60m",
"detectors": [
{
- "detector_description": "rare by \"aws.cloudtrail.error_code\"",
+ "detector_description": "Detects rare Cloudtrail error codes.",
"function": "rare",
- "by_field_name": "aws.cloudtrail.error_code"
+ "by_field_name": "aws.cloudtrail.error_code",
+ "detector_index": 0
}
],
- "influencers": [
- "aws.cloudtrail.user_identity.arn",
- "source.ip",
- "source.geo.city_name"
- ]
+ "influencers": ["aws.cloudtrail.user_identity.arn", "source.ip", "source.geo.city_name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -28,6 +22,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-cloudtrail",
- "security_app_display_name": "Rare AWS Error Code"
+ "security_app_display_name": "Rare AWS Error Code",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_city.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_city.json
index 2ed28884be94f..f7be6fe8cc8d7 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_city.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_city.json
@@ -1,24 +1,18 @@
{
"description": "Security: Cloudtrail - Looks for AWS API calls that, while not inherently suspicious or abnormal, are sourcing from a geolocation (city) that is unusual. This can be the result of compromised credentials or keys.",
- "groups": [
- "security",
- "cloudtrail"
- ],
+ "groups": ["security", "cloudtrail"],
"analysis_config": {
"bucket_span": "60m",
"detectors": [
{
- "detector_description": "rare by \"event.action\" partition by \"source.geo.city_name\"",
+ "detector_description": "Detects rare event actions for a city.",
"function": "rare",
"by_field_name": "event.action",
- "partition_field_name": "source.geo.city_name"
+ "partition_field_name": "source.geo.city_name",
+ "detector_index": 0
}
],
- "influencers": [
- "aws.cloudtrail.user_identity.arn",
- "source.ip",
- "source.geo.city_name"
- ]
+ "influencers": ["aws.cloudtrail.user_identity.arn", "source.ip", "source.geo.city_name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -29,6 +23,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-cloudtrail",
- "security_app_display_name": "Unusual City for an AWS Command"
+ "security_app_display_name": "Unusual City for an AWS Command",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_country.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_country.json
index 1f14357e73444..d73f51f34de3a 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_country.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_country.json
@@ -1,24 +1,18 @@
{
"description": "Security: Cloudtrail - Looks for AWS API calls that, while not inherently suspicious or abnormal, are sourcing from a geolocation (country) that is unusual. This can be the result of compromised credentials or keys.",
- "groups": [
- "security",
- "cloudtrail"
- ],
+ "groups": ["security", "cloudtrail"],
"analysis_config": {
"bucket_span": "60m",
"detectors": [
{
- "detector_description": "rare by \"event.action\" partition by \"source.geo.country_iso_code\"",
+ "detector_description": "Detects rare event actions for an ISO code.",
"function": "rare",
"by_field_name": "event.action",
- "partition_field_name": "source.geo.country_iso_code"
+ "partition_field_name": "source.geo.country_iso_code",
+ "detector_index": 0
}
],
- "influencers": [
- "aws.cloudtrail.user_identity.arn",
- "source.ip",
- "source.geo.country_iso_code"
- ]
+ "influencers": ["aws.cloudtrail.user_identity.arn", "source.ip", "source.geo.country_iso_code"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -29,6 +23,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-cloudtrail",
- "security_app_display_name": "Unusual Country for an AWS Command"
+ "security_app_display_name": "Unusual Country for an AWS Command",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_username.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_username.json
index 76cce7fb829ca..a508028619833 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_username.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_cloudtrail/ml/rare_method_for_a_username.json
@@ -1,23 +1,22 @@
{
"description": "Security: Cloudtrail - Looks for AWS API calls that, while not inherently suspicious or abnormal, are sourcing from a user context that does not normally call the method. This can be the result of compromised credentials or keys as someone uses a valid account to persist, move laterally, or exfil data.",
- "groups": [
- "security",
- "cloudtrail"
- ],
+ "groups": ["security", "cloudtrail"],
"analysis_config": {
"bucket_span": "60m",
"detectors": [
{
- "detector_description": "rare by \"event.action\" partition by \"user.name\"",
+ "detector_description": "Detects rare event actions for a user.",
"function": "rare",
"by_field_name": "event.action",
- "partition_field_name": "user.name"
+ "partition_field_name": "user.name",
+ "detector_index": 0
}
],
"influencers": [
"user.name",
"source.ip",
- "source.geo.city_name"
+ "source.geo.city_name",
+ "aws.cloudtrail.user_identity.arn"
]
},
"allow_lazy_open": true,
@@ -29,6 +28,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-cloudtrail",
- "security_app_display_name": "Unusual AWS Command for a User"
+ "security_app_display_name": "Unusual AWS Command for a User",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json
index 269f90dea4471..cfff61e304c0e 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json
@@ -2,7 +2,7 @@
"id": "security_linux_v3",
"title": "Security: Linux",
"description": "Anomaly detection jobs for Linux host-based threat hunting and detection.",
- "type": "linux data",
+ "type": "Linux data",
"logoFile": "logo.json",
"defaultIndexPattern": "auditbeat-*,logs-*",
"query": {
@@ -43,10 +43,7 @@
],
"must_not": {
"terms": {
- "_tier": [
- "data_frozen",
- "data_cold"
- ]
+ "_tier": ["data_frozen", "data_cold"]
}
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_activity.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_activity.json
index 29f6bf1d98412..b276bcc7856ba 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_activity.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_activity.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for unusual processes using the network which could indicate command-and-control, lateral movement, persistence, or data exfiltration activity.",
- "groups": [
- "auditbeat",
- "endpoint",
- "linux",
- "network",
- "security"
- ],
+ "groups": ["linux", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.name values.",
+ "detector_description": "Detects rare processes.",
"function": "rare",
- "by_field_name": "process.name"
+ "by_field_name": "process.name",
+ "detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name",
- "destination.ip"
- ]
+ "influencers": ["host.name", "process.name", "user.name", "destination.ip"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4004",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "siem#/ml-hosts/$host.name$?_g=()&kqlQuery=(filterQuery:(expression:'process.name%20:%20%22$process.name$%22',kind:kuery),queryLocation:hosts.details,type:details)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "siem#/ml-hosts/$host.name$?_g=()&kqlQuery=(filterQuery:(expression:'user.name%20:%20%22$user.name$%22',kind:kuery),queryLocation:hosts.details,type:details)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "siem#/ml-hosts?_g=()&kqlQuery=(filterQuery:(expression:'process.name%20:%20%22$process.name$%22',kind:kuery),queryLocation:hosts.page,type:page)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "siem#/ml-hosts?_g=()&kqlQuery=(filterQuery:(expression:'user.name%20:%20%22$user.name$%22',kind:kuery),queryLocation:hosts.page,type:page)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux Network Activity"
+ "security_app_display_name": "Unusual Linux Network Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_port_activity.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_port_activity.json
index 34b97358260ac..a551d6c2c204f 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_port_activity.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_network_port_activity.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for unusual destination port activity that could indicate command-and-control, persistence mechanism, or data exfiltration activity.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "network"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare destination.port values.",
+ "detector_description": "Detects rare destination ports.",
"function": "rare",
- "by_field_name": "destination.port"
+ "by_field_name": "destination.port",
+ "detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name",
- "destination.ip"
- ]
+ "influencers": ["host.name", "process.name", "user.name", "destination.ip"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4005",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux Network Port Activity"
+ "security_app_display_name": "Unusual Linux Network Port Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_process_all_hosts.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_process_all_hosts.json
index a20a508391fb9..dea5fa3a5db31 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_process_all_hosts.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_process_all_hosts.json
@@ -1,65 +1,30 @@
{
"description": "Security: Linux - Looks for processes that are unusual to all Linux hosts. Such unusual processes may indicate unauthorized software, malware, or persistence mechanisms.",
- "groups": [
- "auditbeat",
- "endpoint",
- "linux",
- "process",
- "security"
- ],
+ "groups": ["linux", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.name values.",
+ "detector_description": "Detects rare processes.",
"function": "rare",
"by_field_name": "process.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "512mb",
- "categorization_examples_limit": 4
-
+ "model_memory_limit": "512mb"
},
"data_description": {
"time_field": "@timestamp",
"time_format": "epoch_ms"
},
"custom_settings": {
- "job_tags": {
- "euid": "4003",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Anomalous Process for a Linux Population"
+ "security_app_display_name": "Anomalous Process for a Linux Population",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_user_name.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_user_name.json
index 72be89bd79aad..05d46860b145f 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_user_name.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_anomalous_user_name.json
@@ -1,64 +1,30 @@
{
"description": "Security: Linux - Rare and unusual users that are not normally active may indicate unauthorized changes or activity by an unauthorized user which may be credentialed access or lateral movement.",
- "groups": [
- "auditbeat",
- "endpoint",
- "linux",
- "process",
- "security"
- ],
+ "groups": ["linux", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
"by_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "32mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "32mb"
},
"data_description": {
"time_field": "@timestamp",
"time_format": "epoch_ms"
},
"custom_settings": {
- "job_tags": {
- "euid": "4008",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux Username"
+ "security_app_display_name": "Unusual Linux Username",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_configuration_discovery.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_configuration_discovery.json
index 1481b7a03a559..fccfa9493e8c2 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_configuration_discovery.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_configuration_discovery.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for commands related to system network configuration discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used by a threat actor to engage in system network configuration discovery to increase their understanding of connected networks and hosts. This information may be used to shape follow-up behaviors such as lateral movement or additional discovery.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "process.args",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "process.args", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "40012",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux System Network Configuration Discovery"
+ "security_app_display_name": "Unusual Linux Network Configuration Discovery",
+ "managed": true,
+ "job_revision": 4
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_connection_discovery.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_connection_discovery.json
index 2b1cf43ac94d3..32dc04c079db1 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_connection_discovery.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_network_connection_discovery.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for commands related to system network connection discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used by a threat actor to engage in system network connection discovery to increase their understanding of connected services and systems. This information may be used to shape follow-up behaviors such as lateral movement or additional discovery.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "process.args",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "process.args", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4013",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux Network Connection Discovery"
+ "security_app_display_name": "Unusual Linux Network Connection Discovery",
+ "managed": true,
+ "job_revision": 4
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_process.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_process.json
index fcec32acd69b5..6897876ad6ba3 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_process.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_process.json
@@ -1,46 +1,30 @@
{
"description": "Security: Linux - Looks for anomalous access to the metadata service by an unusual process. The metadata service may be targeted in order to harvest credentials or user data scripts containing secrets.",
- "groups": [
- "auditbeat",
- "endpoint",
- "linux",
- "process",
- "security"
- ],
+ "groups": ["linux", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.name values.",
+ "detector_description": "Detects rare processes.",
"function": "rare",
"by_field_name": "process.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "user.name",
- "process.name"
- ]
+ "influencers": ["host.name", "user.name", "process.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "32mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "32mb"
},
"data_description": {
"time_field": "@timestamp",
"time_format": "epoch_ms"
},
"custom_settings": {
- "job_tags": {
- "euid": "4009",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "security_app_display_name": "Unusual Linux Process Calling the Metadata Service"
+ "security_app_display_name": "Unusual Linux Process Calling the Metadata Service",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_user.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_user.json
index d8414c8bf22bd..ad81023d69383 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_user.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_metadata_user.json
@@ -1,45 +1,30 @@
{
"description": "Security: Linux - Looks for anomalous access to the metadata service by an unusual user. The metadata service may be targeted in order to harvest credentials or user data scripts containing secrets.",
- "groups": [
- "auditbeat",
- "endpoint",
- "linux",
- "process",
- "security"
- ],
+ "groups": ["linux", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
"by_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "user.name"
- ]
+ "influencers": ["host.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "32mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "32mb"
},
"data_description": {
"time_field": "@timestamp",
"time_format": "epoch_ms"
},
"custom_settings": {
- "job_tags": {
- "euid": "4010",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "security_app_display_name": "Unusual Linux User Calling the Metadata Service"
+ "security_app_display_name": "Unusual Linux User Calling the Metadata Service",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_sudo_user.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_sudo_user.json
index a99e5f95572f7..11be6277c4220 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_sudo_user.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_sudo_user.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for sudo activity from an unusual user context. Unusual user context changes can be due to privilege escalation.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "process.args",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "process.args", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4017",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Sudo Activity"
+ "security_app_display_name": "Unusual Sudo Activity",
+ "managed": true,
+ "job_revision": 4
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_user_compiler.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_user_compiler.json
index 9c8ca5316ace3..08dbbc60d02f7 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_user_compiler.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_rare_user_compiler.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for compiler activity by a user context which does not normally run compilers. This can be ad-hoc software changes or unauthorized software deployment. This can also be due to local privilege elevation via locally run exploits or malware activity.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.title",
- "host.name",
- "process.working_directory",
- "user.name"
- ]
+ "influencers": ["process.title", "host.name", "process.working_directory", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,24 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4018",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Anomalous Linux Compiler Activity"
+ "security_app_display_name": "Anomalous Linux Compiler Activity",
+ "managed": true,
+ "job_revision": 4
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_information_discovery.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_information_discovery.json
index 0202854934285..255d0347654b0 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_information_discovery.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_information_discovery.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for commands related to system information discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used to engage in system information discovery to gather detailed information about system configuration and software versions. This may be a precursor to the selection of a persistence mechanism or a method of privilege elevation.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "process.args",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "process.args", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4014",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux System Information Discovery Activity"
+ "security_app_display_name": "Unusual Linux System Information Discovery Activity",
+ "managed": true,
+ "job_revision": 4
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_process_discovery.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_process_discovery.json
index 23e6e607ccf08..03e57ce2237af 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_process_discovery.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_process_discovery.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for commands related to system process discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used to engage in system process discovery to increase their understanding of software applications running on a target host or network. This may be a precursor to the selection of a persistence mechanism or a method of privilege elevation.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "process.args",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "process.args", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4015",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux Process Discovery Activity"
+ "security_app_display_name": "Unusual Linux Process Discovery Activity",
+ "managed": true,
+ "job_revision": 4
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_user_discovery.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_user_discovery.json
index 8659e7a8f1f91..2b1c4dc595777 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_user_discovery.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_linux_system_user_discovery.json
@@ -1,27 +1,17 @@
{
"description": "Security: Linux - Looks for commands related to system user or owner discovery from an unusual user context. This can be due to uncommon troubleshooting activity or due to a compromised account. A compromised account may be used to engage in system owner or user discovery to identify currently active or primary users of a system. This may be a precursor to additional discovery, credential dumping, or privilege elevation activity.",
- "groups": [
- "security",
- "auditbeat",
- "endpoint",
- "linux",
- "process"
- ],
+ "groups": ["security", "linux"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
- "by_field_name": "user.name"
+ "by_field_name": "user.name",
+ "detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "process.args",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "process.args", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "4016",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Linux System Owner or User Discovery Activity"
+ "security_app_display_name": "Unusual Linux User Discovery Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_rare_process_by_host_linux.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_rare_process_by_host_linux.json
index a072007a0f13c..ce0e7f413f676 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_rare_process_by_host_linux.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/ml/v3_rare_process_by_host_linux.json
@@ -1,65 +1,31 @@
{
"description": "Security: Linux - Looks for processes that are unusual to a particular Linux host. Such unusual processes may indicate unauthorized software, malware, or persistence mechanisms.",
- "groups": [
- "auditbeat",
- "endpoint",
- "linux",
- "process",
- "security"
- ],
+ "groups": ["linux", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "For each host.name, detects rare process.name values.",
+ "detector_description": "Detects rare processes for a host.",
"function": "rare",
"by_field_name": "process.name",
"partition_field_name": "host.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "256mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "256mb"
},
"data_description": {
"time_field": "@timestamp",
"time_format": "epoch_ms"
},
"custom_settings": {
- "job_tags": {
- "euid": "4002",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-linux-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Process for a Linux Host"
+ "security_app_display_name": "Unusual Process for a Linux Host",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json
index bed522d4e954a..edf6c66a213bd 100755
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json
@@ -2,7 +2,7 @@
"id": "security_network",
"title": "Security: Network",
"description": "Detect anomalous network activity in your ECS-compatible network logs.",
- "type": "network data",
+ "type": "Network data",
"logoFile": "logo.json",
"defaultIndexPattern": "logs-*,filebeat-*,packetbeat-*",
"query": {
@@ -14,7 +14,7 @@
}
}
],
- "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } }
+ "must_not": { "terms": { "_tier": ["data_frozen", "data_cold"] } }
}
},
"jobs": [
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_by_destination_country.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_by_destination_country.json
index 4479fe8f8c662..b19a3f0e27812 100755
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_by_destination_country.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_by_destination_country.json
@@ -1,14 +1,11 @@
{
"description": "Security: Network - Looks for an unusually large spike in network activity to one destination country in the network logs. This could be due to unusually large amounts of reconnaissance or enumeration traffic. Data exfiltration activity may also produce such a surge in traffic to a destination country which does not normally appear in network traffic or business work-flows. Malware instances and persistence mechanisms may communicate with command-and-control (C2) infrastructure in their country of origin, which may be an unusual destination country for the source network.",
- "groups": [
- "security",
- "network"
- ],
+ "groups": ["security", "network"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high_non_zero_count by \"destination.geo.country_name\"",
+ "detector_description": "Detects high count by country.",
"function": "high_non_zero_count",
"by_field_name": "destination.geo.country_name",
"detector_index": 0
@@ -19,8 +16,7 @@
"destination.as.organization.name",
"source.ip",
"destination.ip"
- ],
- "model_prune_window": "30d"
+ ]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,6 +27,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-network",
- "security_app_display_name": "Spike in Network Traffic to a Country"
+ "security_app_display_name": "Spike in Network Traffic to a Country",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_denies.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_denies.json
index 984bfea22fa2d..1477e951d3ce9 100755
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_denies.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_denies.json
@@ -1,14 +1,11 @@
{
"description": "Security: Network - Looks for an unusually large spike in network traffic that was denied by network ACLs or firewall rules. Such a burst of denied traffic is usually either 1) a misconfigured application or firewall or 2) suspicious or malicious activity. Unsuccessful attempts at network transit, in order to connect to command-and-control (C2), or engage in data exfiltration, may produce a burst of failed connections. This could also be due to unusually large amounts of reconnaissance or enumeration traffic. Denial-of-service attacks or traffic floods may also produce such a surge in traffic.",
- "groups": [
- "security",
- "network"
- ],
+ "groups": ["security", "network"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high_count",
+ "detector_description": "Detects high count of network denies.",
"function": "high_count",
"detector_index": 0
}
@@ -18,8 +15,7 @@
"destination.as.organization.name",
"source.ip",
"destination.port"
- ],
- "model_prune_window": "30d"
+ ]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -30,6 +26,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-network",
- "security_app_display_name": "Spike in Firewall Denies"
+ "security_app_display_name": "Spike in Firewall Denies",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_events.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_events.json
index ba740d581a27e..81b516204fbc1 100755
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_events.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/high_count_network_events.json
@@ -1,14 +1,11 @@
{
"description": "Security: Network - Looks for an unusually large spike in network traffic. Such a burst of traffic, if not caused by a surge in business activity, can be due to suspicious or malicious activity. Large-scale data exfiltration may produce a burst of network traffic; this could also be due to unusually large amounts of reconnaissance or enumeration traffic. Denial-of-service attacks or traffic floods may also produce such a surge in traffic.",
- "groups": [
- "security",
- "network"
- ],
+ "groups": ["security", "network"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high_count",
+ "detector_description": "Detects high count of network events.",
"function": "high_count",
"detector_index": 0
}
@@ -18,8 +15,7 @@
"destination.as.organization.name",
"source.ip",
"destination.ip"
- ],
- "model_prune_window": "30d"
+ ]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -30,6 +26,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-network",
- "security_app_display_name": "Spike in Network Traffic"
+ "security_app_display_name": "Spike in Network Traffic",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/rare_destination_country.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/rare_destination_country.json
index 123b802c475fb..4b8799d65b746 100755
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/rare_destination_country.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/ml/rare_destination_country.json
@@ -1,14 +1,11 @@
{
"description": "Security: Network - looks for an unusual destination country name in the network logs. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload from a server in a country which does not normally appear in network traffic or business work-flows. Malware instances and persistence mechanisms may communicate with command-and-control (C2) infrastructure in their country of origin, which may be an unusual destination country for the source network.",
- "groups": [
- "security",
- "network"
- ],
+ "groups": ["security", "network"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare by \"destination.geo.country_name\"",
+ "detector_description": "Detects rare country names.",
"function": "rare",
"by_field_name": "destination.geo.country_name",
"detector_index": 0
@@ -30,6 +27,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-network",
- "security_app_display_name": "Network Traffic to Rare Destination Country"
+ "security_app_display_name": "Network Traffic to Rare Destination Country",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/manifest.json
index f7a65d0137f26..799363b8fbac1 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/manifest.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/manifest.json
@@ -1,16 +1,14 @@
{
"id": "security_packetbeat",
"title": "Security: Packetbeat",
- "description": "Detect suspicious network activity in Packetbeat data.",
+ "description": "Detect suspicious activity in Packetbeat data.",
"type": "Packetbeat data",
"logoFile": "logo.json",
- "defaultIndexPattern": "packetbeat-*",
+ "defaultIndexPattern": "packetbeat-*,logs-*",
"query": {
"bool": {
- "filter": [
- {"term": {"agent.type": "packetbeat"}}
- ],
- "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } }
+ "filter": [{ "term": { "agent.type": "packetbeat" } }],
+ "must_not": { "terms": { "_tier": ["data_frozen", "data_cold"] } }
}
},
"jobs": [
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_dns_tunneling.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_dns_tunneling.json
index 449c8af238b56..334435732a07e 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_dns_tunneling.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_dns_tunneling.json
@@ -1,18 +1,16 @@
{
"job_id": "JOB_ID",
- "indices": [
- "INDEX_PATTERN_NAME"
- ],
+ "indices": ["INDEX_PATTERN_NAME"],
"max_empty_searches": 10,
"query": {
"bool": {
- "filter": [
- {"term": {"event.dataset": "dns"}},
- {"term": {"agent.type": "packetbeat"}}
+ "filter": [{ "term": { "agent.type": "packetbeat" } }],
+ "should": [
+ { "term": { "event.dataset": "dns" } },
+ { "term": { "event.dataset": "network_traffic.dns" } }
],
- "must_not": [
- {"bool": {"filter": {"term": {"destination.ip": "169.254.169.254"}}}}
- ]
+ "minimum_should_match": 1,
+ "must_not": [{ "bool": { "filter": { "term": { "destination.ip": "169.254.169.254" } } } }]
}
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_dns_question.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_dns_question.json
index 3a4055eb55ba0..fe87d86ee352f 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_dns_question.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_dns_question.json
@@ -1,18 +1,16 @@
{
"job_id": "JOB_ID",
- "indices": [
- "INDEX_PATTERN_NAME"
- ],
+ "indices": ["INDEX_PATTERN_NAME"],
"max_empty_searches": 10,
"query": {
"bool": {
- "filter": [
- {"term": {"event.dataset": "dns"}},
- {"term": {"agent.type": "packetbeat"}}
+ "filter": [{ "term": { "agent.type": "packetbeat" } }],
+ "should": [
+ { "term": { "event.dataset": "dns" } },
+ { "term": { "event.dataset": "network_traffic.dns" } }
],
- "must_not": [
- {"bool": {"filter": {"term": {"dns.question.type": "PTR"}}}}
- ]
+ "minimum_should_match": 1,
+ "must_not": [{ "bool": { "filter": { "term": { "dns.question.type": "PTR" } } } }]
}
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_user_agent.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_user_agent.json
index 5986c326ea80f..79a297595d8d7 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_user_agent.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/datafeed_packetbeat_rare_user_agent.json
@@ -1,18 +1,16 @@
{
"job_id": "JOB_ID",
- "indices": [
- "INDEX_PATTERN_NAME"
- ],
+ "indices": ["INDEX_PATTERN_NAME"],
"max_empty_searches": 10,
"query": {
"bool": {
- "filter": [
- {"term": {"event.dataset": "http"}},
- {"term": {"agent.type": "packetbeat"}}
+ "filter": [{ "term": { "agent.type": "packetbeat" } }],
+ "should": [
+ { "term": { "event.dataset": "http" } },
+ { "term": { "event.dataset": "network_traffic.http" } }
],
- "must_not": [
- {"wildcard": {"user_agent.original": {"value": "Mozilla*"}}}
- ]
+ "minimum_should_match": 1,
+ "must_not": [{ "wildcard": { "user_agent.original": { "value": "Mozilla*" } } }]
}
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_dns_tunneling.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_dns_tunneling.json
index 313bd8e1bea39..54b8ddf2e7a14 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_dns_tunneling.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_dns_tunneling.json
@@ -1,23 +1,17 @@
{
"description": "Security: Packetbeat - Looks for unusual DNS activity that could indicate command-and-control or data exfiltration activity.",
- "groups": [
- "security",
- "packetbeat",
- "dns"
- ],
+ "groups": ["security", "packetbeat", "dns"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "high_info_content(\"dns.question.name\") over tld",
+ "detector_description": "Detects high info content of DNS questions over a population of TLDs.",
"function": "high_info_content",
"field_name": "dns.question.name",
"over_field_name": "dns.question.etld_plus_one",
"custom_rules": [
{
- "actions": [
- "skip_result"
- ],
+ "actions": ["skip_result"],
"conditions": [
{
"applies_to": "actual",
@@ -29,12 +23,7 @@
]
}
],
- "influencers": [
- "destination.ip",
- "host.name",
- "dns.question.etld_plus_one"
- ],
- "model_prune_window": "30d"
+ "influencers": ["destination.ip", "host.name", "dns.question.etld_plus_one"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -45,12 +34,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-packetbeat",
- "custom_urls": [
- {
- "url_name": "Host Details",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "DNS Tunneling"
+ "security_app_display_name": "DNS Tunneling",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_dns_question.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_dns_question.json
index 36c8b3acd722e..049d4e3babd23 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_dns_question.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_dns_question.json
@@ -1,22 +1,16 @@
{
"description": "Security: Packetbeat - Looks for unusual DNS activity that could indicate command-and-control activity.",
- "groups": [
- "security",
- "packetbeat",
- "dns"
- ],
+ "groups": ["security", "packetbeat", "dns"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare by \"dns.question.name\"",
+ "detector_description": "Detects rare DNS question names.",
"function": "rare",
"by_field_name": "dns.question.name"
}
],
- "influencers": [
- "host.name"
- ]
+ "influencers": ["host.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -27,12 +21,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-packetbeat",
- "custom_urls": [
- {
- "url_name": "Host Details",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual DNS Activity"
+ "security_app_display_name": "Unusual DNS Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_server_domain.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_server_domain.json
index 3f3c137e8fd34..d8df5c4986b99 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_server_domain.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_server_domain.json
@@ -1,24 +1,16 @@
{
"description": "Security: Packetbeat - Looks for unusual HTTP or TLS destination domain activity that could indicate execution, persistence, command-and-control or data exfiltration activity.",
- "groups": [
- "security",
- "packetbeat",
- "web"
- ],
+ "groups": ["security", "packetbeat"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare by \"server.domain\"",
+ "detector_description": "Detects rare server domains.",
"function": "rare",
"by_field_name": "server.domain"
}
],
- "influencers": [
- "host.name",
- "destination.ip",
- "source.ip"
- ]
+ "influencers": ["host.name", "destination.ip", "source.ip"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -29,12 +21,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-packetbeat",
- "custom_urls": [
- {
- "url_name": "Host Details",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Network Destination Domain Name"
+ "security_app_display_name": "Unusual Network Destination Domain Name",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_urls.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_urls.json
index afa430bd835f2..055204dd1c376 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_urls.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_urls.json
@@ -1,23 +1,16 @@
{
"description": "Security: Packetbeat - Looks for unusual web browsing URL activity that could indicate execution, persistence, command-and-control or data exfiltration activity.",
- "groups": [
- "security",
- "packetbeat",
- "web"
- ],
+ "groups": ["security", "packetbeat"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare by \"url.full\"",
+ "detector_description": "Detects rare URLs.",
"function": "rare",
"by_field_name": "url.full"
}
],
- "influencers": [
- "host.name",
- "destination.ip"
- ]
+ "influencers": ["host.name", "destination.ip"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -28,12 +21,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-packetbeat",
- "custom_urls": [
- {
- "url_name": "Host Details",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Web Request"
+ "security_app_display_name": "Unusual Web Request",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_user_agent.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_user_agent.json
index bb2d524b41c1f..c947e4f1d509b 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_user_agent.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_packetbeat/ml/packetbeat_rare_user_agent.json
@@ -1,23 +1,16 @@
{
"description": "Security: Packetbeat - Looks for unusual HTTP user agent activity that could indicate execution, persistence, command-and-control or data exfiltration activity.",
- "groups": [
- "security",
- "packetbeat",
- "web"
- ],
+ "groups": ["security", "packetbeat"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "rare by \"user_agent.original\"",
+ "detector_description": "Detects rare web user agents.",
"function": "rare",
"by_field_name": "user_agent.original"
}
],
- "influencers": [
- "host.name",
- "destination.ip"
- ]
+ "influencers": ["host.name", "destination.ip"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -28,12 +21,8 @@
},
"custom_settings": {
"created_by": "ml-module-security-packetbeat",
- "custom_urls": [
- {
- "url_name": "Host Details",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Web User Agent"
+ "security_app_display_name": "Unusual Web User Agent",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_rare_process_by_host_windows.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_rare_process_by_host_windows.json
index 6b7e5dcf56f1f..38fa9e2e4e904 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_rare_process_by_host_windows.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_rare_process_by_host_windows.json
@@ -1,67 +1,30 @@
{
"description": "Security: Windows - Looks for processes that are unusual to a particular Windows host. Such unusual processes may indicate unauthorized software, malware, or persistence mechanisms.",
- "groups": [
- "endpoint",
- "event-log",
- "process",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "For each host.name, detects rare process.name values.",
+ "detector_description": "Detects rare processes per host.",
"function": "rare",
"by_field_name": "process.name",
"partition_field_name": "host.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "256mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "256mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8001",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Process for a Windows Host"
+ "security_app_display_name": "Unusual Process for a Windows Host",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_network_activity.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_network_activity.json
index 04ee9912c15e3..2e04fa91be336 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_network_activity.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_network_activity.json
@@ -1,66 +1,29 @@
{
"description": "Security: Windows - Looks for unusual processes using the network which could indicate command-and-control, lateral movement, persistence, or data exfiltration activity.",
- "groups": [
- "endpoint",
- "network",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.name values.",
+ "detector_description": "Detects rare processes.",
"function": "rare",
"by_field_name": "process.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name",
- "destination.ip"
- ]
+ "influencers": ["host.name", "process.name", "user.name", "destination.ip"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "64mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "64mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8003",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Windows Network Activity"
+ "security_app_display_name": "Unusual Windows Network Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_path_activity.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_path_activity.json
index d5c931b3c46e8..c9f0579309c6b 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_path_activity.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_path_activity.json
@@ -1,65 +1,29 @@
{
"description": "Security: Windows - Looks for activity in unusual paths that may indicate execution of malware or persistence mechanisms. Windows payloads often execute from user profile paths.",
- "groups": [
- "endpoint",
- "network",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.working_directory values.",
+ "detector_description": "Detects rare working directories.",
"function": "rare",
"by_field_name": "process.working_directory",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "256mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "256mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8004",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Windows Path Activity"
+ "security_app_display_name": "Unusual Windows Path Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_all_hosts.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_all_hosts.json
index 1474763cec7b9..08baa6587f9ff 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_all_hosts.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_all_hosts.json
@@ -1,66 +1,29 @@
{
"description": "Security: Windows - Looks for processes that are unusual to all Windows hosts. Such unusual processes may indicate execution of unauthorized software, malware, or persistence mechanisms.",
- "groups": [
- "endpoint",
- "event-log",
- "process",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.executable values.",
+ "detector_description": "Detects rare process executable values.",
"function": "rare",
- "by_field_name": "process.executable",
+ "by_field_name": "process.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "256mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "256mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8002",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Anomalous Process for a Windows Population"
+ "security_app_display_name": "Anomalous Process for a Windows Population",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_creation.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_creation.json
index 2966630fad878..1bf46c2d416a9 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_creation.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_process_creation.json
@@ -1,67 +1,30 @@
{
"description": "Security: Windows - Looks for unusual process relationships which may indicate execution of malware or persistence mechanisms.",
- "groups": [
- "endpoint",
- "event-log",
- "process",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "For each process.parent.name, detects rare process.name values.",
+ "detector_description": "Detects rare processes per parent process.",
"function": "rare",
"by_field_name": "process.name",
"partition_field_name": "process.parent.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "256mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "256mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8005",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Anomalous Windows Process Creation"
+ "security_app_display_name": "Anomalous Windows Process Creation",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_script.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_script.json
index b01641b2ef3ad..5472ad77e1b70 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_script.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_script.json
@@ -1,28 +1,17 @@
{
"description": "Security: Windows - Looks for unusual powershell scripts that may indicate execution of malware, or persistence mechanisms.",
- "groups": [
- "endpoint",
- "event-log",
- "process",
- "windows",
- "winlogbeat",
- "powershell",
- "security"
- ],
+ "groups": ["windows", "powershell", "security"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects high information content in powershell.file.script_block_text values.",
+ "detector_description": "Detects high information content in powershell scripts.",
"function": "high_info_content",
- "field_name": "powershell.file.script_block_text"
+ "field_name": "powershell.file.script_block_text",
+ "detector_index": 0
}
],
- "influencers": [
- "host.name",
- "user.name",
- "file.path"
- ]
+ "influencers": ["host.name", "user.name", "file.path"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -32,24 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8006",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by user name",
- "url_value": "siem#/ml-hosts/$host.name$?_g=()&kqlQuery=(filterQuery:(expression:'user.name%20:%20%22$user.name$%22',kind:kuery),queryLocation:hosts.details,type:details)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "siem#/ml-hosts?_g=()&kqlQuery=(filterQuery:(expression:'user.name%20:%20%22$user.name$%22',kind:kuery),queryLocation:hosts.page,type:page)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Suspicious Powershell Script"
+ "security_app_display_name": "Suspicious Powershell Script",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_service.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_service.json
index 9716c8365e317..b2530538a9263 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_service.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_service.json
@@ -1,27 +1,17 @@
{
- "groups": [
- "endpoint",
- "event-log",
- "process",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"description": "Security: Windows - Looks for rare and unusual Windows service names which may indicate execution of unauthorized services, malware, or persistence mechanisms.",
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare winlog.event_data.ServiceName values.",
+ "detector_description": "Detects rare service names.",
"function": "rare",
- "by_field_name": "winlog.event_data.ServiceName"
+ "by_field_name": "winlog.event_data.ServiceName",
+ "detector_index": 0
}
],
- "influencers": [
- "host.name",
- "winlog.event_data.ServiceName"
- ]
+ "influencers": ["host.name", "winlog.event_data.ServiceName"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,20 +21,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8007",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Windows Service"
+ "security_app_display_name": "Unusual Windows Service",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_user_name.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_user_name.json
index eda4b768b5308..659e58cfdba32 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_user_name.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_anomalous_user_name.json
@@ -1,66 +1,29 @@
{
"description": "Security: Windows - Rare and unusual users that are not normally active may indicate unauthorized changes or activity by an unauthorized user which may be credentialed access or lateral movement.",
- "groups": [
- "endpoint",
- "event-log",
- "process",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
"by_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "256mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "256mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8008",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Windows Username"
+ "security_app_display_name": "Unusual Windows Username",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_process.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_process.json
index ab4fd311d6646..953a00a8fff52 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_process.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_process.json
@@ -1,47 +1,29 @@
{
"description": "Security: Windows - Looks for anomalous access to the metadata service by an unusual process. The metadata service may be targeted in order to harvest credentials or user data scripts containing secrets.",
- "groups": [
- "security",
- "endpoint",
- "process",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare process.name values.",
+ "detector_description": "Detects rare process names.",
"function": "rare",
"by_field_name": "process.name",
"detector_index": 0
}
],
- "influencers": [
- "process.name",
- "host.name",
- "user.name"
- ]
+ "influencers": ["process.name", "host.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "32mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "32mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8011",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "security_app_display_name": "Unusual Windows Process Calling the Metadata Service"
+ "security_app_display_name": "Unusual Windows Process Calling the Metadata Service",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_user.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_user.json
index fe8a634d49921..df55cb3d67709 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_user.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_metadata_user.json
@@ -1,46 +1,29 @@
{
"description": "Security: Windows - Looks for anomalous access to the metadata service by an unusual user. The metadata service may be targeted in order to harvest credentials or user data scripts containing secrets.",
- "groups": [
- "endpoint",
- "process",
- "security",
- "sysmon",
- "windows",
- "winlogbeat"
- ],
+ "groups": ["security", "windows"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
"by_field_name": "user.name",
"detector_index": 0
}
],
- "influencers": [
- "host.name",
- "user.name"
- ]
+ "influencers": ["host.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
- "model_memory_limit": "32mb",
- "categorization_examples_limit": 4
+ "model_memory_limit": "32mb"
},
"data_description": {
- "time_field": "@timestamp",
- "time_format": "epoch_ms"
+ "time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8012",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "security_app_display_name": "Unusual Windows User Calling the Metadata Service"
+ "security_app_display_name": "Unusual Windows User Calling the Metadata Service",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_runas_event.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_runas_event.json
index b95aa1144f440..87d9d4b172f63 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_runas_event.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_runas_event.json
@@ -1,27 +1,16 @@
{
"description": "Security: Windows - Unusual user context switches can be due to privilege escalation.",
- "groups": [
- "endpoint",
- "event-log",
- "security",
- "windows",
- "winlogbeat",
- "authentication"
- ],
+ "groups": ["security", "windows", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
"by_field_name": "user.name"
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +20,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8009",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Windows User Privilege Elevation Activity"
+ "security_app_display_name": "Unusual Windows User Privilege Elevation Activity",
+ "managed": true,
+ "job_revision": 4
}
}
diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_type10_remote_login.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_type10_remote_login.json
index a6ec19401190f..e118f761453be 100644
--- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_type10_remote_login.json
+++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/ml/v3_windows_rare_user_type10_remote_login.json
@@ -1,27 +1,16 @@
{
"description": "Security: Windows - Unusual RDP (remote desktop protocol) user logins can indicate account takeover or credentialed access.",
- "groups": [
- "endpoint",
- "event-log",
- "security",
- "windows",
- "winlogbeat",
- "authentication"
- ],
+ "groups": ["security", "windows", "authentication"],
"analysis_config": {
"bucket_span": "15m",
"detectors": [
{
- "detector_description": "Detects rare user.name values.",
+ "detector_description": "Detects rare usernames.",
"function": "rare",
"by_field_name": "user.name"
}
],
- "influencers": [
- "host.name",
- "process.name",
- "user.name"
- ]
+ "influencers": ["host.name", "process.name", "user.name"]
},
"allow_lazy_open": true,
"analysis_limits": {
@@ -31,32 +20,9 @@
"time_field": "@timestamp"
},
"custom_settings": {
- "job_tags": {
- "euid": "8013",
- "maturity": "release",
- "author": "@randomuserid/Elastic",
- "version": "3",
- "updated_date": "5/16/2022"
- },
"created_by": "ml-module-security-windows-v3",
- "custom_urls": [
- {
- "url_name": "Host Details by process name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Host Details by user name",
- "url_value": "security/hosts/ml-hosts/$host.name$?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by process name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'process.name%20:%20%22$process.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- },
- {
- "url_name": "Hosts Overview by user name",
- "url_value": "security/hosts/ml-hosts?_g=()&query=(query:'user.name%20:%20%22$user.name$%22',language:kuery)&timerange=(global:(linkTo:!(timeline),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')),timeline:(linkTo:!(global),timerange:(from:'$earliest$',kind:absolute,to:'$latest$')))"
- }
- ],
- "security_app_display_name": "Unusual Windows Remote User"
+ "security_app_display_name": "Unusual Windows Remote User",
+ "managed": true,
+ "job_revision": 4
}
}
From 069324a823b2f7e2306c68ab81f913e9fd80472b Mon Sep 17 00:00:00 2001
From: Navarone Feekery <13634519+navarone-feekery@users.noreply.github.com>
Date: Mon, 24 Apr 2023 15:59:36 +0200
Subject: [PATCH 07/13] [Enterprise Search] Use caching for filtered config
fields (#155608)
Moves the configurable fields filtering to the logic file so it can make
use of caching.
---
.../connector_configuration_form.tsx | 28 +-
.../connector_configuration_logic.test.ts | 348 +++++++++++++++++-
.../connector_configuration_logic.ts | 29 +-
3 files changed, 376 insertions(+), 29 deletions(-)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_form.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_form.tsx
index 7627c5c869469..2c40eb0beafa4 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_form.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_form.tsx
@@ -24,16 +24,12 @@ import {
import { i18n } from '@kbn/i18n';
import { Status } from '../../../../../../common/types/api';
-import { DependencyLookup, DisplayType } from '../../../../../../common/types/connectors';
+import { DisplayType } from '../../../../../../common/types/connectors';
import { ConnectorConfigurationApiLogic } from '../../../api/connector/update_connector_configuration_api_logic';
import { ConnectorConfigurationField } from './connector_configuration_field';
-import {
- ConfigEntry,
- ConnectorConfigurationLogic,
- dependenciesSatisfied,
-} from './connector_configuration_logic';
+import { ConnectorConfigurationLogic } from './connector_configuration_logic';
export const ConnectorConfigurationForm = () => {
const { status } = useValues(ConnectorConfigurationApiLogic);
@@ -41,20 +37,6 @@ export const ConnectorConfigurationForm = () => {
const { localConfigView } = useValues(ConnectorConfigurationLogic);
const { saveConfig, setIsEditing } = useActions(ConnectorConfigurationLogic);
- const dependencyLookup: DependencyLookup = localConfigView.reduce(
- (prev: Record
, configEntry: ConfigEntry) => ({
- ...prev,
- [configEntry.key]: configEntry.value,
- }),
- {}
- );
-
- const filteredConfigView = localConfigView.filter(
- (configEntry) =>
- configEntry.ui_restrictions.length <= 0 &&
- dependenciesSatisfied(configEntry.depends_on, dependencyLookup)
- );
-
return (
{
@@ -63,7 +45,7 @@ export const ConnectorConfigurationForm = () => {
}}
component="form"
>
- {filteredConfigView.map((configEntry, index) => {
+ {localConfigView.map((configEntry, index) => {
const {
default_value: defaultValue,
depends_on: dependencies,
@@ -94,8 +76,8 @@ export const ConnectorConfigurationForm = () => {
if (dependencies.length > 0) {
// dynamic spacing without CSS
- const previousField = filteredConfigView[index - 1];
- const nextField = filteredConfigView[index + 1];
+ const previousField = localConfigView[index - 1];
+ const nextField = localConfigView[index + 1];
const topSpacing =
!previousField || previousField.depends_on.length <= 0 ? : <>>;
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.test.ts
index 64e7d1af9c999..f87d73b882ecd 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.test.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.test.ts
@@ -154,7 +154,7 @@ describe('ConnectorConfigurationLogic', () => {
});
});
describe('setLocalConfigEntry', () => {
- it('should set local config entry and sort keys', () => {
+ it('should set local config entry, and sort and filter keys', () => {
ConnectorConfigurationLogic.actions.setConfigState({
bar: {
default_value: '',
@@ -182,6 +182,77 @@ describe('ConnectorConfigurationLogic', () => {
ui_restrictions: [],
value: 'fourthBar',
},
+ restricted: {
+ default_value: '',
+ depends_on: [],
+ display: DisplayType.TEXTBOX,
+ label: 'Restricted',
+ options: [],
+ order: 3,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: ['advanced'],
+ value: 'I am restricted',
+ },
+ shownDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'foofoo' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 4,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (one dependency)',
+ },
+ shownDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'foofoo' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 1',
+ options: [],
+ order: 5,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (multiple dependencies)',
+ },
+ hiddenDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'fafa' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 2',
+ options: [],
+ order: 6,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (one dependency)',
+ },
+ hiddenDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'fafa' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 7,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (multiple dependencies)',
+ },
});
ConnectorConfigurationLogic.actions.setLocalConfigState({
bar: {
@@ -210,6 +281,77 @@ describe('ConnectorConfigurationLogic', () => {
ui_restrictions: [],
value: 'fourthBar',
},
+ restricted: {
+ default_value: '',
+ depends_on: [],
+ display: DisplayType.TEXTBOX,
+ label: 'Restricted',
+ options: [],
+ order: 3,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: ['advanced'],
+ value: 'I am restricted',
+ },
+ shownDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'foofoo' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 4,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (one dependency)',
+ },
+ shownDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'foofoo' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 1',
+ options: [],
+ order: 5,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (multiple dependencies)',
+ },
+ hiddenDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'fafa' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 2',
+ options: [],
+ order: 6,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (one dependency)',
+ },
+ hiddenDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'fafa' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 7,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (multiple dependencies)',
+ },
});
ConnectorConfigurationLogic.actions.setLocalConfigEntry({
default_value: '',
@@ -254,6 +396,77 @@ describe('ConnectorConfigurationLogic', () => {
ui_restrictions: [],
value: 'fourthBar',
},
+ restricted: {
+ default_value: '',
+ depends_on: [],
+ display: DisplayType.TEXTBOX,
+ label: 'Restricted',
+ options: [],
+ order: 3,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: ['advanced'],
+ value: 'I am restricted',
+ },
+ shownDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'foofoo' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 4,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (one dependency)',
+ },
+ shownDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'foofoo' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 1',
+ options: [],
+ order: 5,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (multiple dependencies)',
+ },
+ hiddenDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'fafa' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 2',
+ options: [],
+ order: 6,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (one dependency)',
+ },
+ hiddenDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'fafa' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 7,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (multiple dependencies)',
+ },
},
configView: [
{
@@ -284,6 +497,37 @@ describe('ConnectorConfigurationLogic', () => {
ui_restrictions: [],
value: 'fourthBar',
},
+ {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'foofoo' }],
+ display: DisplayType.TEXTBOX,
+ key: 'shownDependent1',
+ label: 'Shown Dependent',
+ options: [],
+ order: 4,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (one dependency)',
+ },
+ {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'foofoo' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ key: 'shownDependent2',
+ label: 'Shown Dependent 1',
+ options: [],
+ order: 5,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (multiple dependencies)',
+ },
],
localConfigState: {
bar: {
@@ -312,6 +556,77 @@ describe('ConnectorConfigurationLogic', () => {
ui_restrictions: [],
value: 'fourthBar',
},
+ restricted: {
+ default_value: '',
+ depends_on: [],
+ display: DisplayType.TEXTBOX,
+ label: 'Restricted',
+ options: [],
+ order: 3,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: ['advanced'],
+ value: 'I am restricted',
+ },
+ shownDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'foofoo' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 4,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (one dependency)',
+ },
+ shownDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'foofoo' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 1',
+ options: [],
+ order: 5,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should appear (multiple dependencies)',
+ },
+ hiddenDependent1: {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'fafa' }],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent 2',
+ options: [],
+ order: 6,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (one dependency)',
+ },
+ hiddenDependent2: {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'fafa' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ label: 'Shown Dependent',
+ options: [],
+ order: 7,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (multiple dependencies)',
+ },
},
localConfigView: [
{
@@ -342,6 +657,37 @@ describe('ConnectorConfigurationLogic', () => {
ui_restrictions: [],
value: 'fourthBar',
},
+ {
+ default_value: '',
+ depends_on: [{ field: 'bar', value: 'fafa' }],
+ display: DisplayType.TEXTBOX,
+ key: 'hiddenDependent1',
+ label: 'Shown Dependent 2',
+ options: [],
+ order: 6,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (one dependency)',
+ },
+ {
+ default_value: '',
+ depends_on: [
+ { field: 'bar', value: 'fafa' },
+ { field: 'password', value: 'fourthBar' },
+ ],
+ display: DisplayType.TEXTBOX,
+ key: 'hiddenDependent2',
+ label: 'Shown Dependent',
+ options: [],
+ order: 7,
+ required: false,
+ sensitive: true,
+ tooltip: '',
+ ui_restrictions: [],
+ value: 'I should hide (multiple dependencies)',
+ },
],
});
});
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.ts
index 84b0fd4d23fdb..861ab90079229 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_configuration_logic.ts
@@ -72,12 +72,17 @@ export interface ConfigEntry {
/**
*
- * Sorts the connector configuration by specified order (if present)
+ * Sorts and filters the connector configuration
+ *
+ * Sorting is done by specified order (if present)
* otherwise by alphabetic order of keys
*
+ * Filtering is done on any fields with ui_restrictions
+ * or that have not had their dependencies met
+ *
*/
-function sortConnectorConfiguration(config: ConnectorConfiguration): ConfigEntry[] {
- return Object.keys(config)
+function sortAndFilterConnectorConfiguration(config: ConnectorConfiguration): ConfigEntry[] {
+ const sortedConfig = Object.keys(config)
.map(
(key) =>
({
@@ -98,6 +103,20 @@ function sortConnectorConfiguration(config: ConnectorConfiguration): ConfigEntry
}
return a.key.localeCompare(b.key);
});
+
+ const dependencyLookup: DependencyLookup = sortedConfig.reduce(
+ (prev: Record, configEntry: ConfigEntry) => ({
+ ...prev,
+ [configEntry.key]: configEntry.value,
+ }),
+ {}
+ );
+
+ return sortedConfig.filter(
+ (configEntry) =>
+ configEntry.ui_restrictions.length <= 0 &&
+ dependenciesSatisfied(configEntry.depends_on, dependencyLookup)
+ );
}
export function ensureStringType(value: string | number | boolean | null): string {
@@ -280,11 +299,11 @@ export const ConnectorConfigurationLogic = kea<
selectors: ({ selectors }) => ({
configView: [
() => [selectors.configState],
- (configState: ConnectorConfiguration) => sortConnectorConfiguration(configState),
+ (configState: ConnectorConfiguration) => sortAndFilterConnectorConfiguration(configState),
],
localConfigView: [
() => [selectors.localConfigState],
- (configState) => sortConnectorConfiguration(configState),
+ (configState) => sortAndFilterConnectorConfiguration(configState),
],
}),
});
From 54457b074a20da8017de03feb9ebfbe0fe6450d3 Mon Sep 17 00:00:00 2001
From: Carlos Crespo
Date: Mon, 24 Apr 2023 11:13:57 -0300
Subject: [PATCH 08/13] [Infrastructure UI] Plot metric charts data based on
current page items (#155249)
closes [#152186](https://github.com/elastic/kibana/issues/152186)
## Summary
This PR makes the metric charts show data for the hosts on the current
page. With this change, the charts will **only** load after the table
has finished loading its data - or after Snapshot API has responded
It also changes the current behavior of the table pagination and
sorting. Instead of relying on the `EuiInMemoryTable` the pagination and
sorting are done manually, and the EuiInMemoryTable has been replaced by
the `EuiBasicTable`.
The loading indicator has also been replaced.
Paginating and sorting:
https://user-images.githubusercontent.com/2767137/233161166-2bd719e1-7259-4ecc-96a7-50493bc6c0a3.mov
Open in lens
https://user-images.githubusercontent.com/2767137/233161134-621afd76-44b5-42ab-b58c-7f51ef944ac2.mov
### How to test
- Go to Hosts view
- Paginate and sort the table data
- Select a page size and check if the select has been stored in the
localStorage (`hostsView:pageSizeSelection` key)
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
---
.../hosts/components/chart/chart_loader.tsx | 58 ++++++
.../hosts/components/chart/lens_wrapper.tsx | 87 ++++----
.../components/chart/metric_chart_wrapper.tsx | 53 ++---
.../metadata/metadata.test.tsx | 42 +---
.../hosts/components/hosts_container.tsx | 33 +--
.../metrics/hosts/components/hosts_table.tsx | 127 +++++-------
.../hosts/components/kpis/kpi_grid.tsx | 5 +-
.../metrics/hosts/components/kpis/tile.tsx | 15 +-
.../components/tabs/logs/logs_tab_content.tsx | 5 +-
.../components/tabs/metrics/metric_chart.tsx | 63 ++++--
.../public/pages/metrics/hosts/constants.ts | 3 +
.../hosts/hooks/use_after_loaded_state.ts | 26 +++
.../metrics/hosts/hooks/use_alerts_query.ts | 2 +-
.../hosts/hooks/use_hosts_table.test.ts | 192 +++++++++---------
.../metrics/hosts/hooks/use_hosts_table.tsx | 112 ++++++++--
.../hosts/hooks/use_hosts_table_url_state.ts | 94 +++++++++
.../hooks/use_table_properties_url_state.ts | 62 ------
.../infra/public/pages/metrics/hosts/utils.ts | 17 +-
.../test/functional/apps/infra/hosts_view.ts | 83 ++++++++
.../page_objects/infra_hosts_view.ts | 47 +++++
20 files changed, 716 insertions(+), 410 deletions(-)
create mode 100644 x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/chart_loader.tsx
create mode 100644 x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_after_loaded_state.ts
create mode 100644 x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table_url_state.ts
delete mode 100644 x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_table_properties_url_state.ts
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/chart_loader.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/chart_loader.tsx
new file mode 100644
index 0000000000000..bbddb338ef73f
--- /dev/null
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/chart_loader.tsx
@@ -0,0 +1,58 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { EuiFlexGroup, EuiProgress, EuiFlexItem, EuiLoadingChart, useEuiTheme } from '@elastic/eui';
+import { css } from '@emotion/react';
+import { euiStyled } from '@kbn/kibana-react-plugin/common';
+
+export const ChartLoader = ({
+ children,
+ loading,
+ style,
+ loadedOnce = false,
+ hasTitle = false,
+}: {
+ style?: React.CSSProperties;
+ children: React.ReactNode;
+ loadedOnce: boolean;
+ loading: boolean;
+ hasTitle?: boolean;
+}) => {
+ const { euiTheme } = useEuiTheme();
+ return (
+
+ {loading && (
+
+ )}
+ {loading && !loadedOnce ? (
+
+
+
+
+
+ ) : (
+ children
+ )}
+
+ );
+};
+
+const LoaderContainer = euiStyled.div`
+ position: relative;
+ border-radius: ${({ theme }) => theme.eui.euiSizeS};
+ overflow: hidden;
+ height: 100%;
+`;
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/lens_wrapper.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/lens_wrapper.tsx
index 9985db0751fd4..9a2472949f54c 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/lens_wrapper.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/lens_wrapper.tsx
@@ -4,18 +4,16 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState, useRef } from 'react';
import { Action } from '@kbn/ui-actions-plugin/public';
import { ViewMode } from '@kbn/embeddable-plugin/public';
import { BrushTriggerEvent } from '@kbn/charts-plugin/public';
-import { EuiFlexGroup } from '@elastic/eui';
-import { EuiFlexItem } from '@elastic/eui';
-import { EuiLoadingChart } from '@elastic/eui';
import { Filter, Query, TimeRange } from '@kbn/es-query';
import { useKibanaContextForPlugin } from '../../../../../hooks/use_kibana';
import { useIntersectedOnce } from '../../../../../hooks/use_intersection_once';
import { LensAttributes } from '../../../../../common/visualizations';
+import { ChartLoader } from './chart_loader';
export interface Props {
id: string;
@@ -26,7 +24,10 @@ export interface Props {
extraActions: Action[];
lastReloadRequestTime?: number;
style?: React.CSSProperties;
+ loading?: boolean;
+ hasTitle?: boolean;
onBrushEnd?: (data: BrushTriggerEvent['data']) => void;
+ onLoad?: () => void;
}
export const LensWrapper = ({
@@ -39,12 +40,19 @@ export const LensWrapper = ({
style,
onBrushEnd,
lastReloadRequestTime,
+ loading = false,
+ hasTitle = false,
}: Props) => {
- const intersectionRef = React.useRef(null);
+ const intersectionRef = useRef(null);
+ const [loadedOnce, setLoadedOnce] = useState(false);
+
+ const [state, setState] = useState({
+ lastReloadRequestTime,
+ query,
+ filters,
+ dateRange,
+ });
- const [currentLastReloadRequestTime, setCurrentLastReloadRequestTime] = useState<
- number | undefined
- >(lastReloadRequestTime);
const {
services: { lens },
} = useKibanaContextForPlugin();
@@ -56,38 +64,49 @@ export const LensWrapper = ({
useEffect(() => {
if ((intersection?.intersectionRatio ?? 0) === 1) {
- setCurrentLastReloadRequestTime(lastReloadRequestTime);
+ setState({
+ lastReloadRequestTime,
+ query,
+ dateRange,
+ filters,
+ });
}
- }, [intersection?.intersectionRatio, lastReloadRequestTime]);
+ }, [dateRange, filters, intersection?.intersectionRatio, lastReloadRequestTime, query]);
const isReady = attributes && intersectedOnce;
return (
- {!isReady ? (
-
-
-
-
-
- ) : (
-
- )}
+
+ {isReady && (
+ {
+ if (!loadedOnce) {
+ setLoadedOnce(true);
+ }
+ }}
+ />
+ )}
+
);
};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/metric_chart_wrapper.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/metric_chart_wrapper.tsx
index 9df937983ae1e..8d78906bd03e9 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/metric_chart_wrapper.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/chart/metric_chart_wrapper.tsx
@@ -14,16 +14,11 @@ import {
} from '@elastic/charts';
import { EuiPanel } from '@elastic/eui';
import styled from 'styled-components';
-import { EuiLoadingChart } from '@elastic/eui';
-import { EuiFlexGroup } from '@elastic/eui';
-import { EuiFlexItem } from '@elastic/eui';
import { EuiToolTip } from '@elastic/eui';
-import { EuiProgress } from '@elastic/eui';
-import { css } from '@emotion/react';
-import { useEuiTheme } from '@elastic/eui';
import type { SnapshotNode, SnapshotNodeMetric } from '../../../../../../common/http_api';
import { createInventoryMetricFormatter } from '../../../inventory_view/lib/create_inventory_metric_formatter';
import type { SnapshotMetricType } from '../../../../../../common/inventory_models/types';
+import { ChartLoader } from './chart_loader';
type MetricType = keyof Pick;
@@ -65,7 +60,6 @@ export const MetricChartWrapper = ({
type,
...props
}: Props) => {
- const { euiTheme } = useEuiTheme();
const loadedOnce = useRef(false);
const metrics = useMemo(() => (nodes ?? [])[0]?.metrics ?? [], [nodes]);
const metricsTimeseries = useMemo(
@@ -109,39 +103,18 @@ export const MetricChartWrapper = ({
return (
-
- {loading && (
-
- )}
- {loading && !loadedOnce.current ? (
-
-
-
-
-
- ) : (
-
-
-
-
-
- )}
-
+
+
+
+
+
+
+
);
};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/metadata/metadata.test.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/metadata/metadata.test.tsx
index 1c6320c142d7a..46392fa8609d1 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/metadata/metadata.test.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/host_details_flyout/metadata/metadata.test.tsx
@@ -32,42 +32,12 @@ const metadataProps: TabProps = {
name: 'host-1',
cloudProvider: 'gcp',
},
- rx: {
- name: 'rx',
- value: 0,
- max: 0,
- avg: 0,
- },
- tx: {
- name: 'tx',
- value: 0,
- max: 0,
- avg: 0,
- },
- memory: {
- name: 'memory',
- value: 0.5445920331099282,
- max: 0.5445920331099282,
- avg: 0.5445920331099282,
- },
- cpu: {
- name: 'cpu',
- value: 0.2000718443867342,
- max: 0.2000718443867342,
- avg: 0.2000718443867342,
- },
- diskLatency: {
- name: 'diskLatency',
- value: null,
- max: 0,
- avg: 0,
- },
- memoryTotal: {
- name: 'memoryTotal',
- value: 16777216,
- max: 16777216,
- avg: 16777216,
- },
+ rx: 0,
+ tx: 0,
+ memory: 0.5445920331099282,
+ cpu: 0.2000718443867342,
+ diskLatency: 0,
+ memoryTotal: 16777216,
},
};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx
index e8e8a8a8e7c4f..0c965feca8e9e 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx
@@ -12,10 +12,11 @@ import { InfraLoadingPanel } from '../../../../components/loading';
import { useMetricsDataViewContext } from '../hooks/use_data_view';
import { UnifiedSearchBar } from './unified_search_bar';
import { HostsTable } from './hosts_table';
-import { HostsViewProvider } from '../hooks/use_hosts_view';
+import { KPIGrid } from './kpis/kpi_grid';
import { Tabs } from './tabs/tabs';
import { AlertsQueryProvider } from '../hooks/use_alerts_query';
-import { KPIGrid } from './kpis/kpi_grid';
+import { HostsViewProvider } from '../hooks/use_hosts_view';
+import { HostsTableProvider } from '../hooks/use_hosts_table';
export const HostContainer = () => {
const { dataView, loading, hasError } = useMetricsDataViewContext();
@@ -38,19 +39,21 @@ export const HostContainer = () => {
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>
);
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx
index ca6f904ceea84..535afe8befff5 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx
@@ -5,93 +5,78 @@
* 2.0.
*/
-import React, { useCallback } from 'react';
-import { EuiInMemoryTable } from '@elastic/eui';
+import React from 'react';
+import { EuiBasicTable } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { isEqual } from 'lodash';
import { NoData } from '../../../../components/empty_states';
-import { InfraLoadingPanel } from '../../../../components/loading';
-import { useHostsTable } from '../hooks/use_hosts_table';
-import { useTableProperties } from '../hooks/use_table_properties_url_state';
+import { HostNodeRow, useHostsTableContext } from '../hooks/use_hosts_table';
import { useHostsViewContext } from '../hooks/use_hosts_view';
import { useUnifiedSearchContext } from '../hooks/use_unified_search';
import { Flyout } from './host_details_flyout/flyout';
+import { DEFAULT_PAGE_SIZE } from '../constants';
-export const HostsTable = () => {
- const { hostNodes, loading } = useHostsViewContext();
- const { onSubmit, searchCriteria } = useUnifiedSearchContext();
- const [properties, setProperties] = useTableProperties();
-
- const { columns, items, isFlyoutOpen, closeFlyout, clickedItem } = useHostsTable(hostNodes, {
- time: searchCriteria.dateRange,
- });
-
- const noData = items.length === 0;
-
- const onTableChange = useCallback(
- ({ page = {}, sort = {} }) => {
- const { index: pageIndex, size: pageSize } = page;
- const { field, direction } = sort;
-
- const sorting = field && direction ? { field, direction } : true;
- const pagination = pageIndex >= 0 && pageSize !== 0 ? { pageIndex, pageSize } : true;
-
- if (!isEqual(properties.sorting, sorting)) {
- setProperties({ sorting });
- }
- if (!isEqual(properties.pagination, pagination)) {
- setProperties({ pagination });
- }
- },
- [setProperties, properties.pagination, properties.sorting]
- );
+const PAGE_SIZE_OPTIONS = [5, 10, 20];
- if (loading) {
- return (
-
- );
- }
+export const HostsTable = () => {
+ const { loading } = useHostsViewContext();
+ const { onSubmit } = useUnifiedSearchContext();
- if (noData) {
- return (
- onSubmit()}
- testString="noMetricsDataPrompt"
- />
- );
- }
+ const {
+ columns,
+ items,
+ currentPage,
+ isFlyoutOpen,
+ closeFlyout,
+ clickedItem,
+ onTableChange,
+ pagination,
+ sorting,
+ } = useHostsTableContext();
return (
<>
- onSubmit()}
+ testString="noMetricsDataPrompt"
+ />
+ )
+ }
/>
{isFlyoutOpen && clickedItem && }
>
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi_grid.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi_grid.tsx
index 968e7462b38f4..2dbd0c4324eca 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi_grid.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi_grid.tsx
@@ -6,11 +6,8 @@
*/
import React from 'react';
-import { EuiFlexGroup } from '@elastic/eui';
-import { EuiFlexItem } from '@elastic/eui';
-
+import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-
import { KPIChartProps, Tile } from './tile';
import { HostsTile } from './hosts_tile';
import { ChartBaseProps } from '../chart/metric_chart_wrapper';
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/tile.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/tile.tsx
index 480e6c415dc45..a95f18b4a10ee 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/tile.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/tile.tsx
@@ -8,13 +8,16 @@ import React from 'react';
import { Action } from '@kbn/ui-actions-plugin/public';
import { BrushTriggerEvent } from '@kbn/charts-plugin/public';
-import { EuiIcon, EuiPanel } from '@elastic/eui';
-import { EuiFlexGroup } from '@elastic/eui';
-import { EuiFlexItem } from '@elastic/eui';
-import { EuiText } from '@elastic/eui';
-import { EuiI18n } from '@elastic/eui';
+import {
+ EuiIcon,
+ EuiPanel,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiText,
+ EuiI18n,
+ EuiToolTip,
+} from '@elastic/eui';
import styled from 'styled-components';
-import { EuiToolTip } from '@elastic/eui';
import { useLensAttributes } from '../../../../../hooks/use_lens_attributes';
import { useMetricsDataViewContext } from '../../hooks/use_data_view';
import { useUnifiedSearchContext } from '../../hooks/use_unified_search';
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/logs/logs_tab_content.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/logs/logs_tab_content.tsx
index 0fad370960f22..d5cc0b0f021d7 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/logs/logs_tab_content.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/logs/logs_tab_content.tsx
@@ -24,7 +24,10 @@ export const LogsTabContent = () => {
const { from, to } = useMemo(() => getDateRangeAsTimestamp(), [getDateRangeAsTimestamp]);
const { hostNodes, loading } = useHostsViewContext();
- const hostsFilterQuery = useMemo(() => createHostsFilter(hostNodes), [hostNodes]);
+ const hostsFilterQuery = useMemo(
+ () => createHostsFilter(hostNodes.map((p) => p.name)),
+ [hostNodes]
+ );
const logsLinkToStreamQuery = useMemo(() => {
const hostsFilterQueryParam = createHostsFilterQueryParam(hostNodes);
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/metric_chart.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/metric_chart.tsx
index 252bea5389e3a..28d07b94d9437 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/metric_chart.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/metric_chart.tsx
@@ -4,20 +4,28 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import React from 'react';
+import React, { useMemo } from 'react';
import { Action } from '@kbn/ui-actions-plugin/public';
import { BrushTriggerEvent } from '@kbn/charts-plugin/public';
-import { EuiIcon, EuiPanel } from '@elastic/eui';
-import { EuiFlexGroup } from '@elastic/eui';
-import { EuiFlexItem } from '@elastic/eui';
-import { EuiText } from '@elastic/eui';
-import { EuiI18n } from '@elastic/eui';
+import {
+ EuiIcon,
+ EuiPanel,
+ EuiI18n,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiText,
+ useEuiTheme,
+} from '@elastic/eui';
+import { css } from '@emotion/react';
import { useLensAttributes } from '../../../../../../hooks/use_lens_attributes';
import { useMetricsDataViewContext } from '../../../hooks/use_data_view';
import { useUnifiedSearchContext } from '../../../hooks/use_unified_search';
import { HostsLensLineChartFormulas } from '../../../../../../common/visualizations';
import { useHostsViewContext } from '../../../hooks/use_hosts_view';
+import { createHostsFilter } from '../../../utils';
+import { useHostsTableContext } from '../../../hooks/use_hosts_table';
import { LensWrapper } from '../../chart/lens_wrapper';
+import { useAfterLoadedState } from '../../../hooks/use_after_loaded_state';
export interface MetricChartProps {
title: string;
@@ -29,9 +37,18 @@ export interface MetricChartProps {
const MIN_HEIGHT = 300;
export const MetricChart = ({ title, type, breakdownSize }: MetricChartProps) => {
+ const { euiTheme } = useEuiTheme();
const { searchCriteria, onSubmit } = useUnifiedSearchContext();
const { dataView } = useMetricsDataViewContext();
- const { baseRequest } = useHostsViewContext();
+ const { baseRequest, loading } = useHostsViewContext();
+ const { currentPage } = useHostsTableContext();
+
+ // prevents updates on requestTs and serchCriteria states from relaoding the chart
+ // we want it to reload only once the table has finished loading
+ const { afterLoadedState } = useAfterLoadedState(loading, {
+ lastReloadRequestTime: baseRequest.requestTs,
+ ...searchCriteria,
+ });
const { attributes, getExtraActions, error } = useLensAttributes({
type,
@@ -43,11 +60,22 @@ export const MetricChart = ({ title, type, breakdownSize }: MetricChartProps) =>
visualizationType: 'lineChart',
});
- const filters = [...searchCriteria.filters, ...searchCriteria.panelFilters];
+ const hostsFilterQuery = useMemo(() => {
+ return createHostsFilter(
+ currentPage.map((p) => p.name),
+ dataView
+ );
+ }, [currentPage, dataView]);
+
+ const filters = [
+ ...afterLoadedState.filters,
+ ...afterLoadedState.panelFilters,
+ ...[hostsFilterQuery],
+ ];
const extraActionOptions = getExtraActions({
- timeRange: searchCriteria.dateRange,
+ timeRange: afterLoadedState.dateRange,
filters,
- query: searchCriteria.query,
+ query: afterLoadedState.query,
});
const extraActions: Action[] = [extraActionOptions.openInLens];
@@ -69,12 +97,15 @@ export const MetricChart = ({ title, type, breakdownSize }: MetricChartProps) =>
hasShadow={false}
hasBorder
paddingSize={error ? 'm' : 'none'}
- style={{ minHeight: MIN_HEIGHT }}
+ css={css`
+ min-height: calc(${MIN_HEIGHT} + ${euiTheme.size.l});
+ position: 'relative';
+ `}
data-test-subj={`hostsView-metricChart-${type}`}
>
{error ? (
attributes={attributes}
style={{ height: MIN_HEIGHT }}
extraActions={extraActions}
- lastReloadRequestTime={baseRequest.requestTs}
- dateRange={searchCriteria.dateRange}
+ lastReloadRequestTime={afterLoadedState.lastReloadRequestTime}
+ dateRange={afterLoadedState.dateRange}
filters={filters}
- query={searchCriteria.query}
+ query={afterLoadedState.query}
onBrushEnd={handleBrushEnd}
+ loading={loading}
+ hasTitle
/>
)}
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/constants.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/constants.ts
index 98aa8a145e3a0..b854120a86887 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/constants.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/constants.ts
@@ -13,6 +13,9 @@ export const ALERT_STATUS_ALL = 'all';
export const TIMESTAMP_FIELD = '@timestamp';
export const DATA_VIEW_PREFIX = 'infra_metrics';
+export const DEFAULT_PAGE_SIZE = 10;
+export const LOCAL_STORAGE_PAGE_SIZE_KEY = 'hostsView:pageSizeSelection';
+
export const ALL_ALERTS: AlertStatusFilter = {
status: ALERT_STATUS_ALL,
label: i18n.translate('xpack.infra.hostsViewPage.tabs.alerts.alertStatusFilter.showAll', {
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_after_loaded_state.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_after_loaded_state.ts
new file mode 100644
index 0000000000000..8c9a84d4402f8
--- /dev/null
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_after_loaded_state.ts
@@ -0,0 +1,26 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { useState, useEffect, useRef } from 'react';
+
+export const useAfterLoadedState = (loading: boolean, state: T) => {
+ const ref = useRef(undefined);
+ const [internalState, setInternalState] = useState(state);
+
+ if (!ref.current || loading !== ref.current) {
+ ref.current = loading;
+ }
+
+ useEffect(() => {
+ if (!loading) {
+ setInternalState(state);
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [ref.current]);
+
+ return { afterLoadedState: internalState };
+};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_alerts_query.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_alerts_query.ts
index 9877d61643721..7a895591d68c7 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_alerts_query.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_alerts_query.ts
@@ -69,7 +69,7 @@ const createAlertsEsQuery = ({
const alertStatusFilter = createAlertStatusFilter(status);
const dateFilter = createDateFilter(dateRange);
- const hostsFilter = createHostsFilter(hostNodes);
+ const hostsFilter = createHostsFilter(hostNodes.map((p) => p.name));
const filters = [alertStatusFilter, dateFilter, hostsFilter].filter(Boolean) as Filter[];
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts
index 4ae8823adaf2e..a921a0daeb011 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts
@@ -8,68 +8,92 @@
import { useHostsTable } from './use_hosts_table';
import { renderHook } from '@testing-library/react-hooks';
import { SnapshotNode } from '../../../../../common/http_api';
+import * as useUnifiedSearchHooks from './use_unified_search';
+import * as useHostsViewHooks from './use_hosts_view';
-describe('useHostTable hook', () => {
- it('it should map the nodes returned from the snapshot api to a format matching eui table items', () => {
- const nodes: SnapshotNode[] = [
+jest.mock('./use_unified_search');
+jest.mock('./use_hosts_view');
+
+const mockUseUnifiedSearchContext =
+ useUnifiedSearchHooks.useUnifiedSearchContext as jest.MockedFunction<
+ typeof useUnifiedSearchHooks.useUnifiedSearchContext
+ >;
+const mockUseHostsViewContext = useHostsViewHooks.useHostsViewContext as jest.MockedFunction<
+ typeof useHostsViewHooks.useHostsViewContext
+>;
+
+const mockHostNode: SnapshotNode[] = [
+ {
+ metrics: [
{
- metrics: [
- {
- name: 'rx',
- avg: 252456.92916666667,
- },
- {
- name: 'tx',
- avg: 252758.425,
- },
- {
- name: 'memory',
- avg: 0.94525,
- },
- {
- name: 'cpu',
- value: 0.6353277777777777,
- },
- {
- name: 'memoryTotal',
- avg: 34359.738368,
- },
- ],
- path: [{ value: 'host-0', label: 'host-0', os: null, cloudProvider: 'aws' }],
- name: 'host-0',
+ name: 'rx',
+ avg: 252456.92916666667,
},
{
- metrics: [
- {
- name: 'rx',
- avg: 95.86339715321859,
- },
- {
- name: 'tx',
- avg: 110.38566859563191,
- },
- {
- name: 'memory',
- avg: 0.5400000214576721,
- },
- {
- name: 'cpu',
- value: 0.8647805555555556,
- },
- {
- name: 'memoryTotal',
- avg: 9.194304,
- },
- ],
- path: [
- { value: 'host-1', label: 'host-1' },
- { value: 'host-1', label: 'host-1', ip: '243.86.94.22', os: 'macOS' },
- ],
- name: 'host-1',
+ name: 'tx',
+ avg: 252758.425,
},
- ];
+ {
+ name: 'memory',
+ avg: 0.94525,
+ },
+ {
+ name: 'cpu',
+ value: 0.6353277777777777,
+ },
+ {
+ name: 'memoryTotal',
+ avg: 34359.738368,
+ },
+ ],
+ path: [{ value: 'host-0', label: 'host-0', os: null, cloudProvider: 'aws' }],
+ name: 'host-0',
+ },
+ {
+ metrics: [
+ {
+ name: 'rx',
+ avg: 95.86339715321859,
+ },
+ {
+ name: 'tx',
+ avg: 110.38566859563191,
+ },
+ {
+ name: 'memory',
+ avg: 0.5400000214576721,
+ },
+ {
+ name: 'cpu',
+ value: 0.8647805555555556,
+ },
+ {
+ name: 'memoryTotal',
+ avg: 9.194304,
+ },
+ ],
+ path: [
+ { value: 'host-1', label: 'host-1' },
+ { value: 'host-1', label: 'host-1', ip: '243.86.94.22', os: 'macOS' },
+ ],
+ name: 'host-1',
+ },
+];
+
+describe('useHostTable hook', () => {
+ beforeAll(() => {
+ mockUseUnifiedSearchContext.mockReturnValue({
+ searchCriteria: {
+ dateRange: { from: 'now-15m', to: 'now' },
+ },
+ } as ReturnType);
- const items = [
+ mockUseHostsViewContext.mockReturnValue({
+ hostNodes: mockHostNode,
+ } as ReturnType);
+ });
+ it('it should map the nodes returned from the snapshot api to a format matching eui table items', () => {
+ const expected = [
{
name: 'host-0',
os: '-',
@@ -79,27 +103,11 @@ describe('useHostTable hook', () => {
cloudProvider: 'aws',
name: 'host-0',
},
- rx: {
- name: 'rx',
- avg: 252456.92916666667,
- },
- tx: {
- name: 'tx',
- avg: 252758.425,
- },
- memory: {
- name: 'memory',
- avg: 0.94525,
- },
- cpu: {
- name: 'cpu',
- value: 0.6353277777777777,
- },
- memoryTotal: {
- name: 'memoryTotal',
-
- avg: 34359.738368,
- },
+ rx: 252456.92916666667,
+ tx: 252758.425,
+ memory: 0.94525,
+ cpu: 0.6353277777777777,
+ memoryTotal: 34359.738368,
},
{
name: 'host-1',
@@ -110,32 +118,16 @@ describe('useHostTable hook', () => {
cloudProvider: null,
name: 'host-1',
},
- rx: {
- name: 'rx',
- avg: 95.86339715321859,
- },
- tx: {
- name: 'tx',
- avg: 110.38566859563191,
- },
- memory: {
- name: 'memory',
- avg: 0.5400000214576721,
- },
- cpu: {
- name: 'cpu',
- value: 0.8647805555555556,
- },
- memoryTotal: {
- name: 'memoryTotal',
- avg: 9.194304,
- },
+ rx: 95.86339715321859,
+ tx: 110.38566859563191,
+ memory: 0.5400000214576721,
+ cpu: 0.8647805555555556,
+ memoryTotal: 9.194304,
},
];
- const time = { from: 'now-15m', to: 'now', interval: '>=1m' };
- const { result } = renderHook(() => useHostsTable(nodes, { time }));
+ const { result } = renderHook(() => useHostsTable());
- expect(result.current.items).toStrictEqual(items);
+ expect(result.current.items).toStrictEqual(expected);
});
});
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx
index 44a492f314c1c..2d2d6c9d7f8e4 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx
@@ -8,8 +8,10 @@
import React, { useCallback, useMemo } from 'react';
import { EuiBasicTableColumn, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { TimeRange } from '@kbn/es-query';
-
+import createContainer from 'constate';
+import { isEqual } from 'lodash';
+import { CriteriaWithPagination } from '@elastic/eui';
+import { isNumber } from 'lodash/fp';
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
import { createInventoryMetricFormatter } from '../../inventory_view/lib/create_inventory_metric_formatter';
import { HostsTableEntryTitle } from '../components/hosts_table_entry_title';
@@ -19,6 +21,9 @@ import type {
SnapshotMetricInput,
} from '../../../../../common/http_api';
import { useHostFlyoutOpen } from './use_host_flyout_open_url_state';
+import { Sorting, useHostsTableProperties } from './use_hosts_table_url_state';
+import { useHostsViewContext } from './use_hosts_view';
+import { useUnifiedSearchContext } from './use_unified_search';
/**
* Columns and items types
@@ -27,7 +32,7 @@ export type CloudProvider = 'gcp' | 'aws' | 'azure' | 'unknownProvider';
type HostMetric = 'cpu' | 'diskLatency' | 'rx' | 'tx' | 'memory' | 'memoryTotal';
-type HostMetrics = Record;
+type HostMetrics = Record;
export interface HostNodeRow extends HostMetrics {
os?: string | null;
@@ -38,10 +43,6 @@ export interface HostNodeRow extends HostMetrics {
id: string;
}
-interface HostTableParams {
- time: TimeRange;
-}
-
/**
* Helper functions
*/
@@ -60,12 +61,41 @@ const buildItemsList = (nodes: SnapshotNode[]) => {
cloudProvider: path.at(-1)?.cloudProvider ?? null,
},
...metrics.reduce((data, metric) => {
- data[metric.name as HostMetric] = metric;
+ data[metric.name as HostMetric] = metric.avg ?? metric.value;
return data;
}, {} as HostMetrics),
})) as HostNodeRow[];
};
+const isTitleColumn = (cell: any): cell is HostNodeRow['title'] => {
+ return typeof cell === 'object' && cell && 'name' in cell;
+};
+
+const sortValues = (aValue: any, bValue: any, { direction }: Sorting) => {
+ if (typeof aValue === 'string' && typeof bValue === 'string') {
+ return direction === 'desc' ? bValue.localeCompare(aValue) : aValue.localeCompare(bValue);
+ }
+
+ if (isNumber(aValue) && isNumber(bValue)) {
+ return direction === 'desc' ? bValue - aValue : aValue - bValue;
+ }
+
+ return 1;
+};
+
+const sortTableData =
+ ({ direction, field }: Sorting) =>
+ (a: HostNodeRow, b: HostNodeRow) => {
+ const aValue = a[field as keyof HostNodeRow];
+ const bValue = b[field as keyof HostNodeRow];
+
+ if (isTitleColumn(aValue) && isTitleColumn(bValue)) {
+ return sortValues(aValue.name, bValue.name, { direction, field });
+ }
+
+ return sortValues(aValue, bValue, { direction, field });
+ };
+
/**
* Columns translations
*/
@@ -120,7 +150,10 @@ const toggleDialogActionLabel = i18n.translate(
/**
* Build a table columns and items starting from the snapshot nodes.
*/
-export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams) => {
+export const useHostsTable = () => {
+ const { hostNodes } = useHostsViewContext();
+ const { searchCriteria } = useUnifiedSearchContext();
+ const [{ pagination, sorting }, setProperties] = useHostsTableProperties();
const {
services: { telemetry },
} = useKibanaContextForPlugin();
@@ -139,12 +172,38 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
[telemetry]
);
- const items = useMemo(() => buildItemsList(nodes), [nodes]);
+ const onTableChange = useCallback(
+ ({ page, sort }: CriteriaWithPagination) => {
+ const { index: pageIndex, size: pageSize } = page;
+ const { field, direction } = sort ?? {};
+
+ const currentSorting = { field: field as keyof HostNodeRow, direction };
+ const currentPagination = { pageIndex, pageSize };
+
+ if (!isEqual(sorting, currentSorting)) {
+ setProperties({ sorting: currentSorting });
+ } else if (!isEqual(pagination, currentPagination)) {
+ setProperties({ pagination: currentPagination });
+ }
+ },
+ [setProperties, pagination, sorting]
+ );
+
+ const items = useMemo(() => buildItemsList(hostNodes), [hostNodes]);
const clickedItem = useMemo(
() => items.find(({ id }) => id === hostFlyoutOpen.clickedItemId),
[hostFlyoutOpen.clickedItemId, items]
);
+ const currentPage = useMemo(() => {
+ const { pageSize = 0, pageIndex = 0 } = pagination;
+
+ const endIndex = (pageIndex + 1) * pageSize;
+ const startIndex = pageIndex * pageSize;
+
+ return items.sort(sortTableData(sorting)).slice(startIndex, endIndex);
+ }, [items, pagination, sorting]);
+
const columns: Array> = useMemo(
() => [
{
@@ -183,7 +242,7 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
render: (title: HostNodeRow['title']) => (
reportHostEntryClick(title)}
/>
),
@@ -197,7 +256,7 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
},
{
name: averageCpuUsageLabel,
- field: 'cpu.avg',
+ field: 'cpu',
sortable: true,
'data-test-subj': 'hostsView-tableRow-cpuUsage',
render: (avg: number) => formatMetric('cpu', avg),
@@ -205,7 +264,7 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
},
{
name: diskLatencyLabel,
- field: 'diskLatency.avg',
+ field: 'diskLatency',
sortable: true,
'data-test-subj': 'hostsView-tableRow-diskLatency',
render: (avg: number) => formatMetric('diskLatency', avg),
@@ -213,7 +272,7 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
},
{
name: averageRXLabel,
- field: 'rx.avg',
+ field: 'rx',
sortable: true,
'data-test-subj': 'hostsView-tableRow-rx',
render: (avg: number) => formatMetric('rx', avg),
@@ -221,7 +280,7 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
},
{
name: averageTXLabel,
- field: 'tx.avg',
+ field: 'tx',
sortable: true,
'data-test-subj': 'hostsView-tableRow-tx',
render: (avg: number) => formatMetric('tx', avg),
@@ -229,7 +288,7 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
},
{
name: averageTotalMemoryLabel,
- field: 'memoryTotal.avg',
+ field: 'memoryTotal',
sortable: true,
'data-test-subj': 'hostsView-tableRow-memoryTotal',
render: (avg: number) => formatMetric('memoryTotal', avg),
@@ -237,21 +296,34 @@ export const useHostsTable = (nodes: SnapshotNode[], { time }: HostTableParams)
},
{
name: averageMemoryUsageLabel,
- field: 'memory.avg',
+ field: 'memory',
sortable: true,
'data-test-subj': 'hostsView-tableRow-memory',
render: (avg: number) => formatMetric('memory', avg),
align: 'right',
},
],
- [hostFlyoutOpen.clickedItemId, reportHostEntryClick, setFlyoutClosed, setHostFlyoutOpen, time]
+ [
+ hostFlyoutOpen.clickedItemId,
+ reportHostEntryClick,
+ searchCriteria.dateRange,
+ setFlyoutClosed,
+ setHostFlyoutOpen,
+ ]
);
return {
columns,
- items,
clickedItem,
- isFlyoutOpen: !!hostFlyoutOpen.clickedItemId,
+ currentPage,
closeFlyout,
+ items,
+ isFlyoutOpen: !!hostFlyoutOpen.clickedItemId,
+ onTableChange,
+ pagination,
+ sorting,
};
};
+
+export const HostsTable = createContainer(useHostsTable);
+export const [HostsTableProvider, useHostsTableContext] = HostsTable;
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table_url_state.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table_url_state.ts
new file mode 100644
index 0000000000000..b4889d62f5878
--- /dev/null
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table_url_state.ts
@@ -0,0 +1,94 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import * as rt from 'io-ts';
+import { pipe } from 'fp-ts/lib/pipeable';
+import { fold } from 'fp-ts/lib/Either';
+import { constant, identity } from 'fp-ts/lib/function';
+import useLocalStorage from 'react-use/lib/useLocalStorage';
+import deepEqual from 'fast-deep-equal';
+import { useReducer } from 'react';
+import { useUrlState } from '../../../../utils/use_url_state';
+import { DEFAULT_PAGE_SIZE, LOCAL_STORAGE_PAGE_SIZE_KEY } from '../constants';
+
+export const GET_DEFAULT_TABLE_PROPERTIES: TableProperties = {
+ sorting: {
+ direction: 'asc',
+ field: 'name',
+ },
+ pagination: {
+ pageIndex: 0,
+ pageSize: DEFAULT_PAGE_SIZE,
+ },
+};
+
+const HOST_TABLE_PROPERTIES_URL_STATE_KEY = 'tableProperties';
+
+const reducer = (prevState: TableProperties, params: Payload) => {
+ const payload = Object.fromEntries(Object.entries(params).filter(([_, v]) => !!v));
+
+ return {
+ ...prevState,
+ ...payload,
+ };
+};
+
+export const useHostsTableProperties = (): [TableProperties, TablePropertiesUpdater] => {
+ const [localStoragePageSize, setLocalStoragePageSize] = useLocalStorage(
+ LOCAL_STORAGE_PAGE_SIZE_KEY,
+ DEFAULT_PAGE_SIZE
+ );
+
+ const [urlState, setUrlState] = useUrlState({
+ defaultState: {
+ ...GET_DEFAULT_TABLE_PROPERTIES,
+ pagination: {
+ ...GET_DEFAULT_TABLE_PROPERTIES.pagination,
+ pageSize: localStoragePageSize,
+ },
+ },
+
+ decodeUrlState,
+ encodeUrlState,
+ urlStateKey: HOST_TABLE_PROPERTIES_URL_STATE_KEY,
+ });
+
+ const [properties, setProperties] = useReducer(reducer, urlState);
+ if (!deepEqual(properties, urlState)) {
+ setUrlState(properties);
+ if (localStoragePageSize !== properties.pagination.pageSize) {
+ setLocalStoragePageSize(properties.pagination.pageSize);
+ }
+ }
+
+ return [properties, setProperties];
+};
+
+const PaginationRT = rt.partial({ pageIndex: rt.number, pageSize: rt.number });
+const SortingRT = rt.intersection([
+ rt.type({
+ field: rt.string,
+ }),
+ rt.partial({ direction: rt.union([rt.literal('asc'), rt.literal('desc')]) }),
+]);
+
+const TableStateRT = rt.type({
+ pagination: PaginationRT,
+ sorting: SortingRT,
+});
+
+export type TableState = rt.TypeOf;
+export type Payload = Partial;
+export type TablePropertiesUpdater = (params: Payload) => void;
+
+export type Sorting = rt.TypeOf;
+type TableProperties = rt.TypeOf;
+
+const encodeUrlState = TableStateRT.encode;
+const decodeUrlState = (value: unknown) => {
+ return pipe(TableStateRT.decode(value), fold(constant(undefined), identity));
+};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_table_properties_url_state.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_table_properties_url_state.ts
deleted file mode 100644
index 980fdf19a684c..0000000000000
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_table_properties_url_state.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import * as rt from 'io-ts';
-import { pipe } from 'fp-ts/lib/pipeable';
-import { fold } from 'fp-ts/lib/Either';
-import { constant, identity } from 'fp-ts/lib/function';
-import { useUrlState } from '../../../../utils/use_url_state';
-
-export const GET_DEFAULT_TABLE_PROPERTIES = {
- sorting: true,
- pagination: true,
-};
-const HOST_TABLE_PROPERTIES_URL_STATE_KEY = 'tableProperties';
-
-type Action = rt.TypeOf;
-type PropertiesUpdater = (newProps: Action) => void;
-
-export const useTableProperties = (): [TableProperties, PropertiesUpdater] => {
- const [urlState, setUrlState] = useUrlState({
- defaultState: GET_DEFAULT_TABLE_PROPERTIES,
- decodeUrlState,
- encodeUrlState,
- urlStateKey: HOST_TABLE_PROPERTIES_URL_STATE_KEY,
- });
-
- const setProperties = (newProps: Action) => setUrlState({ ...urlState, ...newProps });
-
- return [urlState, setProperties];
-};
-
-const PaginationRT = rt.union([
- rt.boolean,
- rt.partial({ pageIndex: rt.number, pageSize: rt.number }),
-]);
-const SortingRT = rt.union([rt.boolean, rt.type({ field: rt.string, direction: rt.any })]);
-
-const SetSortingRT = rt.partial({
- sorting: SortingRT,
-});
-
-const SetPaginationRT = rt.partial({
- pagination: PaginationRT,
-});
-
-const ActionRT = rt.intersection([SetSortingRT, SetPaginationRT]);
-
-const TablePropertiesRT = rt.type({
- pagination: PaginationRT,
- sorting: SortingRT,
-});
-
-type TableProperties = rt.TypeOf;
-
-const encodeUrlState = TablePropertiesRT.encode;
-const decodeUrlState = (value: unknown) => {
- return pipe(TablePropertiesRT.decode(value), fold(constant(undefined), identity));
-};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/utils.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/utils.ts
index a04fdfa46b279..5da9d36b0f587 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/utils.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/utils.ts
@@ -5,16 +5,23 @@
* 2.0.
*/
-import { Filter } from '@kbn/es-query';
-import { SnapshotNode } from '../../../../common/http_api';
+import { DataViewBase, Filter } from '@kbn/es-query';
-export const createHostsFilter = (hostNodes: SnapshotNode[]): Filter => {
+export const createHostsFilter = (hostNames: string[], dataView?: DataViewBase): Filter => {
return {
query: {
terms: {
- 'host.name': hostNodes.map((p) => p.name),
+ 'host.name': hostNames,
},
},
- meta: {},
+ meta: dataView
+ ? {
+ value: hostNames.join(),
+ type: 'phrases',
+ params: hostNames,
+ index: dataView.id,
+ key: 'host.name',
+ }
+ : {},
};
};
diff --git a/x-pack/test/functional/apps/infra/hosts_view.ts b/x-pack/test/functional/apps/infra/hosts_view.ts
index 3cf0091c93bd4..e9000a9cf3e6d 100644
--- a/x-pack/test/functional/apps/infra/hosts_view.ts
+++ b/x-pack/test/functional/apps/infra/hosts_view.ts
@@ -529,6 +529,89 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});
});
+
+ describe('Pagination and Sorting', () => {
+ beforeEach(async () => {
+ await pageObjects.infraHostsView.changePageSize(5);
+ });
+
+ it('should show 5 rows on the first page', async () => {
+ const hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ hostRows.forEach((row, position) => {
+ pageObjects.infraHostsView
+ .getHostsRowData(row)
+ .then((hostRowData) => expect(hostRowData).to.eql(tableEntries[position]));
+ });
+ });
+
+ it('should paginate to the last page', async () => {
+ await pageObjects.infraHostsView.paginateTo(2);
+ const hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ hostRows.forEach((row) => {
+ pageObjects.infraHostsView
+ .getHostsRowData(row)
+ .then((hostRowData) => expect(hostRowData).to.eql(tableEntries[5]));
+ });
+ });
+
+ it('should show all hosts on the same page', async () => {
+ await pageObjects.infraHostsView.changePageSize(10);
+ const hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ hostRows.forEach((row, position) => {
+ pageObjects.infraHostsView
+ .getHostsRowData(row)
+ .then((hostRowData) => expect(hostRowData).to.eql(tableEntries[position]));
+ });
+ });
+
+ it('should sort by Disk Latency asc', async () => {
+ await pageObjects.infraHostsView.sortByDiskLatency();
+ let hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataFirtPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataFirtPage).to.eql(tableEntries[0]);
+
+ await pageObjects.infraHostsView.paginateTo(2);
+ hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataLastPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataLastPage).to.eql(tableEntries[1]);
+ });
+
+ it('should sort by Disk Latency desc', async () => {
+ await pageObjects.infraHostsView.sortByDiskLatency();
+ let hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataFirtPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataFirtPage).to.eql(tableEntries[1]);
+
+ await pageObjects.infraHostsView.paginateTo(2);
+ hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataLastPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataLastPage).to.eql(tableEntries[0]);
+ });
+
+ it('should sort by Title asc', async () => {
+ await pageObjects.infraHostsView.sortByTitle();
+ let hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataFirtPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataFirtPage).to.eql(tableEntries[0]);
+
+ await pageObjects.infraHostsView.paginateTo(2);
+ hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataLastPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataLastPage).to.eql(tableEntries[5]);
+ });
+
+ it('should sort by Title desc', async () => {
+ await pageObjects.infraHostsView.sortByTitle();
+ let hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataFirtPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataFirtPage).to.eql(tableEntries[5]);
+
+ await pageObjects.infraHostsView.paginateTo(2);
+ hostRows = await pageObjects.infraHostsView.getHostsTableData();
+ const hostDataLastPage = await pageObjects.infraHostsView.getHostsRowData(hostRows[0]);
+ expect(hostDataLastPage).to.eql(tableEntries[0]);
+ });
+ });
});
});
};
diff --git a/x-pack/test/functional/page_objects/infra_hosts_view.ts b/x-pack/test/functional/page_objects/infra_hosts_view.ts
index ae0cc601f8cc7..6478d208226ad 100644
--- a/x-pack/test/functional/page_objects/infra_hosts_view.ts
+++ b/x-pack/test/functional/page_objects/infra_hosts_view.ts
@@ -241,6 +241,7 @@ export function InfraHostsViewProvider({ getService }: FtrProviderContext) {
async typeInQueryBar(query: string) {
const queryBar = await this.getQueryBar();
+ await queryBar.clearValueWithKeyboard();
return queryBar.type(query);
},
@@ -249,5 +250,51 @@ export function InfraHostsViewProvider({ getService }: FtrProviderContext) {
await testSubjects.click('querySubmitButton');
},
+
+ // Pagination
+ getPageNumberButton(pageNumber: number) {
+ return testSubjects.find(`pagination-button-${pageNumber - 1}`);
+ },
+
+ getPageSizeSelector() {
+ return testSubjects.find('tablePaginationPopoverButton');
+ },
+
+ getPageSizeOption(pageSize: number) {
+ return testSubjects.find(`tablePagination-${pageSize}-rows`);
+ },
+
+ async changePageSize(pageSize: number) {
+ const pageSizeSelector = await this.getPageSizeSelector();
+ await pageSizeSelector.click();
+ const pageSizeOption = await this.getPageSizeOption(pageSize);
+ await pageSizeOption.click();
+ },
+
+ async paginateTo(pageNumber: number) {
+ const paginationButton = await this.getPageNumberButton(pageNumber);
+ await paginationButton.click();
+ },
+
+ // Sorting
+ getDiskLatencyHeader() {
+ return testSubjects.find('tableHeaderCell_diskLatency_4');
+ },
+
+ getTitleHeader() {
+ return testSubjects.find('tableHeaderCell_title_1');
+ },
+
+ async sortByDiskLatency() {
+ const diskLatency = await this.getDiskLatencyHeader();
+ const button = await testSubjects.findDescendant('tableHeaderSortButton', diskLatency);
+ return button.click();
+ },
+
+ async sortByTitle() {
+ const titleHeader = await this.getTitleHeader();
+ const button = await testSubjects.findDescendant('tableHeaderSortButton', titleHeader);
+ return button.click();
+ },
};
}
From 111d04f45a64cc050407bd9f892e1f77ddd8cc9f Mon Sep 17 00:00:00 2001
From: Katerina Patticha
Date: Mon, 24 Apr 2023 16:27:38 +0200
Subject: [PATCH 09/13] [APM] Add transaction name filter in failed transaction
rate rule type (#155405)
part of https://github.com/elastic/kibana/issues/152329
related work https://github.com/elastic/kibana/pull/154241
Introduces the Transaction name filter in the failed transaction rate
rule type
https://user-images.githubusercontent.com/3369346/233386404-1875b283-0321-4bf1-a7d3-66327f7d4ec5.mov
## Fixes
The regression introduces in a previous
[PR](https://github.com/elastic/kibana/pull/154241/commits/fce4ef8168429645a01434e19b0feaefba1a4f02)
Existing rule types can have empty string in their params so we need to
make sure we don't filter empty values as it will yield no results.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
---
x-pack/plugins/apm/common/rules/schema.ts | 1 +
.../index.stories.tsx | 105 ++++++++++++++++++
.../index.tsx | 16 ++-
.../register_error_count_rule_type.ts | 8 +-
...register_transaction_duration_rule_type.ts | 12 +-
...et_transaction_error_rate_chart_preview.ts | 13 ++-
...gister_transaction_error_rate_rule_type.ts | 16 ++-
.../tests/alerts/chart_preview.spec.ts | 55 +++++++++
8 files changed, 214 insertions(+), 12 deletions(-)
create mode 100644 x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.stories.tsx
diff --git a/x-pack/plugins/apm/common/rules/schema.ts b/x-pack/plugins/apm/common/rules/schema.ts
index 698b4507c5b3f..ca77e76f6f156 100644
--- a/x-pack/plugins/apm/common/rules/schema.ts
+++ b/x-pack/plugins/apm/common/rules/schema.ts
@@ -52,6 +52,7 @@ export const transactionErrorRateParamsSchema = schema.object({
windowUnit: schema.string(),
threshold: schema.number(),
transactionType: schema.maybe(schema.string()),
+ transactionName: schema.maybe(schema.string()),
serviceName: schema.maybe(schema.string()),
environment: schema.string(),
});
diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.stories.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.stories.tsx
new file mode 100644
index 0000000000000..cd94439db0389
--- /dev/null
+++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.stories.tsx
@@ -0,0 +1,105 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { Story } from '@storybook/react';
+import React, { ComponentType, useState } from 'react';
+import { CoreStart } from '@kbn/core/public';
+import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public';
+import { RuleParams, TransactionErrorRateRuleType } from '.';
+import { AlertMetadata } from '../../utils/helper';
+import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values';
+
+const KibanaReactContext = createKibanaReactContext({
+ notifications: { toasts: { add: () => {} } },
+} as unknown as Partial);
+
+interface Args {
+ ruleParams: RuleParams;
+ metadata?: AlertMetadata;
+}
+
+export default {
+ title: 'alerting/TransactionErrorRateRuleType',
+ component: TransactionErrorRateRuleType,
+ decorators: [
+ (StoryComponent: ComponentType) => {
+ return (
+
+
+
+
+
+ );
+ },
+ ],
+};
+
+export const CreatingInApmServiceOverview: Story = ({
+ ruleParams,
+ metadata,
+}) => {
+ const [params, setParams] = useState(ruleParams);
+
+ function setRuleParams(property: string, value: any) {
+ setParams({ ...params, [property]: value });
+ }
+
+ return (
+ {}}
+ />
+ );
+};
+
+CreatingInApmServiceOverview.args = {
+ ruleParams: {
+ environment: 'testEnvironment',
+ serviceName: 'testServiceName',
+ threshold: 1500,
+ transactionType: 'testTransactionType',
+ transactionName: 'GET /api/customer/:id',
+ windowSize: 5,
+ windowUnit: 'm',
+ },
+ metadata: {
+ environment: ENVIRONMENT_ALL.value,
+ serviceName: undefined,
+ },
+};
+
+export const CreatingInStackManagement: Story = ({
+ ruleParams,
+ metadata,
+}) => {
+ const [params, setParams] = useState(ruleParams);
+
+ function setRuleParams(property: string, value: any) {
+ setParams({ ...params, [property]: value });
+ }
+
+ return (
+ {}}
+ />
+ );
+};
+
+CreatingInStackManagement.args = {
+ ruleParams: {
+ environment: 'testEnvironment',
+ threshold: 1500,
+ windowSize: 5,
+ windowUnit: 'm',
+ },
+ metadata: undefined,
+};
diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx
index f9cfd6a511ef2..f161ef085b3ea 100644
--- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx
+++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_error_rate_rule_type/index.tsx
@@ -23,20 +23,22 @@ import {
IsAboveField,
ServiceField,
TransactionTypeField,
+ TransactionNameField,
} from '../../utils/fields';
import { AlertMetadata, getIntervalAndTimeRange } from '../../utils/helper';
import { ApmRuleParamsContainer } from '../../ui_components/apm_rule_params_container';
-interface RuleParams {
+export interface RuleParams {
windowSize?: number;
windowUnit?: string;
threshold?: number;
serviceName?: string;
transactionType?: string;
+ transactionName?: string;
environment?: string;
}
-interface Props {
+export interface Props {
ruleParams: RuleParams;
metadata?: AlertMetadata;
setRuleParams: (key: string, value: any) => void;
@@ -78,6 +80,7 @@ export function TransactionErrorRateRuleType(props: Props) {
environment: params.environment,
serviceName: params.serviceName,
transactionType: params.transactionType,
+ transactionName: params.transactionName,
interval,
start,
end,
@@ -89,6 +92,7 @@ export function TransactionErrorRateRuleType(props: Props) {
},
[
params.transactionType,
+ params.transactionName,
params.environment,
params.serviceName,
params.windowSize,
@@ -102,7 +106,8 @@ export function TransactionErrorRateRuleType(props: Props) {
onChange={(value) => {
if (value !== params.serviceName) {
setRuleParams('serviceName', value);
- setRuleParams('transactionType', '');
+ setRuleParams('transactionType', undefined);
+ setRuleParams('transactionName', undefined);
setRuleParams('environment', ENVIRONMENT_ALL.value);
}
}}
@@ -117,6 +122,11 @@ export function TransactionErrorRateRuleType(props: Props) {
onChange={(value) => setRuleParams('environment', value)}
serviceName={params.serviceName}
/>,
+ setRuleParams('transactionName', value)}
+ serviceName={params.serviceName}
+ />,
{
- const { serviceName, environment, transactionType, interval, start, end } =
- alertParams;
+ const {
+ serviceName,
+ environment,
+ transactionType,
+ interval,
+ start,
+ end,
+ transactionName,
+ } = alertParams;
const searchAggregatedTransactions = await getSearchTransactionsEvents({
config,
@@ -62,6 +70,7 @@ export async function getTransactionErrorRateChartPreview({
filter: [
...termQuery(SERVICE_NAME, serviceName),
...termQuery(TRANSACTION_TYPE, transactionType),
+ ...termQuery(TRANSACTION_NAME, transactionName),
...rangeQuery(start, end),
...environmentQuery(environment),
...getDocumentTypeFilterForTransactions(
diff --git a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts
index 7ceaf8ca78048..26b5847a205f1 100644
--- a/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts
+++ b/x-pack/plugins/apm/server/routes/alerts/rule_types/transaction_error_rate/register_transaction_error_rate_rule_type.ts
@@ -32,6 +32,7 @@ import {
SERVICE_ENVIRONMENT,
SERVICE_NAME,
TRANSACTION_TYPE,
+ TRANSACTION_NAME,
} from '../../../../../common/es_fields/apm';
import { EventOutcome } from '../../../../../common/event_outcome';
import {
@@ -86,6 +87,7 @@ export function registerTransactionErrorRateRuleType({
apmActionVariables.interval,
apmActionVariables.reason,
apmActionVariables.serviceName,
+ apmActionVariables.transactionName,
apmActionVariables.threshold,
apmActionVariables.transactionType,
apmActionVariables.triggerValue,
@@ -142,8 +144,15 @@ export function registerTransactionErrorRateRuleType({
],
},
},
- ...termQuery(SERVICE_NAME, ruleParams.serviceName),
- ...termQuery(TRANSACTION_TYPE, ruleParams.transactionType),
+ ...termQuery(SERVICE_NAME, ruleParams.serviceName, {
+ queryEmptyString: false,
+ }),
+ ...termQuery(TRANSACTION_TYPE, ruleParams.transactionType, {
+ queryEmptyString: false,
+ }),
+ ...termQuery(TRANSACTION_NAME, ruleParams.transactionName, {
+ queryEmptyString: false,
+ }),
...environmentQuery(ruleParams.environment),
],
},
@@ -232,6 +241,7 @@ export function registerTransactionErrorRateRuleType({
serviceName,
transactionType,
environment,
+ ruleParams.transactionName,
]
.filter((name) => name)
.join('_');
@@ -255,6 +265,7 @@ export function registerTransactionErrorRateRuleType({
[SERVICE_NAME]: serviceName,
...getEnvironmentEsField(environment),
[TRANSACTION_TYPE]: transactionType,
+ [TRANSACTION_NAME]: ruleParams.transactionName,
[PROCESSOR_EVENT]: ProcessorEvent.transaction,
[ALERT_EVALUATION_VALUE]: errorRate,
[ALERT_EVALUATION_THRESHOLD]: ruleParams.threshold,
@@ -272,6 +283,7 @@ export function registerTransactionErrorRateRuleType({
serviceName,
threshold: ruleParams.threshold,
transactionType,
+ transactionName: ruleParams.transactionName,
triggerValue: asDecimalOrInteger(errorRate),
viewInAppUrl,
});
diff --git a/x-pack/test/apm_api_integration/tests/alerts/chart_preview.spec.ts b/x-pack/test/apm_api_integration/tests/alerts/chart_preview.spec.ts
index 7ec09849b7ff2..f95bb8de59a89 100644
--- a/x-pack/test/apm_api_integration/tests/alerts/chart_preview.spec.ts
+++ b/x-pack/test/apm_api_integration/tests/alerts/chart_preview.spec.ts
@@ -83,6 +83,61 @@ export default function ApiTest({ getService }: FtrProviderContext) {
).to.equal(true);
});
+ it('transaction_error_rate with transaction name', async () => {
+ const options = {
+ params: {
+ query: {
+ start,
+ end,
+ serviceName: 'opbeans-java',
+ transactionName: 'APIRestController#product',
+ transactionType: 'request',
+ environment: 'ENVIRONMENT_ALL',
+ interval: '5m',
+ },
+ },
+ };
+
+ const response = await apmApiClient.readUser({
+ endpoint: 'GET /internal/apm/rule_types/transaction_error_rate/chart_preview',
+ ...options,
+ });
+
+ expect(response.status).to.be(200);
+ expect(response.body.errorRateChartPreview[0]).to.eql({
+ x: 1627974600000,
+ y: 1,
+ });
+ });
+
+ it('transaction_error_rate with nonexistent transaction name', async () => {
+ const options = {
+ params: {
+ query: {
+ start,
+ end,
+ serviceName: 'opbeans-java',
+ transactionName: 'foo',
+ transactionType: 'request',
+ environment: 'ENVIRONMENT_ALL',
+ interval: '5m',
+ },
+ },
+ };
+
+ const response = await apmApiClient.readUser({
+ endpoint: 'GET /internal/apm/rule_types/transaction_error_rate/chart_preview',
+ ...options,
+ });
+
+ expect(response.status).to.be(200);
+ expect(
+ response.body.errorRateChartPreview.every(
+ (item: { x: number; y: number | null }) => item.y === null
+ )
+ ).to.equal(true);
+ });
+
it('error_count (with data)', async () => {
const options = getOptions();
options.params.query.transactionType = undefined;
From 1095375fe39e960d0569d818191bef468c93a44b Mon Sep 17 00:00:00 2001
From: Antonio
Date: Mon, 24 Apr 2023 16:42:37 +0200
Subject: [PATCH 10/13] [Cases] Close FilePreview with Escape key. (#155592)
Fixes #155036
## Summary
Allow users to close the file preview in cases by using the Escape key.
(e2e coming in a different PR with other tests)
---
.../components/files/file_preview.test.tsx | 20 +++++++++++++++++++
.../public/components/files/file_preview.tsx | 18 +++++++++++++++--
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/x-pack/plugins/cases/public/components/files/file_preview.test.tsx b/x-pack/plugins/cases/public/components/files/file_preview.test.tsx
index b02df3a82228f..c1d7fe20bee48 100644
--- a/x-pack/plugins/cases/public/components/files/file_preview.test.tsx
+++ b/x-pack/plugins/cases/public/components/files/file_preview.test.tsx
@@ -7,6 +7,7 @@
import React from 'react';
import { screen, waitFor } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
import type { AppMockRenderer } from '../../common/mock';
@@ -35,4 +36,23 @@ describe('FilePreview', () => {
expect(await screen.findByTestId('cases-files-image-preview')).toBeInTheDocument();
});
+
+ it('pressing escape calls closePreview', async () => {
+ const closePreview = jest.fn();
+
+ appMockRender.render();
+
+ await waitFor(() =>
+ expect(appMockRender.getFilesClient().getDownloadHref).toHaveBeenCalledWith({
+ id: basicFileMock.id,
+ fileKind: constructFileKindIdByOwner(mockedTestProvidersOwner[0]),
+ })
+ );
+
+ expect(await screen.findByTestId('cases-files-image-preview')).toBeInTheDocument();
+
+ userEvent.keyboard('{esc}');
+
+ await waitFor(() => expect(closePreview).toHaveBeenCalled());
+ });
});
diff --git a/x-pack/plugins/cases/public/components/files/file_preview.tsx b/x-pack/plugins/cases/public/components/files/file_preview.tsx
index 1bb91c5b53ff7..09cee1320ec2a 100644
--- a/x-pack/plugins/cases/public/components/files/file_preview.tsx
+++ b/x-pack/plugins/cases/public/components/files/file_preview.tsx
@@ -4,12 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import React from 'react';
+import React, { useEffect } from 'react';
import styled from 'styled-components';
import type { FileJSON } from '@kbn/shared-ux-file-types';
-import { EuiOverlayMask, EuiFocusTrap, EuiImage } from '@elastic/eui';
+import { EuiOverlayMask, EuiFocusTrap, EuiImage, keys } from '@elastic/eui';
import { useFilesContext } from '@kbn/shared-ux-file-context';
import type { Owner } from '../../../common/constants/types';
@@ -36,6 +36,20 @@ export const FilePreview = ({ closePreview, selectedFile }: FilePreviewProps) =>
const { client: filesClient } = useFilesContext();
const { owner } = useCasesContext();
+ useEffect(() => {
+ const keyboardListener = (event: KeyboardEvent) => {
+ if (event.key === keys.ESCAPE || event.code === 'Escape') {
+ closePreview();
+ }
+ };
+
+ window.addEventListener('keyup', keyboardListener);
+
+ return () => {
+ window.removeEventListener('keyup', keyboardListener);
+ };
+ }, [closePreview]);
+
return (
From a03d20be039d1c449b2848f46463bc423b6f5183 Mon Sep 17 00:00:00 2001
From: Tiago Costa
Date: Mon, 24 Apr 2023 15:51:36 +0100
Subject: [PATCH 11/13] skip flaky suite (#154970)
---
.../sections/alerts_table/bulk_actions/bulk_actions.test.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/bulk_actions/bulk_actions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/bulk_actions/bulk_actions.test.tsx
index f9d209549da0c..23fac59fca208 100644
--- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/bulk_actions/bulk_actions.test.tsx
+++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/bulk_actions/bulk_actions.test.tsx
@@ -691,7 +691,8 @@ describe('AlertsTable.BulkActions', () => {
).toBeTruthy();
});
- describe('and clear the selection is clicked', () => {
+ // FLAKY: https://github.com/elastic/kibana/issues/154970
+ describe.skip('and clear the selection is clicked', () => {
it('should turn off the toolbar', async () => {
const props = {
...tablePropsWithBulkActions,
From 2c14b584f8f736f65211b5f738f9e0d764681346 Mon Sep 17 00:00:00 2001
From: Tiago Costa
Date: Mon, 24 Apr 2023 15:55:40 +0100
Subject: [PATCH 12/13] skip flaky suite (#155222)
---
x-pack/test/functional/apps/aiops/explain_log_rate_spikes.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/x-pack/test/functional/apps/aiops/explain_log_rate_spikes.ts b/x-pack/test/functional/apps/aiops/explain_log_rate_spikes.ts
index 92320dad62087..54b1baae454bd 100644
--- a/x-pack/test/functional/apps/aiops/explain_log_rate_spikes.ts
+++ b/x-pack/test/functional/apps/aiops/explain_log_rate_spikes.ts
@@ -209,7 +209,8 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
});
}
- describe('explain log rate spikes', async function () {
+ // FLAKY: https://github.com/elastic/kibana/issues/155222
+ describe.skip('explain log rate spikes', async function () {
for (const testData of explainLogRateSpikesTestData) {
describe(`with '${testData.sourceIndexOrSavedSearch}'`, function () {
before(async () => {
From 3d78370aa584e179ae9e9d30fabe080242812d22 Mon Sep 17 00:00:00 2001
From: Kathleen DeRusso
Date: Mon, 24 Apr 2023 11:02:43 -0400
Subject: [PATCH 13/13] Fix API links when generating API key snippet
(#155435)
Fixes the Search Applications API page to set an URL to the ES plugin
rather than Enterprise Search URL.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
---
.../engine_connect/engine_api_integration.tsx | 19 ++++++++++---------
.../engine_connect/search_application_api.tsx | 14 +++++++++++---
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/engine_api_integration.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/engine_api_integration.tsx
index b61614838d7a1..2fe691e262b64 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/engine_api_integration.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/engine_api_integration.tsx
@@ -12,23 +12,24 @@ import { useValues } from 'kea';
import { EuiCodeBlock, EuiSpacer, EuiText, EuiTabs, EuiTab } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { getEnterpriseSearchUrl } from '../../../../shared/enterprise_search_url';
-
+import { useCloudDetails } from '../../../../shared/cloud_details/cloud_details';
import { EngineViewLogic } from '../engine_view_logic';
import { EngineApiLogic } from './engine_api_logic';
-const SearchUISnippet = (enterpriseSearchUrl: string, engineName: string, apiKey: string) => `
+import { elasticsearchUrl } from './search_application_api';
+
+const SearchUISnippet = (esUrl: string, engineName: string, apiKey: string) => `6
import EnginesAPIConnector from "@elastic/search-ui-engines-connector";
const connector = new EnginesAPIConnector({
- host: "${enterpriseSearchUrl}",
+ host: "${esUrl}",
engineName: "${engineName}",
apiKey: "${apiKey || ''}"
});`;
-const cURLSnippet = (enterpriseSearchUrl: string, engineName: string, apiKey: string) => `
-curl --location --request GET '${enterpriseSearchUrl}/api/engines/${engineName}/_search' \\
+const cURLSnippet = (esUrl: string, engineName: string, apiKey: string) => `
+curl --location --request GET '${esUrl}/${engineName}/_search' \\
--header 'Authorization: apiKey ${apiKey || ''}' \\
--header 'Content-Type: application/json' \\
--data-raw '{
@@ -47,19 +48,19 @@ interface Tab {
export const EngineApiIntegrationStage: React.FC = () => {
const [selectedTab, setSelectedTab] = React.useState('curl');
const { engineName } = useValues(EngineViewLogic);
- const enterpriseSearchUrl = getEnterpriseSearchUrl();
const { apiKey } = useValues(EngineApiLogic);
+ const cloudContext = useCloudDetails();
const Tabs: Record = {
curl: {
- code: cURLSnippet(enterpriseSearchUrl, engineName, apiKey),
+ code: cURLSnippet(elasticsearchUrl(cloudContext), engineName, apiKey),
language: 'bash',
title: i18n.translate('xpack.enterpriseSearch.content.engine.api.step3.curlTitle', {
defaultMessage: 'cURL',
}),
},
searchui: {
- code: SearchUISnippet(enterpriseSearchUrl, engineName, apiKey),
+ code: SearchUISnippet(elasticsearchUrl(cloudContext), engineName, apiKey),
language: 'javascript',
title: i18n.translate('xpack.enterpriseSearch.content.engine.api.step3.searchUITitle', {
defaultMessage: 'Search UI',
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/search_application_api.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/search_application_api.tsx
index 9d3c27895657f..6934de4051bdb 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/search_application_api.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/engine/engine_connect/search_application_api.tsx
@@ -23,9 +23,10 @@ import { i18n } from '@kbn/i18n';
import { ANALYTICS_PLUGIN } from '../../../../../../common/constants';
import { COLLECTION_INTEGRATE_PATH } from '../../../../analytics/routes';
+import { CloudDetails, useCloudDetails } from '../../../../shared/cloud_details/cloud_details';
+import { decodeCloudId } from '../../../../shared/decode_cloud_id/decode_cloud_id';
import { docLinks } from '../../../../shared/doc_links';
import { generateEncodedPath } from '../../../../shared/encode_path_params';
-import { getEnterpriseSearchUrl } from '../../../../shared/enterprise_search_url';
import { KibanaLogic } from '../../../../shared/kibana';
import { EngineViewLogic } from '../engine_view_logic';
@@ -34,12 +35,19 @@ import { EngineApiIntegrationStage } from './engine_api_integration';
import { EngineApiLogic } from './engine_api_logic';
import { GenerateEngineApiKeyModal } from './generate_engine_api_key_modal/generate_engine_api_key_modal';
+export const elasticsearchUrl = (cloudContext: CloudDetails): string => {
+ const defaultUrl = 'https://localhost:9200';
+ const url =
+ (cloudContext.cloudId && decodeCloudId(cloudContext.cloudId)?.elasticsearchUrl) || defaultUrl;
+ return url;
+};
+
export const SearchApplicationAPI = () => {
const { engineName } = useValues(EngineViewLogic);
const { isGenerateModalOpen } = useValues(EngineApiLogic);
const { openGenerateModal, closeGenerateModal } = useActions(EngineApiLogic);
- const enterpriseSearchUrl = getEnterpriseSearchUrl();
const { navigateToUrl } = useValues(KibanaLogic);
+ const cloudContext = useCloudDetails();
const steps = [
{
@@ -132,7 +140,7 @@ export const SearchApplicationAPI = () => {
- {enterpriseSearchUrl}
+ {elasticsearchUrl(cloudContext)}