Skip to content

Add HTTPS support for the dashboard - #2812

Merged
mrocklin merged 1 commit into
dask:masterfrom
jcrist:https-dashboard
Jun 29, 2019
Merged

mrocklin merged 1 commit into
dask:masterfrom
jcrist:https-dashboard

Conversation

@jcrist

@jcrist jcrist commented Jun 28, 2019

Copy link
Copy Markdown
Member

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

jcrist commented Jun 28, 2019

Copy link
Copy Markdown
Member Author

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

jcrist commented Jun 28, 2019

Copy link
Copy Markdown
Member Author

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


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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@mrocklin

Copy link
Copy Markdown
Member

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

@mrocklin

Copy link
Copy Markdown
Member

Thanks @jcrist ! Merging this in.

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

Copy link
Copy Markdown

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

jcrist commented Jul 15, 2019

Copy link
Copy Markdown
Member Author

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

mrocklin commented Oct 4, 2019

Copy link
Copy Markdown
Member

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

@tarun360

tarun360 commented Jul 6, 2023 •

Copy link
Copy Markdown

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