-
Notifications
You must be signed in to change notification settings - Fork 104
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
Check if AD backend role is enabled #968
Conversation
Signed-off-by: Amit Galitzky <[email protected]>
70878cf
to
25df4be
Compare
@@ -209,7 +207,9 @@ class InputService( | |||
// Monitor runner will send transport request to check permission first. If security plugin response | |||
// is yes, user has permission to query AD result. If AD role filter enabled, we will add user role | |||
// filter to protect data at user role level; otherwise, user can query any AD result. | |||
addUserBackendRolesFilter(monitor.user, searchRequest.source()) | |||
if (getADBackendRoleFilterEnabled(clusterService, settings)) { |
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.
Can getADBackendRoleFilterEnabled
should be made more generic like getClientPluginRoleFilter
so that we can supply the AD filter path just for that one use but the method itself can be used for other setting check?
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.
made this change
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 LGTM overall! Added a suggestion on how we can de-couple the AD setting knowledge from the Alerting execution flow.
Signed-off-by: Amit Galitzky <[email protected]>
I made the same code changes on a 2.8 branch and everything passed: amitgalitz@00c326a |
Codecov Report
@@ Coverage Diff @@
## main #968 +/- ##
============================================
- Coverage 75.05% 74.81% -0.24%
+ Complexity 111 110 -1
============================================
Files 144 144
Lines 8341 8358 +17
Branches 1213 1223 +10
============================================
- Hits 6260 6253 -7
- Misses 1465 1485 +20
- Partials 616 620 +4
|
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. Can we link the test success link.
https://github.com/amitgalitz/alerting/actions/runs/5512253293/jobs/10048841565 |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-968-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5fc607bf6f8137fd0ac7fba4522fcedd67e29cbc
# Push it to GitHub
git push --set-upstream origin backport/backport-968-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
* check if ad filter is enabled Signed-off-by: Amit Galitzky <[email protected]> * updated integ tests Signed-off-by: Amit Galitzky <[email protected]> --------- Signed-off-by: Amit Galitzky <[email protected]>
* check if ad filter is enabled Signed-off-by: Amit Galitzky <[email protected]> * updated integ tests Signed-off-by: Amit Galitzky <[email protected]> --------- Signed-off-by: Amit Galitzky <[email protected]>
* check if ad filter is enabled * updated integ tests --------- Signed-off-by: Amit Galitzky <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport/backport-968-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5fc607bf6f8137fd0ac7fba4522fcedd67e29cbc
# Push it to GitHub
git push --set-upstream origin backport/backport-968-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9 Then, create a pull request where the |
* check if ad filter is enabled * updated integ tests --------- Signed-off-by: Amit Galitzky <[email protected]> (cherry picked from commit 62d3d7e)
* check if ad filter is enabled * updated integ tests --------- Signed-off-by: Amit Galitzky <[email protected]> (cherry picked from commit 62d3d7e) Co-authored-by: Amit Galitzky <[email protected]>
Description of changes:
Right now the ad backend role filtering is always enabled, this is adding a check to make sure that AD backend role filtering is either disabled or enabled and apply that filtering correctly when retrieving detectors or calling on the result index in AD.
CheckList:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.