-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adding config for keystore types, switching tls to native implementation, and adding authorization for server-broker tls channel #7653
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7653 +/- ##
============================================
- Coverage 71.47% 65.06% -6.42%
+ Complexity 4033 4029 -4
============================================
Files 1581 1536 -45
Lines 80419 78634 -1785
Branches 11950 11752 -198
============================================
- Hits 57483 51160 -6323
- Misses 19049 23815 +4766
+ Partials 3887 3659 -228
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
@apucher Can you please take a look at this PR?
@@ -73,8 +73,7 @@ public boolean isRetriable() { | |||
} | |||
} | |||
|
|||
public static class PinotException | |||
extends RuntimeException { | |||
public static class PinotException extends RuntimeException { |
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.
(code format) Please apply the Pinot Code Style
: https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup#setup-ide
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.
resolved
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.
Hi @jasperjiaguo, very much appreciate contributions on pinot security.
I have some initial questions, and I'd appreciate if you could provide some additional context.
Also, would you mind adding a unit test for different keystore formats, or blank
values for your new tls property?
...ot-driver/src/main/java/org/apache/pinot/connector/presto/PinotScatterGatherQueryClient.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryServer.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryServer.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/server/access/AccessControl.java
Show resolved
Hide resolved
@@ -16,13 +16,19 @@ | |||
* specific language governing permissions and limitations | |||
* under the License. | |||
*/ | |||
package org.apache.pinot.server.api.access; | |||
package org.apache.pinot.server.access; |
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.
this looks like it could cause serious breakage to existing pinot installations, since access control is a string-configured property with fully-qualified class name
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.
@apucher In BaseServerStarter
we have
String accessControlFactoryClass = _serverConf.getProperty(Server.ACCESS_CONTROL_FACTORY_CLASS, Server.DEFAULT_ACCESS_CONTROL_FACTORY_CLASS);
where I have changed DEFAULT_ACCESS_CONTROL_FACTORY_CLASS
to org.apache.pinot.server.access.AllowAllAccessFactory
, and left ACCESS_CONTROL_FACTORY_CLASS
unchanged (pinot.server.admin.access.control.factory.class
).
So if the current installation is using default (not configuring pinot.server.admin.access.control.factory.class
) or configuring it to customized class there should be no problem.
IIUC, the only case that will cause problem is someone explicitly configured pinot.server.admin.access.control.factory.class
to org.apache.pinot.server.api.access.AllowAllAccessFactory
. Do you know any use case configured in this way?
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.
At least, I would specifically call this out in the PR's release notes.
I'm aware of at least one installation that explicitly sets AllowAll... as part of startup scripts.
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.
Sure, added in the release notes.
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.
why are we changing the package names?
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.
We moved the access control classes from pinot-server to pinot-core since they are used in QueryServer of pinot-core to enable broker-server channel authorization. There will be circular dependency if we don't change the package name.
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.
Resolved
32d1130
to
4c27b9c
Compare
@apucher , can you please take a look again. Would like to get this merged if no more comments |
cb1ad17
to
96dc8ab
Compare
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.
Thank you for the updates.
Would you mind still adding the unit test for a different keystore type?
It doesn't just serve robustness but similarly as documentation for future developers.
Additionally, I'm not completely clear on how the application layer auth for broker and server would look like. Is this cert- or token-based? Here, too, a minimal unit test could help guide future generations
you could probably add to |
0c5fd26
to
7230b67
Compare
Its not clear why we are changing the package name for AllowAllAccessFactory |
Hello @kishoreg, we moved the access control classes from pinot-server to pinot-core since they are used in QueryServer of pinot-core to enable broker-server channel authorization. There will be circular dependency if we don't change the package name. |
The test for the keystore type is done. I renamed the original tlstest.jks to tlstes.p12 as it is internally a P12 keystore. I think now JAVA uses PKCS12 instead of JKS for default keystore type. Generated a new JKS keystore for robustness test. The authZ is cert based and it extracts X509 cert from the |
c852378
to
33a391e
Compare
…tomcat-native.html) 2. Add access control for broker-server netty tls channel 3. Add missing functionality for netty tls truststore/keystore types 4. Fix a few issues, add config for ssl provider, remove the key existence check for fields having default values 5. Fix keystore naming, add keystore test for JKS 6. Adding test case for server AccessControl
b16f950
to
2d0c907
Compare
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.
good from my side. thank you for adding the cert auth sample. this should make extending this easier for future generations.
@kishoreg @Jackie-Jiang anything still open from your side?
…tomcat-native.html) (apache#7653) 2. Add access control for broker-server netty tls channel 3. Add missing functionality for netty tls truststore/keystore types 4. Fix a few issues, add config for ssl provider, remove the key existence check for fields having default values 5. Fix keystore naming, add keystore test for JKS 6. Adding test case for server AccessControl
Description
We have validated the functionalities of above changes internally using production data and queries.
Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
No
Does this PR fix a zero-downtime upgrade introduced earlier?
No
Does this PR otherwise need attention when creating release notes? Things to consider:
Yes
Release Notes
Moved
org.apache.pinot.server.api.access.AllowAllAccessFactory
toorg.apache.pinot.server.access.AllowAllAccessFactory
important Note that if your current installation explicitly configured access control factory to use
org.apache.pinot.server.api.access.AllowAllAccessFactory
, please change it toorg.apache.pinot.server.access.AllowAllAccessFactory
.Adding the following configs so that keystore/truststore of different types(JKS/PKCS12/...) can load properly
pinot-controller
controller.tls.keystore.type
controller.tls.truststore.type
pinot-broker
pinot.broker.tls.keystore.type
pinot.broker.tls.truststore.type
pinot-server
pinot.server.tls.keystore.type
pinot.server.tls.truststore.type