Skip to content
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 encryption in websocket proxy #16234

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Conversation

rdhabalia
Copy link
Contributor

@rdhabalia rdhabalia commented Jun 27, 2022

Motivation

Websocket proxy can be used by user to deploy at client side to serve as a proxy between client app and broker. However, user also wants to enable encryption by publishing and consuming encrytepd messages. Therefore, user wants to enable encryption at websocket proxy which can encrypt publish/consume messages for user. So, we need encryption support at Websocket proxy which can use user-provided CryptoKeyReader implementation and load appropriate encryption keys to publish/consume encrypted message.

Modification

  • Support configurable CryptoKeyReaderFactory at websocket proxy which can create CryptoKeyReader for websocket
  • websocket producer supports encryption-keys to encrypt message
  • websocket consumer supports message decryption

Result

Websocket supports encryption/decryption for producer/consumer/reader.

  • doc-complete

  • doc-complete

  • doc-complete

@github-actions
Copy link

@rdhabalia Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@rdhabalia rdhabalia added doc-complete Your PR changes impact docs and the related docs have been already added. and removed doc-label-missing labels Jun 27, 2022
@FieldContext(
doc = "CryptoKeyReader factory classname to support encryption at websocket."
)
private String cryptoKeyReaderFactoryClassName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the key needs to be available in the WebSocket server?
Wouldn't it be easier to have the keys submitted by the WS client application? Otherwise the WS server will have to store all the private keys for all the topics that need to be exposed in this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Websocket proxy can be used at client side and user would like to take care entire encryption complexity at websocket. Keys are generally stored into CKMS. and cryptoKeyReader just utility to read those keys. So, producer provides name of encryption-key and websocket takes care rest of the complexity.
so, this feature will be useful when single tenant deploys websocket proxy at client side and avoid any encryption complexity.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@rdhabalia rdhabalia merged commit 52da03f into apache:master Jul 21, 2022
poorbarcode added a commit that referenced this pull request Jul 20, 2023
…ocket.conf (#20840)

Motivation: Since the PR #16234 add the prop `cryptoKeyReaderFactoryClassName` for the WebSocket Proxy, but did not add this prop to `websocket.conf`.  This can make the script which try to replacement attribute a bit difficult to write

Modifications: add the conf `cryptoKeyReaderFactoryClassName` into the file `websocket.conf`
poorbarcode added a commit that referenced this pull request Jul 20, 2023
…ocket.conf (#20840)

Motivation: Since the PR #16234 add the prop `cryptoKeyReaderFactoryClassName` for the WebSocket Proxy, but did not add this prop to `websocket.conf`.  This can make the script which try to replacement attribute a bit difficult to write

Modifications: add the conf `cryptoKeyReaderFactoryClassName` into the file `websocket.conf`
(cherry picked from commit 5d0aa56)
Technoboy- pushed a commit that referenced this pull request Aug 17, 2023
…ocket.conf (#20840)

Motivation: Since the PR #16234 add the prop `cryptoKeyReaderFactoryClassName` for the WebSocket Proxy, but did not add this prop to `websocket.conf`.  This can make the script which try to replacement attribute a bit difficult to write

Modifications: add the conf `cryptoKeyReaderFactoryClassName` into the file `websocket.conf`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/websocket doc-complete Your PR changes impact docs and the related docs have been already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants