Skip to content

Commit

Permalink
Prevent removal of actions via the UI from breaking rule AAD (#68184)
Browse files Browse the repository at this point in the history
This fixes #64870 _for real_.

The issue ended up being caused by a
conditional form field that mapped to a nested field on the rule's
params: when a rule is created with an action, it has a
meta.kibana_siem_app_url field. When the rule's actions were removed via
the UI, that field was _also_ removed, which broke AAD and thus rule
execution.

This fixes the issue by making that field unconditional, and also
removes the previous workaround.
  • Loading branch information
rylnd authored Jun 4, 2020
1 parent 094b34c commit 5fd6416
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const StepRuleActionsComponent: FC<StepRuleActionsProps> = ({
{myStepData.throttle !== stepActionsDefaultValue.throttle ? (
<>
<EuiSpacer />

<UseField
path="actions"
defaultValue={myStepData.actions}
Expand All @@ -171,11 +170,6 @@ const StepRuleActionsComponent: FC<StepRuleActionsProps> = ({
messageVariables: actionMessageParams,
}}
/>
<UseField
path="kibanaSiemAppUrl"
defaultValue={kibanaAbsoluteUrl}
component={GhostFormField}
/>
</>
) : (
<UseField
Expand All @@ -184,6 +178,11 @@ const StepRuleActionsComponent: FC<StepRuleActionsProps> = ({
component={GhostFormField}
/>
)}
<UseField
path="kibanaSiemAppUrl"
defaultValue={kibanaAbsoluteUrl}
component={GhostFormField}
/>
<UseField path="enabled" defaultValue={myStepData.enabled} component={GhostFormField} />
</EuiForm>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,5 @@ export const updateRulesNotifications = async ({
interval: ruleActions.alertThrottle,
});

// TODO: Workaround for https://github.com/elastic/kibana/issues/67290
await alertsClient.updateApiKey({ id: ruleAlertId });

return ruleActions;
};

0 comments on commit 5fd6416

Please sign in to comment.