-
Notifications
You must be signed in to change notification settings - Fork 300
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
Add support for CIDR ranges in ignore_hosts setting. #5099
Add support for CIDR ranges in ignore_hosts setting. #5099
Conversation
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5099 +/- ##
==========================================
- Coverage 71.70% 71.68% -0.03%
==========================================
Files 335 337 +2
Lines 22755 22781 +26
Branches 3601 3604 +3
==========================================
+ Hits 16316 16330 +14
- Misses 4638 4650 +12
Partials 1801 1801
🚀 New features to boost your workflow:
|
Thank you for this PR @shikharj05. We will also want to update the documentation accordingly.
^ Looks like these cases are already being handled as well |
src/main/java/org/opensearch/security/auth/limiting/AbstractRateLimiter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/auth/AuthFailureListener.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
Ack, will create a separate PR for docs. |
src/main/java/org/opensearch/security/auth/limiting/AbstractRateLimiter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
…treams Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/SecurityUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
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.
Look very good! I have left a couple of further minor comments.
src/main/java/org/opensearch/security/support/HostAndCidrMatcher.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/support/HostAndCidrMatcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/support/HostAndCidrMatcherTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
src/main/java/org/opensearch/security/support/HostAndCidrMatcher.java
Outdated
Show resolved
Hide resolved
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Description
This change adds support to specify CIDR ranges in ignore_hosts settings.
While ignore_hosts currently supports specifying IP addresses and hostnames, it would be good to support adding CIDR ranges as well. For example, see comment here- [Feature Request] Request to Document Behaviour Change in Unauthenticated Request Handling in OpenSearch 2.11.0 or later #4927 (comment)
Adding support for CIDR ranges in
ignore_hosts
Issues Resolved
#4927
Is this a backport? If so, please add backport PR # and/or commits #, and remove
backport-failed
label from the original PR.Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
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.
Example config-