mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Cloud Posture] add posture_type field to rule saved object (#149796)
This commit is contained in:
parent
06179742f7
commit
a63404c48e
2 changed files with 12 additions and 1 deletions
|
@ -35,6 +35,7 @@ export const cspRuleTemplateMetadataSchemaV870 = rt.object({
|
|||
id: rt.string(),
|
||||
version: rt.string(),
|
||||
rule_number: rt.maybe(rt.string()),
|
||||
posture_type: rt.maybe(rt.string()),
|
||||
}),
|
||||
default_value: rt.maybe(rt.string()),
|
||||
description: rt.string(),
|
||||
|
|
|
@ -43,9 +43,19 @@ function migrateCspRuleTemplatesToV870(
|
|||
): SavedObjectUnsanitizedDoc<CspRuleTemplateV870> {
|
||||
// Keeps only metadata, deprecated state
|
||||
const { muted, enabled, ...attributes } = doc.attributes;
|
||||
|
||||
return {
|
||||
...doc,
|
||||
attributes,
|
||||
attributes: {
|
||||
metadata: {
|
||||
...attributes.metadata,
|
||||
benchmark: {
|
||||
...attributes.metadata.benchmark,
|
||||
// CSPM introduced in 8.7, so we can assume all docs from 8.4.0 are KSPM
|
||||
posture_type: 'kspm',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue