Skip to content

Commit

Permalink
[Security Solution] Avoid exporting execution_summary field (elastic#…
Browse files Browse the repository at this point in the history
…150097)

## Summary

It fixes a problem of exporting `execution_summary` field while exporting detection rules which was introduce in elastic#147035. Presence of that field make importing of just exported rule failing.

Tests to cover this fix will come in a separate PR.
  • Loading branch information
maximpn authored and ogupte committed Feb 3, 2023
1 parent 489b980 commit 210b8d9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,14 @@ export const getRulesFromObjects = async (
isAlertType(matchingRule) &&
matchingRule.params.immutable !== true
) {
const rule = internalRuleToAPIResponse(matchingRule, legacyActions[matchingRule.id]);

// Fields containing runtime information shouldn't be exported. It causes import failures.
delete rule.execution_summary;

return {
statusCode: 200,
rule: internalRuleToAPIResponse(matchingRule, legacyActions[matchingRule.id]),
rule,
};
} else {
return {
Expand Down

0 comments on commit 210b8d9

Please sign in to comment.