-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Extend the
/upgrade/_review
endpoint contract a…
…nd functionality (#187770) **Resolves: #180153 **Resolves: #188277 ## Summary - Extend the POST /upgrade/_review API endpoint's contract and functionality - Changes `has_conflict` property within each rule field's `ThreeWayDiff` from `boolean` to `enum` with possible values: - `NONE`: no conflicts in three way diff - `SOLVABLE`: conflict detected but was successfully resolved by our algorithms - `NON_SOLVABLE`: conflict detected and could not be resolved by our algorithms. - Adds `has_base_version` boolean field within each field diff calculation. Has values: - true: the base version of the field was found and is either defined or undefined - false: the base version of the field was not found - The possible values for `has_conflict` for each concrete diff algorithm are: - **single line strings**: `NO`, `NON_SOLVABLE` - **multi line strings**: `NO`, `SOLVABLE`, `NON_SOLVABLE` - **numbers**: `NO`, `NON_SOLVABLE` - **array of scalar values**: `NO`, `SOLVABLE` - [ ] Adds new logic to handle #186435 (comment) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- Loading branch information
Showing
24 changed files
with
837 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
.../api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* Enum of possible conflict outcomes of a three-way diff: | ||
* - NON_SOLVABLE_CONFLICT: current != target and we couldn't automatically resolve the conflict between them | ||
* - SOLVABLE_CONFLICT: current != target and we automatically resolved the conflict between them | ||
* - NO_CONFLICT: | ||
* - current == target (value won't change) | ||
* - current != target && current == base (stock rule will get a new value) | ||
* See RFC: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md#concrete-field-diff-algorithms-by-type | ||
*/ | ||
export enum ThreeWayDiffConflict { | ||
NONE = 'NONE', | ||
SOLVABLE = 'SOLVABLE', | ||
NON_SOLVABLE = 'NON_SOLVABLE', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.