-
Couldn't load subscription status.
- Fork 32
Secure Dask backend using self-signed certificates (⚠️ devops) #5265
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
Secure Dask backend using self-signed certificates (⚠️ devops) #5265
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5265 +/- ##
========================================
+ Coverage 85.3% 87.1% +1.7%
========================================
Files 1316 1316
Lines 53753 53813 +60
Branches 1170 1170
========================================
+ Hits 45904 46912 +1008
+ Misses 7600 6652 -948
Partials 249 249
Flags with carried forward coverage won't be shown. Click here to find out more.
|
fc88c81 to
f6d2ca2
Compare
c7ad51f to
9c0bfce
Compare
32747dd to
b20c15a
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.
Cool!
As a general remark, I wonder whether all the certificates tooling (create, delete, list, ...) could be generalized for any service and not only the dask services.
If it is not such a hustle, it might become handy in the future for some other service.
c458849 to
b0798f5
Compare
b0798f5 to
c864a1f
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.
ack for the devops changes. Looks scarry but I saw no issues conceptually

What do these changes do?
This PR basically changes the protocol used by the whole dask backend to enable TLS security (see https://distributed.dask.org/en/latest/tls.html) and also encrypts communication between all the dask parts (client, scheduler, workers). Notable exception to this rule is the dask-scheduler dashboard that is still in unprotected, but is also read-only so deemed as a lesser issue.
To this end the Makefile was adapted to ensure a self-signed certificate is created before the stack may be deployed locally (see
make certificatesin services/dask-sidecar). These certificates are git-ignored and are not deleted unlessmake cleanis run. The certificates are passed as docker secrets inside the different dask-aware services (dask-sidecar, dask-scheduler, director-v2, clusters-keeper and computational-autoscaling).Currently the certificates are the same for all the osparc-defined clusters (default cluster and external clusters that are created by clusters-keeper) for sanity.
details
Related issue/s
How to test
Dev Checklist
DevOps Checklist
osparc-ops-deployment-configuration MRs:
osparc-ops-environments PRs:
BREAKING CHANGES MRs:
details
Ensure this changed from
tcptotlsprotocolThis variable was added but contains a default because this is the only way to keep the .env simple on simcore side (it basically is made out of the dask-sidecar variables). Therefore, this would not need to be setup in ops-env
COMPUTATIONAL_BACKEND_DEFAULT_CLUSTER_AUTH='{"type":"tls","tls_ca_file":"${DASK_TLS_CERT}","tls_client_cert":"${DASK_TLS_CERT}","tls_client_key":"${DASK_TLS_KEY}"}'These are new ENVs, they allow connecting on-demand clusters with the certificates.
In order for the deployed EC2s to use the certificates they need to download them out of AWS ParameterStore as the certificates exceed the 16KB limit when starting an instance.
The following is also not necessary in ops-env for same reason as explained in 2.
CLUSTERS_KEEPER_COMPUTATIONAL_BACKEND_DEFAULT_CLUSTER_AUTH='{"type":"tls","tls_ca_file":"${DASK_TLS_CERT}","tls_client_cert":"${DASK_TLS_CERT}","tls_client_key":"${DASK_TLS_KEY}"}'DASK_SCHEDULER_AUTH='{"type":"tls","tls_ca_file":"/home/scu/.dask/dask-crt.pem","tls_client_cert":"/home/scu/.dask/dask-crt.pem","tls_client_key":"/home/scu/.dask/dask-key.pem"}'