Prevent removal of actions via the UI from breaking rule AAD (#68184)

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.
This commit is contained in:
Ryland Herrick 2020-06-04 13:38:27 -05:00 committed by GitHub
parent 094b34c065
commit 5fd6416861
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View file

@ -162,7 +162,6 @@ const StepRuleActionsComponent: FC<StepRuleActionsProps> = ({
{myStepData.throttle !== stepActionsDefaultValue.throttle ? (
<>
<EuiSpacer />
<UseField
path="actions"
defaultValue={myStepData.actions}
@ -171,11 +170,6 @@ const StepRuleActionsComponent: FC<StepRuleActionsProps> = ({
messageVariables: actionMessageParams,
}}
/>
<UseField
path="kibanaSiemAppUrl"
defaultValue={kibanaAbsoluteUrl}
component={GhostFormField}
/>
</>
) : (
<UseField
@ -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>

View file

@ -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;
};