MAAS TLS sets HSTS forcibly and with too short value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Alberto Donato | ||
MAAS documentation |
New
|
Undecided
|
Unassigned |
Bug Description
maas: 1:3.2.6-
After enabling TLS in MAAS[1], MAAS sets Strict-
[1] https:/
There are two issues here:
1. HSTS is forced, which prevents testing of TLS setup and cert/key by enabling and disabling TLS in MAAS.
MAAS offers a way to enable and disable TLS respectively:
$ maas config-tls -h
...
COMMAND
enable Enable TLS and switch to a secured mode (https).
disable Disable TLS and switch to a non-secured mode (http).
However, disabling doesn't work as expected since the clients will remember to upgrade the connection to HTTPS always because of HSTS so they cannot connect to MAAS with HTTP.
So would be nice to add "--enable-hsts" or something to the API so one can test TLS without HSTS first. Once the testing done, they can enable HSTS after that explicitly with confidence.
$ maas config-tls enable -h
(...)
-h, --help show this help message and exit
--cacert CACERT path to CA certificates chain in PEM format (default: None)
-p PORT, --port PORT HTTPS port (default: 5443)
--yes Skip interactive confirmation (default: False)
2. The value for HSTS is too short.
The recommendation of the value is >= 6 months. And a security scanner is complaining about the value.
Strict Transport Security 86400 s = 1 days is too short ( >= 15552000 seconds recommended), includeSubDomains
Grade cap reasons Grade capped to A. HSTS max-age is too short
https:/
> max-age=63072000
Related branches
- Anton Troyanov: Approve
- MAAS Lander: Approve
-
Diff: 13 lines (+1/-1)1 file modifiedsrc/maasserver/templates/http/regiond.nginx.conf.template (+1/-1)
description: | updated |
Changed in maas: | |
assignee: | nobody → Alberto Donato (ack) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 3.4.0 → 3.4.0-beta1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
HSTS should be optional and the max-age should be configurable with a sane default.