-
Notifications
You must be signed in to change notification settings - Fork 198
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
Protect HTEX communication with CurveZMQ #3030
Conversation
6b017b1
to
e565065
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.
Some minor comments from a static analysis so far, but I'm still poking at the functionality locally. I'll tentatively say "looking good" at the moment.
e565065
to
d81ceb4
Compare
d09fa89
to
6c6765f
Compare
6c6765f
to
b14ec56
Compare
`ServerContext` and `ClientContext` replace the standard `zmq.Context`. They share many commonly used methods, including `term`, `destroy` and, most importantly, `socket`. The latter applies the necessary certs and options to each socket object. A connection requires a `ServerContext` on one end, which validates clients, and a `ClientContext` on the other, which validates the server. Certificates are generated via the `create_certificates` function.
The interchange serves as a CurveZMQ server, while the executor and various managers serve as CurveZMQ clients. Thus, all communication between these entities is now encrypted. The HTEX `start` method generates new certs for each run in a private `certificates/` directory. We generate a single shared client cert because all clients will have access to this dir. We disable encryption by default, but users can enable it by setting the `encrypted` initialization argument for the HTEX to `True`.
b14ec56
to
431daef
Compare
We've decided to disable encryption by default because, depending on the |
Description
The crux of the implementation revolves around two new classes:
ServerContext
andClientContext
. These replace the standardzmq.Context
and share many commonly used methods, includingterm
,destroy
and, most importantly,socket
. The latter applies the necessary certificates and options to each socket object.A connection requires a
ServerContext
on one end (CurveZMQ server), which validates clients, and aClientContext
on the other (CurveZMQ client), which validates the server.E.g.,
The interchange serves as a CurveZMQ server, while the executor and various managers serve as CurveZMQ clients. Thus, when enabled, all communication channels between these entities are encrypted.
The HTEX
start
method creates new certificates for each run in a privatecertificates/
directory. We generate a single shared client certificate because all clients will have access to this directory.Users can enable encryption by setting the
encrypted
initialization argument for theHighThroughputExecutor
toTrue
. We disable encryption by default because, depending on thepyzmq
installation path, it can cause a significant impact on throughput performance. I've included some recommended installation paths to address these issues in the docs (e.g., install via conda).Fixes #2199
Partially addresses #952
Type of change