-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] - Updating UI to work with new kibana privileges abstraction on alerts #108961
Conversation
@@ -31,7 +31,7 @@ export const mapConsumerToIndexName: Record<AlertConsumers, string | string[]> = | |||
logs: '.alerts-observability.logs', | |||
infrastructure: '.alerts-observability.metrics', | |||
observability: '.alerts-observability', | |||
siem: ['.alerts-security.alerts', '.siem-signals'], | |||
siem: '.alerts-security.alerts', |
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.
.siem-signals
is dynamically named and also aliased to .alerts-security.alerts-space
so no need to query both.
|
||
export const useGetUserAlertsPermissions = ( | ||
uiCapabilities: RecursiveReadonly<Record<string, any>>, | ||
featureId: string |
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.
I think this logic should be different to allow o11y to be able to use it. we need to remember that they can have multiple alerts from different feature IDs like logs, APM, Metrics etc. Make sense to us but not sure if it will be good for them.
x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/app/deep_links/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/components/user_info/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/components/user_info/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx
Outdated
Show resolved
Hide resolved
query: { features: SERVER_APP_ID }, | ||
} | ||
); | ||
signal = { name: indexName[0] }; |
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 - let's add a comment for FUTURE DEVELOPER, that the expectation here is to only have one index for the alert index
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.
Def! Will add.
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.
I didn't do...BUT will add if CI fails or as follow up.
x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts
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.
review it with 👓 🔎 👓, Tested locally, code looks good and it is working as expected.
Good job!!! 👍 👏 🍾
Pinging @elastic/security-solution (Team: SecuritySolution) |
@elasticmachine merge upstream |
we need tags 7.15 and 7.16 for the auto-backport to work |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @yctercero |
…abstraction on alerts (elastic#108961) ## Summary Holy moly. What is happening in this PR? 🤷🏽♀️ Let's break it down: - Added a package `@kbn/alerts` - another one?! ...yes - This is meant to add shared hooks and components around alerts as data - `useGetUserAlertsPermissions` - accepts the Kibana capabilities object and returns whether the user has `read` and `crud` alerts privileges - `AlertsFeatureNoPermissions` - component displayed when user does not have alerts privileges - UI changes for user with NO alerts privileges - `Alerts` tab hidden in security solution side navigation - `Alerts` tab hidden in rule details page - UI changes for user with alerts READ ONLY privileges - alerts checkboxes hidden in alerts table - alerts bulk actions hidden in alerts table
…abstraction on alerts (elastic#108961) ## Summary Holy moly. What is happening in this PR? 🤷🏽♀️ Let's break it down: - Added a package `@kbn/alerts` - another one?! ...yes - This is meant to add shared hooks and components around alerts as data - `useGetUserAlertsPermissions` - accepts the Kibana capabilities object and returns whether the user has `read` and `crud` alerts privileges - `AlertsFeatureNoPermissions` - component displayed when user does not have alerts privileges - UI changes for user with NO alerts privileges - `Alerts` tab hidden in security solution side navigation - `Alerts` tab hidden in rule details page - UI changes for user with alerts READ ONLY privileges - alerts checkboxes hidden in alerts table - alerts bulk actions hidden in alerts table
…abstraction on alerts (#108961) (#109156) ## Summary Holy moly. What is happening in this PR? 🤷🏽♀️ Let's break it down: - Added a package `@kbn/alerts` - another one?! ...yes - This is meant to add shared hooks and components around alerts as data - `useGetUserAlertsPermissions` - accepts the Kibana capabilities object and returns whether the user has `read` and `crud` alerts privileges - `AlertsFeatureNoPermissions` - component displayed when user does not have alerts privileges - UI changes for user with NO alerts privileges - `Alerts` tab hidden in security solution side navigation - `Alerts` tab hidden in rule details page - UI changes for user with alerts READ ONLY privileges - alerts checkboxes hidden in alerts table - alerts bulk actions hidden in alerts table Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
…abstraction on alerts (#108961) (#109155) ## Summary Holy moly. What is happening in this PR? 🤷🏽♀️ Let's break it down: - Added a package `@kbn/alerts` - another one?! ...yes - This is meant to add shared hooks and components around alerts as data - `useGetUserAlertsPermissions` - accepts the Kibana capabilities object and returns whether the user has `read` and `crud` alerts privileges - `AlertsFeatureNoPermissions` - component displayed when user does not have alerts privileges - UI changes for user with NO alerts privileges - `Alerts` tab hidden in security solution side navigation - `Alerts` tab hidden in rule details page - UI changes for user with alerts READ ONLY privileges - alerts checkboxes hidden in alerts table - alerts bulk actions hidden in alerts table Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
Summary
++ @XavierM , @michaelolo24, @stephmilovic, @semd, @angorayc, @machadoum, @dhurley14 big thanks for helping push these changes through, fix tests, etc.
Holy moly.
What is happening in this PR? 🤷🏽♀️ Let's break it down:
@kbn/alerts
- another one?! ...yesuseGetUserAlertsPermissions
- accepts the Kibana capabilities object and returns whether the user hasread
andcrud
alerts privilegesAlertsFeatureNoPermissions
- component displayed when user does not have alerts privilegesAlerts
tab hidden in security solution side navigationAlerts
tab hidden in rule details page.siem-signals
preferences on top of kibana privileges.TO DO
.siem-signals
ES privilegesNotes
Screenshots
Alerts privileges NONE
Alerts privileges READ ONLY
Checklist
For maintainers