-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security Solution][Detections] Loosen lists permissions #75378
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
Conversation
We were previously showing them a configuration page, which was incorrect. The only place we require the write permission is the value lists modal, which is now hidden if that permission is absent.
If the user does not have permission to write to the lists index, they should not be able to CRUD value lists.
* Replaces useCallback functions with inline anonymous functions * Renames the modal state to be more similar to existing analogous modal state
|
Pinging @elastic/siem (Team:SIEM) |
| const needsIndexConfiguration = | ||
| needsIndex && (canManageIndex === false || (canManageIndex === true && hasIndexError)); | ||
| const needsConfiguration = !enabled || canWriteIndex === false || needsIndexConfiguration; | ||
| const needsConfiguration = !enabled || needsIndexConfiguration; |
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.
Only suggestions I would have would be if we can have tests around this area that would be pretty nice to add to the documentation and help future maintainers.
return { canManageIndex, canWriteIndex, enabled, loading, needsConfiguration };This looks really good in that later we can push this to the "needs permissions" and make actionable UI's to tell the user what they're missing exactly and how to fix it. So this was really nice to see here.
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 wholeheartedly agree on the tests. I had been waiting to write a functional test for "read-only lists user can use Detections," but in the interim I will add some unit tests around these hooks in a followup PR 👍
FrankHassanabad
left a comment
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, appreciate the speed and response to this on top of all the other #1 priorities going on.
* Allow read-only lists users to use Detections if lists indexes exist We were previously showing them a configuration page, which was incorrect. The only place we require the write permission is the value lists modal, which is now hidden if that permission is absent. * Disable the Value Lists modal when the user cannot write lists If the user does not have permission to write to the lists index, they should not be able to CRUD value lists. * style: Remove unnecessary useCallbacks * Replaces useCallback functions with inline anonymous functions * Renames the modal state to be more similar to existing analogous modal state
|
@benskelker This removes the |
* Allow read-only lists users to use Detections if lists indexes exist We were previously showing them a configuration page, which was incorrect. The only place we require the write permission is the value lists modal, which is now hidden if that permission is absent. * Disable the Value Lists modal when the user cannot write lists If the user does not have permission to write to the lists index, they should not be able to CRUD value lists. * style: Remove unnecessary useCallbacks * Replaces useCallback functions with inline anonymous functions * Renames the modal state to be more similar to existing analogous modal state
…5459) * Allow read-only lists users to use Detections if lists indexes exist We were previously showing them a configuration page, which was incorrect. The only place we require the write permission is the value lists modal, which is now hidden if that permission is absent. * Disable the Value Lists modal when the user cannot write lists If the user does not have permission to write to the lists index, they should not be able to CRUD value lists. * style: Remove unnecessary useCallbacks * Replaces useCallback functions with inline anonymous functions * Renames the modal state to be more similar to existing analogous modal state
…5460) * Allow read-only lists users to use Detections if lists indexes exist We were previously showing them a configuration page, which was incorrect. The only place we require the write permission is the value lists modal, which is now hidden if that permission is absent. * Disable the Value Lists modal when the user cannot write lists If the user does not have permission to write to the lists index, they should not be able to CRUD value lists. * style: Remove unnecessary useCallbacks * Replaces useCallback functions with inline anonymous functions * Renames the modal state to be more similar to existing analogous modal state
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
In 7.9 we required that a user has
writepermissions to the lists indexes in order to use Detections. This relaxes that requirement, leaving the following behaviors:manage)write), we disable the "Upload Value Lists" modal buttonReview Steps
Checklist
Delete any items that are not applicable to this PR.
For maintainers