You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/12/16 13:47:17 UTC

[GitHub] [nifi-registry] exceptionfactory opened a new pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

exceptionfactory opened a new pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314


   #### Description of PR
   
   NIFIREG-434 Adds support for Bouncy Castle FIPS Key Store (BCFKS) in NiFi Registry configuration properties. BCFKS provides improved security for storage of certificates and private keys using AES-CCM and PKBDF2 algorithms for encryption of entries. The implementation leverages the existing Bouncy Castle Security Provider library and updates the KeystoreType enumeration along with related unit tests for KeystoreUtils.  Updates include removing the KeyStoreUtils.getTrustStore() method, which logged a deprecation warning for PKCS12.  PKCS12 is the default keystore type starting in Java 9, so the log message should be removed.
   
   The Java Keytool command can be used to convert JKS or PKCS12 keystores to BCFKS by referencing the Bouncy Castle Security Provider library and provider class using the following command:
   
   keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.bcfks -deststoretype BCFKS -providerpath bcprov-jdk15on-1.66.jar -providerclass org.bouncycastle.jce.provider.BouncyCastleProvider
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [X] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [X] Does your PR title start with **NIFIREG-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [X] Has your PR been rebased against the latest commit within the target branch (typically `main`)?
   
   - [X] 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:
   - [X] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi-registry` folder?
   - [X] Have you written or updated unit tests to verify your changes?
   - [ ] Have you verified that the full build is successful on JDK 8?
   - [X] Have you verified that the full build is successful on JDK 11?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
   - [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-registry-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-registry-assembly`?
   
   ### For documentation related changes:
   - [X] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### 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.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-registry] thenatog commented on pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

Posted by GitBox <gi...@apache.org>.
thenatog commented on pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314#issuecomment-759550086


   Looks good to me, was able to start up and use NiFi Registry with a bcfks keystore.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-registry] thenatog edited a comment on pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

Posted by GitBox <gi...@apache.org>.
thenatog edited a comment on pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314#issuecomment-759550086


   Looks good to me, was able to start up and use NiFi Registry with a bcfks keystore. Not sure what is up with the github actions for NiFi Registry at the moment.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-registry] thenatog closed pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

Posted by GitBox <gi...@apache.org>.
thenatog closed pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-registry] thenatog commented on a change in pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

Posted by GitBox <gi...@apache.org>.
thenatog commented on a change in pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314#discussion_r556636249



##########
File path: nifi-registry-core/nifi-registry-security-utils/src/main/java/org/apache/nifi/registry/security/util/KeyStoreUtils.java
##########
@@ -65,18 +73,4 @@ public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException
         }
         return KeyStore.getInstance(keyStoreType);
     }
-
-    /**
-     * Returns an empty KeyStore intended for use as a TrustStore backed by the appropriate provider
-     *
-     * @param trustStoreType the trustStoreType
-     * @return an empty KeyStore
-     * @throws KeyStoreException if a KeyStore of the given type cannot be instantiated
-     */
-    public static KeyStore getTrustStore(String trustStoreType) throws KeyStoreException {

Review comment:
       Any reason for removing this/removing the deprecation warning?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-registry] thenatog closed pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

Posted by GitBox <gi...@apache.org>.
thenatog closed pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-registry] exceptionfactory commented on a change in pull request #314: NIFIREG-434 Added support for BCFKS Keystore Type

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #314:
URL: https://github.com/apache/nifi-registry/pull/314#discussion_r556801004



##########
File path: nifi-registry-core/nifi-registry-security-utils/src/main/java/org/apache/nifi/registry/security/util/KeyStoreUtils.java
##########
@@ -65,18 +73,4 @@ public static KeyStore getKeyStore(String keyStoreType) throws KeyStoreException
         }
         return KeyStore.getInstance(keyStoreType);
     }
-
-    /**
-     * Returns an empty KeyStore intended for use as a TrustStore backed by the appropriate provider
-     *
-     * @param trustStoreType the trustStoreType
-     * @return an empty KeyStore
-     * @throws KeyStoreException if a KeyStore of the given type cannot be instantiated
-     */
-    public static KeyStore getTrustStore(String trustStoreType) throws KeyStoreException {

Review comment:
       Thanks for reviewing.  The deprecation warning is not accurate, as PKCS12 is the default key store type starting with Java 9, so the warning and this method are no longer necessary.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org