-
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
[SecuritySolution][Detections] Fix "Closing a signal silently fails with reduced privileges" #86908
Conversation
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 looks great! I need to pull down to test, but wanted to just leave some initial thoughts after a quick glance.
Is it possible to make the callout an accordion. I know that's not currently available in EUI, so not sure if it's possible, but that would make things look a lot less busy I think. @marrasherrier might have more thoughts about showing multiple callouts on the page.
I see the error in the screenshots about not having read privileges on the .lists
index. I need to dig in a bit more but I'm curious what functionality (other than lists) that could affect (this might be more of a separate issue to address). I mention it because in one we're using a callout, in the other a toast though both relate to permissions issues.
x-pack/plugins/security_solution/public/detections/components/callouts/documentation_links.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/detections/components/callouts/external_link.tsx
Outdated
Show resolved
Hide resolved
@@ -14,16 +14,16 @@ const readOnlyAccessToAlertsMessage: CallOutMessage = { | |||
type: 'primary', | |||
id: 'read-only-access-to-alerts', | |||
title: i18n.READ_ONLY_ALERTS_CALLOUT_TITLE, | |||
description: <p>{i18n.READ_ONLY_ALERTS_CALLOUT_MSG}</p>, | |||
description: i18n.readOnlyAlertsCallOutBody(), |
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.
Nice - I'm guilty of not following the docs and not using all caps when it's a function.
77d3865
to
adeebbe
Compare
adeebbe
to
1bc9a89
Compare
Thank you for review @yctercero !
Yeah, that's similar to "Further rework towards cases-like implementation?" comment. I'll discuss with @peluja1012 and hopefully we'll plan it for some of the next releases. Accordion - didn't think about it, but cool idea!
Oh yes, that's a great comment. If there's some issue with privileges for |
1bc9a89
to
d2afcac
Compare
@spong @yctercero @peluja1012 please re-check. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
{text} | ||
</EuiLink> | ||
); | ||
}; |
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 that there's already an ExternalLink
component found here - x-pack/plugins/security_solution/public/common/components/links/index.tsx
- we may want to make use of that one, or move this one into that file?
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.
Thank you, this file seemed too busy for me and containing specific implementations like HostDetailsLinkComponent
, so I overlooked ExternalLink
there.
I'll check how it works and looks with the ExternalLink
component from x-pack/plugins/security_solution/public/common/components/links/index.tsx
and try to submit some quick improvement if possible.
...s/security_solution/public/detections/components/callouts/read_only_alerts_callout/index.tsx
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 - some minor stuff that can be addressed in follow up. Definitely curious how we deal with privilege issues with other stuff like .lists
and seeing if we can create a unified experience for it (as opposed to sometimes callouts, sometimes toasts, etc).
Thanks for this change!
…ith reduced privileges" (elastic#86908) ## Summary This PR introduces the following changes. If the user has insufficient write privileges on the signals index: - we disable the status-changing actions on detection alerts ("Open alert", "Close Alert", "Mark in progress") in the context menu of an alert in alerts table - we make sure to show the corresponding callout that tells about read-only access to detection alerts - in the callout we provide links to docs for understanding why/how to fix
…ith reduced privileges" (elastic#86908) ## Summary This PR introduces the following changes. If the user has insufficient write privileges on the signals index: - we disable the status-changing actions on detection alerts ("Open alert", "Close Alert", "Mark in progress") in the context menu of an alert in alerts table - we make sure to show the corresponding callout that tells about read-only access to detection alerts - in the callout we provide links to docs for understanding why/how to fix
…ith reduced privileges" (#86908) (#87414) ## Summary This PR introduces the following changes. If the user has insufficient write privileges on the signals index: - we disable the status-changing actions on detection alerts ("Open alert", "Close Alert", "Mark in progress") in the context menu of an alert in alerts table - we make sure to show the corresponding callout that tells about read-only access to detection alerts - in the callout we provide links to docs for understanding why/how to fix Authored-by: Georgii Gorbachev <[email protected]>
…ith reduced privileges" (#86908) (#87413) ## Summary This PR introduces the following changes. If the user has insufficient write privileges on the signals index: - we disable the status-changing actions on detection alerts ("Open alert", "Close Alert", "Mark in progress") in the context menu of an alert in alerts table - we make sure to show the corresponding callout that tells about read-only access to detection alerts - in the callout we provide links to docs for understanding why/how to fix Co-authored-by: Georgii Gorbachev <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…lastic#87516) ## Summary This is a follow-up PR addressing some of the comments in: - elastic#86908 - elastic#87004
…lastic#87516) ## Summary This is a follow-up PR addressing some of the comments in: - elastic#86908 - elastic#87004
Addresses: #56991
Summary
This PR introduces the following changes. If the user has insufficient write privileges on the signals index:
This is based on @spong's suggestion in the GH issue.
TODO:
hasIndexUpdateDelete
flag indicating true (full) write privilege on the signals index.ReadOnlyAlertsCallOut
component to usehasIndexUpdateDelete
instead ofhasIndexWrite
. This makes sure we show the callout.AlertContextMenu
component to usehasIndexUpdateDelete
. This makes sure we disable the context menu actions.ReadOnlyAlertsCallOut
andReadOnlyRulesCallOut
.Screenshots
This is how it looks like for our readonly user role (the one that has "Read" on Kibana Security as well) - we show both callouts with the links (definitely not ideal, and this is another reason for improving/standardising callouts UI across the solution):
Details
Useful links
Some docs:
<FormattedMessage />
: doc 1, doc 2Some related PRs:
hasIndexWrite
hasIndexWrite
This was an interesting one for me to play around and figure out how index privileges are implemented in Elasticsearch and in our
security_solution
codebase.Docs for index privileges do not explicitly show how all of them are related to each other. Probably it's not a secret for many devs, but I had to experiment with assigning each privilege and checking which other privileges the user gets automatically:
E.g. I was assigning
index
, running this ES query and checking the result. If onlyindex
is granted, the user getsindex
,create
andcreate_doc
automatically. This is Elasticsearch behavoiur.This way I figured out dependencies between all the index privileges (sorry for quality, looks like a kid's drawing):
What does this mean for us? If I'm not mistaken, this doesn't have to combine all of the privileges with OR:
because it folds to just
privilege.index[indexName].create_doc
, becausewrite
grants all of them automatically. And because of thathasIndexWrite
actually makes sure that the user hascreate_doc
100%, but not necessarilycreate
orindex
orwrite
.So perhaps it's a good idea to rename
hasIndexWrite
tohasIndexCreateDoc
, because truehasIndexWrite
(full write permissions guaranteeing updates and deletions) would be implemented like that:I found a similar OR logic in
lists
plugin as well.I18n
You can notice that callout messages are localized, but links to documentation are not. I did it on purpose to keep it simple and because I'm not sure they have to be localizable. The reason is - I'm not even sure we have docs for security solution in other languages. For me it seems like docs in other languages are outdated. Pls correct me if I'm wrong.
To do later?
I tried to keep this PR as thin as possible so it could be merged to 7.11 after feature freeze 🙂
But there are things that I was either considering doing right away (and then decided to postpone) or just thinking about.
common
code) asSecuritySolutionUserPrivileges
. Maybe create derivedDetectionsUserPrivileges
indetections
likecanUserUpdateAlerts
. At least renamehasIndexWrite
->hasIndexCreateDoc
andhasIndexUpdateDelete
->hasIndexWrite
for consistency with Elasticsearch terminology..lists*
and.items*
? Currently if the user doesn't have access to lists, we show an error message (toast) which you can see on the screenshots and in the issue. Should we create an error callout for that?I think there's some room for improvement here in how we implement RBAC in the UI: handle errors, communicate to the user what's possible and what's not, how we display it.
Checklist
Delete any items that are not applicable to this PR.
For maintainers