-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
NIFI-8096 Deprecated ClientAuth references in SSLContextService #4737
Conversation
- Added SSLContextService.createContext() and refactored referencing components - Removed references to ClientAuth from SslContextFactory methods
9af2fc8
to
3d06174
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.
Thanks @exceptionfactory for the update. Definitely cleans up a lot of code that wasn't necessary! I did have one concern though, with changing the default value on ListenHTTP from REQUIRE to WANT client auth. We should remain as secure as possible by default.
...le/nifi-ssl-context-service/src/main/java/org/apache/nifi/ssl/StandardSSLContextService.java
Show resolved
Hide resolved
...le/nifi-ssl-context-service/src/main/java/org/apache/nifi/ssl/StandardSSLContextService.java
Show resolved
Hide resolved
...rvices/nifi-ssl-context-service-api/src/main/java/org/apache/nifi/ssl/SSLContextService.java
Show resolved
Hide resolved
...rvices/nifi-ssl-context-service-api/src/main/java/org/apache/nifi/ssl/SSLContextService.java
Show resolved
Hide resolved
@@ -193,7 +193,7 @@ | |||
.description("Client Authentication policy for TLS connections. Required when SSL Context Service configured.") | |||
.required(false) | |||
.allowableValues(ClientAuth.values()) | |||
.defaultValue(ClientAuth.REQUIRED.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.
I don't think we want to make this change. The default value should always lean toward being more secure, not less secure. And if I set an SSL Context on the processor, I would assume mutual auth is going to happen unless i explicitly change it. This is especially true, since that's always been the behavior in the past.
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.
Previous behavior inferred requiring a client certificate when the SSLContextService
was configured with trust store properties, falling back to wanting a client certificate in the absence of trust store properties. Making REQUIRED
the default value going forward sounds like the best approach. Perhaps putting a comment in future release notes indicating this change in behavior would be worthwhile for users of ListenHTTP
who do not require clients to provide certificates.
Thanks for the review @markap14. I pushed an update to address your comments. |
Thanks @exceptionfactory! All looks good. +1 merged to main |
- Added SSLContextService.createContext() and refactored referencing components - Removed references to ClientAuth from SslContextFactory methods This closes apache#4737. Signed-off-by: Mark Payne <markap14@hotmail.com>
- Added SSLContextService.createContext() and refactored referencing components - Removed references to ClientAuth from SslContextFactory methods This closes apache#4737. Signed-off-by: Mark Payne <markap14@hotmail.com>
Description of PR
NIFI-8096 Deprecates
createSSLContext()
methods inSSLContextService
and adds acreateContext()
method that does not use theClientAuth
enumeration. Updated extension components to useSSLContextService.createContext()
in place of deprecated methods.Removed references to
ClientAuth
from internalSslContextFactory
class, and refactored framework classes to eliminate unnecessary usage ofClientAuth
.Updated
ListenHTTP
to callSslContextBuilder.Server.setNeedClientAuth(true)
when theClient Authentication
property isREQUIRED
and callsetWantClientAuth(true)
when theClient Authentication
property isWANT
.These changes remove attempts in
SslContextFactory
to modify the defaultSSLParameters
object, which is a read-only representation for the Java Virtual Machine configuration. Deprecating methods onSSLContextService
that useClientAuth
is necessary to clarify component behavior.In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main
)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squash
or use--force
when pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean install
at the rootnifi
folder?LICENSE
file, including the mainLICENSE
file undernifi-assembly
?NOTICE
file, including the mainNOTICE
file found undernifi-assembly
?.displayName
in addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.