mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Security Solution] Force upgrading to target version for "Reference URLs" when base version is missing (#214161)
**Resolves: https://github.com/elastic/kibana/issues/214171** ## Summary This PR fixes an issue with "references" field in -AB situations. When the base version is missing we try to merge current and target arrays which leads to old and potentially broken URLs from the current version ending up in the result. Now the behaviour is changed to always force merged version to be equal to target (which always has correct URLs).
This commit is contained in:
parent
3803afdbb4
commit
07012811b2
2 changed files with 3 additions and 3 deletions
|
@ -227,7 +227,7 @@ const commonFieldsDiffAlgorithms: FieldsDiffAlgorithmsFor<DiffableCommonFields>
|
|||
risk_score: numberDiffAlgorithm,
|
||||
risk_score_mapping: simpleDiffAlgorithm,
|
||||
references: createScalarArrayDiffAlgorithm({
|
||||
missingBaseVersionStrategy: ScalarArrayDiffMissingBaseVersionStrategy.Merge,
|
||||
missingBaseVersionStrategy: ScalarArrayDiffMissingBaseVersionStrategy.UseTarget,
|
||||
}),
|
||||
false_positives: simpleDiffAlgorithm,
|
||||
threat: simpleDiffAlgorithm,
|
||||
|
|
|
@ -297,11 +297,11 @@ export function referencesField({ getService }: FtrProviderContext): void {
|
|||
ruleUpgradeAssets,
|
||||
diffableRuleFieldName: 'references',
|
||||
expectedDiffOutcome: ThreeWayDiffOutcome.MissingBaseCanUpdate,
|
||||
isMergableField: true,
|
||||
isMergableField: false,
|
||||
expectedFieldDiffValues: {
|
||||
current: ['http://url-3'],
|
||||
target: ['http://url-1', 'http://url-2'],
|
||||
merged: ['http://url-3', 'http://url-1', 'http://url-2'],
|
||||
merged: ['http://url-1', 'http://url-2'],
|
||||
},
|
||||
},
|
||||
getService
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue