-
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
[Security Solution][Data Views] - Add alerts on alerts data view warning #138186
Conversation
… view includes alerts index
Pinging @elastic/security-solution (Team: SecuritySolution) |
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!
...ck/plugins/security_solution/public/detections/components/rules/data_view_selector/index.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
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.
Thanks for looping in the docs team! I added a couple of suggestions for the callout message.
...ins/security_solution/public/detections/components/rules/data_view_selector/translations.tsx
Outdated
Show resolved
Hide resolved
...ins/security_solution/public/detections/components/rules/data_view_selector/translations.tsx
Outdated
Show resolved
Hide resolved
...ins/security_solution/public/detections/components/rules/data_view_selector/translations.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @yctercero |
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.
Just some nits @yctercero, thanks for the enhancement!
Thinking about this from the usability side, why do we allow the user to select this data view if likely in most situations this will lead to users shooting themselves in the foot? Some thoughts off the top of my head:
- this default data view seems to be suitable for "Explore" pages like Hosts, but is dangerous for rules to be used => so we might want to filter it out when showing the data view selector
- some kind of "default data view for security rules" could help - this one would exclude the alerts index and include the source event indices
- "alerts on alerts" could be an explicit "data source" in the UI in addition to index patterns and data views
cc @jethr0null
const dataViewsTitle = kibanaDataViews[dataViewId].title; | ||
const dataViewsId = kibanaDataViews[dataViewId].id; | ||
|
||
setShowDataViewAlertsOnAlertsWarning(dataViewsId === 'security-solution-default'); |
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.
Nit: is there a subtle reason why this is implemented via useEffect
when showDataViewAlertsOnAlertsWarning
is a state derivative from dataViewId
? Seems like could be implemented via useMemo
.
const dataViewsTitle = kibanaDataViews[dataViewId].title; | ||
const dataViewsId = kibanaDataViews[dataViewId].id; | ||
|
||
setShowDataViewAlertsOnAlertsWarning(dataViewsId === 'security-solution-default'); |
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.
Is there a common constant for security-solution-default
?
{showDataViewAlertsOnAlertsWarning && ( | ||
<> | ||
<EuiCallOut | ||
title={i18n.DDATA_VIEW_ALERTS_ON_ALERTS_WARNING_LABEL} |
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.
Nit: DDATA
…ing (#138186) ## Summary The default security data view includes the alerts index. This means that a rule that uses this data view can result in alerts on alerts. At first glance, it seems the default data view is equivalent to the default index patterns we normally display on rule creation, but it is not in that it includes the alerts index. (cherry picked from commit b406632)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Thanks for the review! I'll follow up to address the nits. They may just not go in 8.4. Completely agree with your observations. We're currently re-examining the sourcerer architecture and one of my suggestions includes breaking the default data view differently - at the very least having it not include alerts and having the alerts be a data view all its own. Please feel free to add any thoughts you might have in that ticket as well. cc @YulNaumenko |
…ing (elastic#138186) (elastic#138397) ## Summary The default security data view includes the alerts index. This means that a rule that uses this data view can result in alerts on alerts. At first glance, it seems the default data view is equivalent to the default index patterns we normally display on rule creation, but it is not in that it includes the alerts index. (cherry picked from commit b406632) Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
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!
Summary
The default security data view includes the alerts index. This means that a rule that uses this data view can result in alerts on alerts. At first glance, it seems the default data view is equivalent to the default index patterns we normally display on rule creation, but it is not in that it includes the alerts index.
Checklist