You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "z-kovacs (via GitHub)" <gi...@apache.org> on 2023/05/23 13:41:03 UTC

[GitHub] [pulsar] z-kovacs opened a new issue, #20373: E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools

z-kovacs opened a new issue, #20373:
URL: https://github.com/apache/pulsar/issues/20373

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Motivation
   
   my firm would like to use Pulsar but using Bouncycastle FIPS approved libs in approved mode for E2E encryption.
   
   Currently the `MessageCryptoBc` is the only `MessageCrypto` implementation (non FIPS), and it is explicitly referenced from `ProducerImpl` and `ConsumerImpl` - unless overridden.
   
   I think it would be greate if someone adds an encryption key and a CryptoKeyReader, based on the loaded modules pulsar would use the fips or non-fips implementation. As related job has been done in pulsar to separate out different version (non-fips or fips) of BouncyCastle dependencies, we could expand on it.
   
   ### Solution
   
   An idea about the tasks:
   1. Create a new MessageCrypto implementation using only bouncycastle FIPS provider and API calls and add it to a new `org.apache.pulsar:pulsar-client-messagecrypto-bcfips` module (`pulsar-client-messagecrypto-bc` already exists).
   2. ProducerImpl and ConsumerImpl should check which version (bc or bc-fips) of MessageCrypto can be found on the classpath and that should be used. Decision should be logged. Defaulting back to the origial non-fips solution for backward compatibility if both are on classpath.
   
   
   ### Alternatives
   
   n/a
   
   ### Anything else?
   
   Notes:
   - ECDSA keys cannot be used to wrap/encrypt keys - in BC's FIPS library only RSA or ELGAMAL cyphers can wrap keys (https://downloads.bouncycastle.org/fips-java/BC-FJA-UserGuide-1.0.2.pdf, chapter 4)
   - in MessageCryptoBc data key encryption is using encrypt/decryp mode of cypher, but it should use wrap and unwrap (please confirm)
   - SecureRandom should be changed probably in the new MessageCryprto implementation: maybe using "NONCEANDIV" for IV generation (what is done for each message), and another "DEFAULT" type for AES data key generation (DEFAULT may exhaust entropy if used for Nonce and IV generation)
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

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


[GitHub] [pulsar] david-streamlio commented on issue #20373: E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools

Posted by "david-streamlio (via GitHub)" <gi...@apache.org>.
david-streamlio commented on issue #20373:
URL: https://github.com/apache/pulsar/issues/20373#issuecomment-1568792447

   @z-kovacs You have indicated that you are willing to submit a PR for this issue. Do you have an existing code fix for this issue that you want to submit for review?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


Re: [I] E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat closed issue #20373: E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools
URL: https://github.com/apache/pulsar/issues/20373


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] z-kovacs commented on issue #20373: E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools

Posted by "z-kovacs (via GitHub)" <gi...@apache.org>.
z-kovacs commented on issue #20373:
URL: https://github.com/apache/pulsar/issues/20373#issuecomment-1577446023

   > @z-kovacs You have indicated that you are willing to submit a PR for this issue. Do you have an existing code fix for this issue that you want to submit for review?
   
   @david-streamlio - I am working on the PR, hopefully I can present it soon.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] github-actions[bot] commented on issue #20373: E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20373:
URL: https://github.com/apache/pulsar/issues/20373#issuecomment-1622846629

   The issue had no activity for 30 days, mark with Stale label.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


Re: [I] E2E encryption implementation using Bouncycastle FIPS provider and only the FIPS-library provided tools [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on issue #20373:
URL: https://github.com/apache/pulsar/issues/20373#issuecomment-6388805038

   Thanks @z-kovacs, and sorry your PR didn't land. FIPS-compliant end-to-end encryption is now part of PIP-489, "FIPS 140-3 compliance mode for Apache Pulsar" (#26155, under discussion on dev@pulsar.apache.org). PIP-489 covers moving `MessageCryptoBc` key wrapping to approved algorithms, with metadata-negotiated migration, and running against BC-FIPS. A related change (#26154) already seeds `MessageCryptoBc` from the BC-FIPS DRBG when that provider is registered. Because this changes the encryption metadata and needs to stay compatible with older clients, it has to go through the PIP process (https://github.com/apache/pulsar/blob/master/pip/README.md). I'm closing this issue in favour of PIP-489, and feedback on that proposal is very welcome.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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