-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RAC] Populate common rule fields in alert helpers #108679
[RAC] Populate common rule fields in alert helpers #108679
Conversation
@elastic/security-threat-hunting these changes might impact your persistent alert type code, but I was unable to determine the exact changes required. Please let me know what you think of this. 😇 |
[ALERT_RULE_NAME]: options.rule.name, | ||
[ALERT_RULE_PRODUCER]: options.rule.producer, | ||
[ALERT_RULE_TYPE_ID]: options.rule.ruleTypeId, | ||
[ALERT_RULE_UUID]: options.alertId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably want to change this to ALERT_RULE_ID
and remove ALERT_RULE_UUID
entirely throughout the codebase to align with the schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll check if it's used anywhere. (probably not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per slack conversation, let's stick with ALERT_RULE_UUID
here and plan to remove ALERT_RULE_ID
elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thanks for following up
@@ -391,7 +391,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { | |||
"apm.transaction_error_rate", | |||
], | |||
"kibana.alert.status": Array [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not part of this PR, but shouldn't we use constants for the alert fields here instead of hardcoding them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a jest inline snapshot. Manually interpolating the constants here would render the auto-updating of the snapshot mute, wouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I left a few comments.
Let me know if it makes sense to import the common alert fields from the get_common_alert_fields
you created instead of '@kbn/rule-data-utils'
. Isn't it the reason why this file was created? Do I miss something here? This would require quite a few changes though.
I tested it locally and it works fine. Notice in my screenshot the empty cells. They are empty because these entries still have the open
value. This wouldn't happen to our users, but maybe we could fall back to an empty dash
?
Thanks for taking a look at this PR.
I think we don't need to be backwards-compatible to the previous unfinished schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security solution and rule registry changes LGTM
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @weltenwort |
Co-authored-by: mgiota <[email protected]>
Co-authored-by: mgiota <[email protected]>
Co-authored-by: mgiota <[email protected]> Co-authored-by: Felix Stürmer <[email protected]> Co-authored-by: mgiota <[email protected]>
Co-authored-by: mgiota <[email protected]> Co-authored-by: Felix Stürmer <[email protected]> Co-authored-by: mgiota <[email protected]>
📝 Summary
This marks some technical alert-as-data fields as
required
and changes the alert status values fromopen
/closed
toactive
/recovered
. It also updates the lifecycle and persistent rule type helpers to consistently populate several common alert fields with values from the alerting framework.closes #108161
🕵️ Review notes