-
Notifications
You must be signed in to change notification settings - Fork 76
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
Added dummy search when creating detector on the given indicies #197
Merged
sbcd90
merged 2 commits into
opensearch-project:main
from
stevanbz:check-index-access-on-detector-creation
Jan 5, 2023
Merged
Added dummy search when creating detector on the given indicies #197
sbcd90
merged 2 commits into
opensearch-project:main
from
stevanbz:check-index-access-on-detector-creation
Jan 5, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stevanbz
force-pushed
the
check-index-access-on-detector-creation
branch
from
December 20, 2022 17:55
4c070e1
to
caf640a
Compare
stevanbz
force-pushed
the
check-index-access-on-detector-creation
branch
2 times, most recently
from
December 26, 2022 20:06
f689672
to
a4ff0b7
Compare
Codecov Report
@@ Coverage Diff @@
## main #197 +/- ##
============================================
- Coverage 38.97% 38.87% -0.10%
+ Complexity 892 891 -1
============================================
Files 176 176
Lines 6746 6758 +12
Branches 823 824 +1
============================================
- Hits 2629 2627 -2
- Misses 3876 3889 +13
- Partials 241 242 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
stevanbz
force-pushed
the
check-index-access-on-detector-creation
branch
from
December 26, 2022 21:05
a4ff0b7
to
4a1f986
Compare
eirsep
previously approved these changes
Jan 4, 2023
src/main/java/org/opensearch/securityanalytics/transport/TransportIndexDetectorAction.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/securityanalytics/resthandler/SecureDetectorRestApiIT.java
Outdated
Show resolved
Hide resolved
stevanbz
force-pushed
the
check-index-access-on-detector-creation
branch
2 times, most recently
from
January 4, 2023 16:27
30ac233
to
cb8a613
Compare
Signed-off-by: Stevan Buzejic <[email protected]>
stevanbz
force-pushed
the
check-index-access-on-detector-creation
branch
from
January 5, 2023 21:37
cb8a613
to
64b4c07
Compare
…my index search. Updated tests Signed-off-by: Stevan Buzejic <[email protected]>
stevanbz
force-pushed
the
check-index-access-on-detector-creation
branch
from
January 5, 2023 22:09
9b56898
to
142982a
Compare
eirsep
approved these changes
Jan 5, 2023
sbcd90
approved these changes
Jan 5, 2023
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jan 5, 2023
Signed-off-by: Stevan Buzejic <[email protected]> (cherry picked from commit 51a176b)
eirsep
pushed a commit
to eirsep/security-analytics
that referenced
this pull request
Apr 3, 2023
…search-project#197) Signed-off-by: Stevan Buzejic <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
[Describe what this change achieves]
Checks if user can access the given indices when creating detector
Implemented approach 2 from the issue listed below. Introduced dummy index search before detector creation happens, since once the detector is being created the context is stashed and from that point, the program continues the execution as a super user (which has an access to resources on altering and security analytics side).
That's why, the check has been introduced before the context is being stashed and follows the approach used in alerting.
One general note - security tests will fail because the index privilege action is not introduced for the security_analytics_full_access role
Issues Resolved
[List any issues this PR will resolve]
#182
Check List
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.