-
Notifications
You must be signed in to change notification settings - Fork 739
SOLR-17789: Fix Internode Authorization not working for external roles #3397
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
base: branch_9x
Are you sure you want to change the base?
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.
Great work!
I love the test, especially. It will help me replace the remote query implementation while ensuring that the security characteristics are working. Passing principal / auth stuff is very subtle.
@@ -290,6 +291,53 @@ public void testMetrics() throws Exception { | |||
HttpClientUtil.close(cl); | |||
} | |||
|
|||
/** | |||
* Test if JWTPrincipal is passed correctly on internode communication. Setup a cluster with more | |||
* nodes using jwtAuth for both authentication and authorization.Add a private collection with |
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.
* nodes using jwtAuth for both authentication and authorization.Add a private collection with | |
* nodes using jwtAuth for both authentication and authorization. Add a private collection with |
What is a "private" collection?
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.
A private collection is a collection that is not publicly available i.e., a collection where access has been restricted to certain user role(s). See the authorization section in the security.json
the new test is using: solr/modules/jwt-auth/src/test-files/solr/security/jwt_plugin_jwk_security_with_authorization.json
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.
Maybe a restricted collection would make more sense?
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.
"A collection with restricted access" is much clearer. "private collection" sounds like some documented/defined concept.
Can we still merge this in the upcoming 9.9 release? |
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.
Maybe too late; it's up to @HoustonPutman
I'm good with merging this and am happy to do it if Houston asks.
Obviously needs a CHANGES.txt but can be added last second by a committer. How about this wording?:
When Solr forwards/proxies requests to another node that can service the request, it needs to pass authorization headers.
https://issues.apache.org/jira/browse/SOLR-17789
Description
Solr nodes do not pass full authorization details to other nodes.
Steps to reproduce:
This results in a return code 403.
Solution
Add the current user's Security Principal on the HttpClientContext in the sendRemoteQuery method (
solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
) like the executeMethod method on the HttPSolrClient (solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java
)Tests
testInternodeAuthorization on the jwt-auth plugin (
solr\modules\jwt-auth\src\test\org\apache\solr\security\jwt\JWTAuthPluginIntegrationTest.java
).This test will setup a test cluster with three nodes, create a private collection with only two replicas and will query every node for the documents in the collection.
Checklist
Please review the following and check all that apply:
main
branch.branch_9x
branch../gradlew check
.