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

Add HTTPS support for the dashboard #2812

Merged
merged 1 commit into from
Jun 29, 2019
Merged

Conversation

jcrist
Copy link
Member

@jcrist jcrist commented Jun 28, 2019

Adds optional HTTPS support for the scheduler dashboard. This is only
available via the configuration file, by setting the following fields:

  • distributed.scheduler.tls.cert: the certificate file
  • distributed.scheduler.tls.key: the key file, optional if the key
    file is concatenated with the cert above
  • distributed.scheduler.tls.ca-file: the CA file, optional

These certs may be the same as those used for the
scheduler/worker/client communication, but aren't required to be. The
user is responsible for making this decision and providing the proper
configuration.

Likewise, the user is responsible for providing trusted certificates, or
understanding the security implications of telling their browser "I
understand the risks, trust this certificate" (this is more likely,
given the transient nature of dask clusters).

The generated dashboard links now format on an optional scheme
parameter, which is either http or https, depending on if the TLS
configuration fields above are configured.

Fixes #2775

Adds optional HTTPS support for the scheduler dashboard. This is only
available via the configuration file, by setting the following fields:

- `distributed.scheduler.tls.cert`: the certificate file
- `distributed.scheduler.tls.key`: the key file, optional if the key
  file is concatenated with the cert above
- `distributed.scheduler.tls.ca-file`: the CA file, optional

These certs *may* be the same as those used for the
scheduler/worker/client communication, but aren't required to be. The
user is responsible for making this decision and providing the proper
configuration.

Likewise, the user is responsible for providing trusted certificates, or
understanding the security implications of telling their browser "I
understand the risks, trust this certificate" (this is more likely,
given the transient nature of dask clusters).

The generated dashboard links now format on an optional `scheme`
parameter, which is either `http` or `https`, depending on if the TLS
configuration fields above are configured.
@jcrist
Copy link
Member Author

jcrist commented Jun 28, 2019

This works, but due to the transient nature of Dask clusters (with potentially non-consistent addresses), it's not easy to provide certificates that your browser will trust. In the long term (still too alpha for me to recommend), a different option would be to use dask-gateway, which provides a consistent public address for all dask dashboards, and supports HTTPS configuration. This allows a trusted certificate (e.g. from letsencrypt) to be used, since the public address is known and consistent for all clusters.

@jcrist
Copy link
Member Author

jcrist commented Jun 28, 2019

Failure is unrelated (is this a known flaky test?). cc @mrocklin.

@@ -88,7 +93,7 @@ distributed:
###################

dashboard:
link: "http://{host}:{port}/status"
link: "{scheme}://{host}:{port}/status"
Copy link
Member

Choose a reason for hiding this comment

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

scheme -> protocol?

(scheme may also be a standard term here, I just haven't heard of it before)

Copy link
Member Author

Choose a reason for hiding this comment

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

Scheme is what urllib.parse.urlparse uses.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Alrighty then. Thanks for the reference.

@mrocklin
Copy link
Member

I've seen similar failures in the past. We can probably ignore it.

@mrocklin
Copy link
Member

The failure is maybe addressed in #2813 ? I'd give it about a 40% chance of resolving the issue :/

@mrocklin
Copy link
Member

Thanks @jcrist ! Merging this in.

@mrocklin mrocklin merged commit bf65f7a into dask:master Jun 29, 2019
@jeffcbecker
Copy link

I just installed the latest dask and friends. To configure https for the dashboard, do I copy distributed.yaml to my .config/dask directory, and edit it to specify certs, etc?

@jcrist
Copy link
Member Author

jcrist commented Jul 15, 2019

Yes. For more information on our configuration system see https://docs.dask.org/en/latest/configuration.html.

muammar added a commit to muammar/distributed that referenced this pull request Jul 18, 2019
* upstream/master: (33 commits)
  SpecCluster: move init logic into start (dask#2850)
  Dont reuse closed worker in get_worker (dask#2841)
  Add alternative SSHCluster implementation (dask#2827)
  Extend prometheus metrics endpoint (dask#2792) (dask#2833)
  Include type name in SpecCluster repr (dask#2834)
  Don't make False add-keys report to scheduler (dask#2421)
  Add Nanny to worker docs (dask#2826)
  Respect security configuration in LocalCluster (dask#2822)
  bump version to 2.1.0
  Fix typo that prevented error message (dask#2825)
  Remove dask-mpi (dask#2824)
  Updates to use update_graph in task journey docs (dask#2821)
  Fix Client repr with memory_info=None (dask#2816)
  Fix case where key, rather than TaskState, could end up in ts.waiting_on (dask#2819)
  Use Keyword-only arguments (dask#2814)
  Relax check for worker references in cluster context manager (dask#2813)
  Add HTTPS support for the dashboard (dask#2812)
  CLN: Use dask.utils.format_bytes (dask#2810)
  bump version to 2.0.1
  Add python_requires entry to setup.py (dask#2807)
  ...
@mrocklin
Copy link
Member

mrocklin commented Oct 4, 2019

cc @rcthomas @shreddd , you were asking about this.

@tarun360
Copy link

tarun360 commented Jul 6, 2023

Adds optional HTTPS support for the scheduler dashboard. This is only
available via the configuration file, by setting the following fields:

distributed.scheduler.tls.cert: the certificate file
distributed.scheduler.tls.key: the key file, optional if the key
file is concatenated with the cert above
distributed.scheduler.tls.ca-file: the CA file, optional

I think you meant:

distributed.scheduler.dashboard.tls.cert
distributed.scheduler.dashboard.tls.key 
distributed.scheduler.dashboard.tls.ca-file

Is my assumption correct? @jcrist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serve Dashboard over HTTPS
4 participants