Project

General

Profile

Actions

Feature #24662

closed

Feature #47765: mgr/dashboard: security improvements

mgr/dashboard: SSL-enabled dashboard does not play nicely with a frontend HAproxy

Added by Florian Haas almost 6 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
General
Target version:
% Done:

0%


Description

http://docs.ceph.com/docs/master/mgr/dashboard/#reverse-proxies talks about running the ceph-mgr dashboard behind a reverse proxy, so I am assuming that that is a deployment scenario that is at least meant to be supported. Unfortunately, I'm not quite sure how that would work, the way the dashboard is currently wired (in Mimic).

Consider the following scenario:

  • I have three mgr instances, `daisy`, `eric`, and `frank`.
  • The dashboard module is enabled and is configured to listen on port 8443.

I now have the following HAproxy configuration, which exposes the dashboard on the frontend's port 443.

frontend dashboard_front
  bind 0.0.0.0:80
  redirect scheme https code 301 if !{ ssl_fc }

frontend dashboard_front_ssl
  mode tcp
  bind 0.0.0.0:443
  default_backend dashboard_back_ssl

backend dashboard_back_ssl
  mode tcp
  balance source
  stick-table type ip size 200k expire 30m
  stick on src
  server daisy 192.168.122.114:8443 check
  server eric 192.168.122.115:8443 check
  server frank 192.168.122.116:8443 check

From the HAproxy side of things this is working perfectly fine. However, consider what happens if I issue a `curl` request against the HTTP frontend:

curl -k -IL http://[frontend HAproxy IP] 
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://[frontend HAproxy IP]/
Connection: close

HTTP/1.1 303 See Other
Date: Tue, 26 Jun 2018 12:40:19 GMT
Content-Length: 108
Content-Type: text/html;charset=utf-8
Location: https://daisy.example.com:8443/
Server: CherryPy/3.5.0

curl: (6) Could not resolve host: daisy.example.com

Since the redirect from CherryPy includes not only the name, but also the port of the backend server, it would seem to me that this means that a remote client can't possibly connect unless the internal hostname is resolvable via the DNS, and the frontend proxy is configured to listen on the same port as the backend host.

The url_prefix configuration option is not of much help here, because it is merely appended to the backend host's IP address (or hostname) and port. Would it perhaps make sense to introduce a url_alias option, allowing users to override what CherryPy sets for the redirect's Location attribute?

Or is there a better way to do this?


Related issues 2 (0 open2 closed)

Related to Dashboard - Bug #41930: mgr/dashboard: Standby Dashboards don't handle all requests properlyResolvedVolker Theile

Actions
Copied to Dashboard - Backport #41813: nautilus: mgr/dashboard: SSL-enabled dashboard does not play nicely with a frontend HAproxyResolvedNathan CutlerActions
Actions

Also available in: Atom PDF