-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support FIPS mode in kubernetes-client with BouncyCastleFipsProvider #2788
Conversation
Can one of the admins verify this patch? |
Kudos, SonarCloud Quality Gate passed! |
@@ -145,7 +145,7 @@ private static PrivateKey handleECKey(InputStream keyInputStream) throws IOExcep | |||
@Override | |||
public PrivateKey call() { | |||
try { | |||
if (Security.getProvider("BC") == null) { | |||
if (Security.getProvider("BC") == null && Security.getProvider("BCFIPS") == null) { | |||
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); |
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.
Shouldn't you be adding the BouncyCastleFipsProvider
here if it's not found, instead of the regular BC provider?
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.
According to Bouncy Castle FIPS Java API User Guide security provider can be added in java.security file.
I chose to support only the external configuration due to the following reasons:
- Additional flag for FIPS mode isn't required
- No need to add dependency with BC FIPS and update versions
- Adding FIPS provider at the state of initialization of Kubernetes client is too late. So much code can be executed in an application using kubernetes-client. Initialization on startup of JVM is preferable.
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.
As I understand, this statement prevents the the BouncyCastleProvider to be added if you configured your JVM to use the BCFIPS provider, right?
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.
On the other hand, these changes should be harmless in case no BC configuration is provided, right?
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.
Hmm, still not convinced… Doesn't this mean that someone might be requesting the FIPS provider and actually getting the regular one?
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.
@manusa , yes! Changes should be harmless in case no BC configuration is provided.
There are 4 cases:
- None of the BouncyCastle security providers configured in JVM -> BC will be added in runtime
- BC configured in JVM -> BC will not be added in runtime
- BCFIPS configured in JVM -> BC will not be added in runtime
- Another FIPS provider configured in JVM (is it exist?) -> BC will be added in runtime
@metacosm , looks like you are asking about case №4, aren't you?
I see 2 solutions:
- The additional flag can be added to prevent adding BC provider in case if someone would like to use an external provider.
- We can say that kubernetes-client works only with the family of BouncyCastle security providers (BC/BCFIPS).
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.
What I don't understand is why we add the BC provider when the user asks for BCFIPS
and not the BouncyCastleFipsProvider
? How will that address the issue?
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.
@metacosm , because there is no option in kubernetes-client configuration for add BouncyCastleFipsProvider(BCFIPS)
instead of BouncyCastleProvider(BC)
.
But if the user will configure JVM for use BouncyCastleFipsProvider(BCFIPS)
kubernetes-client will not add BouncyCastleProvider(BC)
. See case №3 in my previous message.
@oscerd , hello! |
I don't think 4.11 is an active branch, only for critical CVE. |
@oscerd , understood, thanks! |
@manusa , hello! |
Hi @gulyaev13, |
@manusa , hello! |
…connected externally
Hi @DimoDonchev, sorry for the delay. We'll try to include this in our upcoming 5.4.0 release. |
Kudos, SonarCloud Quality Gate passed! |
Hi @manusa . Is there a ETA for the 2.4.0 release? We use this library in Jenkins Kubernetes Plugin and in a few developer tools. It would be great to hqve a release. Please let me know if any help needed |
I guess you mean 5.4.0. Release is imminent, we are long overdue our initial ETA. Not sure if we'll be able to deliver by the end of the week, but our intention is to release ASAP. |
Yeah, thanks for the update and sorry for the typo. Thanks for working on
this and for maintaining the library
…On Wed, May 12, 2021, 12:25 Marc Nuri ***@***.***> wrote:
Hi @manusa <https://github.com/manusa> . Is there a ETA for the 2.4.0
release? We use this library in Jenkins Kubernetes Plugin and in a few
developer tools. It would be great to hqve a release. Please let me know if
any help needed
I guess you mean 5.4.0. Release is imminent, we are long overdue our
initial ETA. Not sure if we'll be able to deliver by the end of the week,
but our intention is to release ASAP.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2788 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAW4RIE7N63VFLUJBXKZPH3TNJJSJANCNFSM4XE3KIUA>
.
|
@gulyaev13 @manusa Hello Team, I am using Apache Flink 1.13.0 and Flink references the 4.9.2 version of the Fabric8 kubernetes client. I am writing an kubernetes operator for Flink and 5.4.0 is not compatible with Flink since the APIs changes a lot between these two versions because I need to call some Flink internal methods which is actually using 4.9.2 Fabric library. However, I still want to make Fabric8 version 4.9.2 FIPS compliant, is it possible to do to monkey patch for such changes? |
I don't know how heavily Apache Flink relies on the client, but it would make sense to update their dependency. |
Support FIPS mode in kubernetes-client with BouncyCastleFipsProvider сonnected externally.
Solving the issue described in #2732
Description
Type of change
test, version modification, documentation, etc.)
Checklist