HTTP Strict Transport Security¶
HTTP Strict Transport Security (HSTS) provides strong protection when enabled on a stable HTTPS configuration. It protects websites from man-in-the-middle and protocol downgrade attacks (also sometimes called SSL stripping attacks). By instructing browsers to interact with a site only over HTTPS, HSTS automatically upgrades all HTTP requests to HTTPS, blocks bypassable SSL errors, and prevents attackers from intercepting user data.
Warnings¶
Danger
Before enabling HSTS, it's important that HTTPS be fully stable!
Your site must be accessible over HTTPS at all times. Once HSTS is enabled, browsers will refuse to connect over HTTP for the duration of the policy. This can lead to significant unintended downtime.
Once you've enabled HSTS:
- Avoid making changes to your DNS or Nameserver configuration.
- Avoid pausing QUIC.cloud.
- Avoid redirecting HTTPS to HTTP.
- Do not disable SSL or use any invalid or expired certificates.
Configuration¶
Before configuring HSTS, take a moment to review your HTTPS settings. Verify that your site is working correctly over HTTPS, and that it is stable.
When you're ready, visit your QUIC.cloud Dashboard, select your domain, and navigate to CDN > CDN Config > Security > HSTS.
Let's take a look at each of these settings.
Enable HSTS Headers¶
This is the main switch to enable the HSTS feature. Check this box if you want to enable HSTS Headers, and then continue through the remaining settings. Nothing will be enabled until you press the Save HSTS Settings button at the end of the section.
Max Age Header¶
This setting determines how long the HSTS header will be valid for. We recommend that you set it to 5 minutes initially for testing purposes. Once you are sure everything is working, then it is safe to set the HSTS policy for a longer period, such as 1 month or even 12 months.
Include Sub Domains¶
If you choose to include subdomains, be sure that HTTPS is working and stable on every single subdomain on your site. Any subdomain that does not support HTTPS will become inaccessible.
Preload¶
Preloading permits browsers to automatically preload your HSTS configuration when your domain is accessed. Preloaded domains are hard coded in browsers and can only be removed via a request to hstspreload.org. Do not enable preloading unless you are sure that your domain and all subdomains can support HTTPS for the long term!
Confirmation¶
The last step to enable HSTS is to confirm that you understand the risks. If HSTS is misconfigured, or your HTTPS configuration is wrong or unstable, your site could become inaccessible, and there is nothing that QUIC.cloud support can do to help you.
If you've double-checked your settings, and you know your site's HTTPS to be stable, check the box and click the Save HSTS Settings button.
HSTS will then be enabled, and your site will be protected from protocol downgrade attacks going forward.
