-
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] integrating rbac search strategy with alert table #107242
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx
Outdated
Show resolved
Hide resolved
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! Think there's still a types issue, but other than that lgtm. Thanks for integrating!
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 jumping in to fix this omission from the original RBAC PR 🙏
It works a bit differently from what I expected, though. I created alerts to test this and they showed up depending on whether I created them from the respective solution UI or the rules and connectors UI in the stack management section. Inspecting the code it seems the search strategy is filtering for kibana.rac.alert.owner
. That field contains "logs"
, "apm"
and so on when the alert was created through the solution UI, but "alerts"
when created through the rules and connections UI.
I would have expected it to check kibana.rac.alert.producer
, which corresponds to the rule type's owner. Why should there be a difference in whether it shows up in the alerts table depending on the place where the user created it?
Another aspect that made me wonder is why addition of a client-side request param (the event type) was needed to make the search strategy honor the users' capabilities. Couldn't this easily be tempered with by the user? I guess it has been designed like that for a reason, but I wanted to bring it up just in case. 😇
x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/timelines/common/search_strategy/timeline/events/index.ts
Show resolved
Hide resolved
x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx
Outdated
Show resolved
Hide resolved
We wanted to keep these two things separate so hadn't added it to the original PR.
We have a meeting set up for this I believe. @oatkiller is this going to be discussed as part of the breakout? We should include alerting folks in there as well. The owner field is set to be renamed to consumer, I'm not sure that it should be filtered by producer. We allow a consumer of the search strategy to specify which
We added this because the logic for each is different. We have to use internal kibana user to query alerts and the |
I can understand that - where can we see potential other follow-up tasks so we don't miss anything?
That's a good point. It escaped my attention that the two branches use different clients.
Not sure what you mean by that. Due to the implementation of the t-grid data fetching we're using the timeline search strategy and Xavier's addition of the |
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.
After talking to @XavierM I double-checked how the authorization matches up with what the user sees in the generic rule UI and the observability alerts table:
As mentioned before, this difference seems to stem from the usage of the "owner" (to renamed "consumer") field.
I think it's possible that a 7.15-friendly solution to this for now would be to make sure that the |
@jasonrhodes Assuming the result would be as intended, wouldn't it make more sense to achieve this by filtering on consumer OR producer in the RBAC filter? This wouldn't impact the indexed documents and would thereby be easier to adjust in future releases. |
I'm thinking that in the future, we will want to have consumers be an array (and represent the consumers of these alerts, rather than the consumer of the rule, I think). In that way, I'd expect both the rule producer and the rule consumer to want to consume these alerts by default, and that later we may want to give users the option to remove one or the other (and add others, even). So the array with some default values feels like a future-proof solution to me. |
I really don't think it makes sense to store an array of who should consume alerts in the data structure. I agree with @weltenwort that the functionality can be achieved with the existing solution. These fields are meant to denote authorization, not viewability preferences. I think that's the job of the query constructor (ie: us right now) to generate a query to filter as needed. |
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 in light of what we discussed via a different channel today 👍 thanks for putting in the effort!
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!
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsAPI count
API count missing comments
History
To update your PR or re-run it, just comment with: |
### Summary We are integrating alert search strategy with RBAC on top of alert tables for security solution and o11y.
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…07822) ### Summary We are integrating alert search strategy with RBAC on top of alert tables for security solution and o11y. Co-authored-by: Xavier Mouligneau <[email protected]>
### Summary We are integrating alert search strategy with RBAC on top of alert tables for security solution and o11y.
…-png-pdf-report-type * 'master' of github.com:elastic/kibana: (392 commits) update linting doc (elastic#105748) [APM] Various improvements from elastic#104851 (elastic#107726) Update dependency @elastic/charts to v33.2.0 (master) (elastic#107842) Fix default route link on kibana homepage (elastic#107809) [APM] Invalidate trackPageview on route change (elastic#107741) Service map backend links (elastic#107317) [index patterns] index pattern create modal (elastic#101853) [RAC] integrating rbac search strategy with alert table (elastic#107242) [Security Solution] Siem signals -> alerts as data field and index aliases (elastic#106049) [Metrics UI] Add checkbox to optionally drop partial buckets (elastic#107676) [Metrics UI] Fix metric threshold preview regression (elastic#107674) Disable Product check in @elastic/elasticsearch-js (elastic#107642) [App Search] Migrate Crawler Status Indicator, Crawler Status Banner, and Crawl Request polling (elastic#107603) [Security Solution, Lists] Replace legacy imports from 'elasticsearch' package (elastic#107226) [maps] asset tracking tutorial (elastic#104552) [scripts/build_ts_refs] when using `--clean` initialize caches (elastic#107777) Upgrade EUI to v36.1.0 (elastic#107231) [RAC] [TGrid] Implements cell actions in the TGrid (elastic#107771) Realign cypress/ccs_integration with cypress/integration (elastic#107743) Allow optional OSS to X-Pack dependencies (elastic#107432) ... # Conflicts: # x-pack/examples/reporting_example/public/application.tsx # x-pack/examples/reporting_example/public/components/app.tsx # x-pack/plugins/canvas/public/services/legacy/stubs/reporting.ts # x-pack/plugins/reporting/common/types.ts # x-pack/plugins/reporting/public/lib/reporting_api_client/context.tsx # x-pack/plugins/reporting/public/management/mount_management_section.tsx # x-pack/plugins/reporting/public/management/report_listing.test.tsx # x-pack/plugins/reporting/public/plugin.ts # x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx # x-pack/plugins/reporting/server/export_types/printable_pdf/execute_job/index.ts
Summary
We are integrating alert search strategy with RBAC on top of alert tables for security solution and o11y.