Skip to content

Commit e847f2e

Browse files
committed
Reorganize common field defaults
1 parent fcab004 commit e847f2e

File tree

1 file changed

+10
-10
lines changed
  • internal/kibana/security_detection_rule

1 file changed

+10
-10
lines changed

internal/kibana/security_detection_rule/models.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,16 @@ func (d *SecurityDetectionRuleData) initializeAllFieldsToDefaults(ctx context.Co
10211021
d.BuildingBlockType = types.StringNull()
10221022
}
10231023

1024+
// Actions field (common across all rule types)
1025+
if !utils.IsKnown(d.Actions) {
1026+
d.Actions = types.ListNull(actionElementType())
1027+
}
1028+
1029+
// Exceptions list field (common across all rule types)
1030+
if !utils.IsKnown(d.ExceptionsList) {
1031+
d.ExceptionsList = types.ListNull(exceptionsListElementType())
1032+
}
1033+
10241034
// Initialize all type-specific fields to null/empty by default
10251035
d.initializeTypeSpecificFieldsToDefaults(ctx, diags)
10261036
}
@@ -1134,16 +1144,6 @@ func (d *SecurityDetectionRuleData) initializeTypeSpecificFieldsToDefaults(ctx c
11341144
},
11351145
})
11361146
}
1137-
1138-
// Actions field (common across all rule types)
1139-
if !utils.IsKnown(d.Actions) {
1140-
d.Actions = types.ListNull(actionElementType())
1141-
}
1142-
1143-
// Exceptions list field (common across all rule types)
1144-
if !utils.IsKnown(d.ExceptionsList) {
1145-
d.ExceptionsList = types.ListNull(exceptionsListElementType())
1146-
}
11471147
}
11481148

11491149
// convertThreatMappingToModel converts kbapi.SecurityDetectionsAPIThreatMapping to the terraform model

0 commit comments

Comments
 (0)