From 9348745fb8afda3308d64fcab31b591c63044df3 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Fri, 13 Dec 2024 13:47:48 +0100 Subject: [PATCH 1/3] preserve empty string values in rule upgrade final edit forms --- .../field_final_side/components/rule_field_edit_form_wrapper.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx index ab12f62cfa27b..e2148d3cf2a29 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx @@ -100,6 +100,7 @@ export function RuleFieldEditFormWrapper({ onSubmit: handleSubmit, options: { warningValidationCodes: VALIDATION_WARNING_CODES, + stripEmptyFields: false, }, }); From 0d3d4ded3be8fe3a03c8a9591b000bfe92e5b40b Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Fri, 13 Dec 2024 13:48:30 +0100 Subject: [PATCH 2/3] fix inability to handle an optional value in timestamp override --- .../final_edit/fields/timestamp_override.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx index a57d538fab47c..b8ef00ece3b3c 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx @@ -72,10 +72,11 @@ function TimestampFallbackDisabled() { return null; } -export function timestampOverrideDeserializer(defaultValue: FormData) { +export function timestampOverrideDeserializer(_: unknown, finalDiffableRule: DiffableRule) { return { - timestampOverride: defaultValue.timestamp_override.field_name, - timestampOverrideFallbackDisabled: defaultValue.timestamp_override.fallback_disabled ?? false, + timestampOverride: finalDiffableRule.timestamp_override?.field_name, + timestampOverrideFallbackDisabled: + finalDiffableRule.timestamp_override?.fallback_disabled ?? false, }; } From ea12f5e717d3224d4a8223f2dae9a4f5492d4bb7 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Fri, 13 Dec 2024 15:46:24 +0100 Subject: [PATCH 3/3] exclude alert suppression from a special fields list --- .../perform_rule_upgrade/perform_rule_upgrade_route.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts index 3ef53e7b7c67a..ac75bbb56e0bf 100644 --- a/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts @@ -26,7 +26,6 @@ export const PickVersionValuesEnum = PickVersionValues.enum; export const FIELDS_TO_UPGRADE_TO_CURRENT_VERSION = [ 'enabled', 'exceptions_list', - 'alert_suppression', 'actions', 'throttle', 'response_actions',