Implement HSTS
The HTTP Strict Transport Security policy allows to protect users by declaring to their web browser that they must interact with the webserver using a secure connection.
It is implemented by adding headers.
Apache
- Add it fo all Apache websites of the account via global directives (menu Web > Configuration > Apache):
- Or for each website by adding at the start of a
.htaccesscreated at the root of the websites:
uWSGI
Add in uWSGI additional settings (menu Web > Site > Modify the [site] - ⚙️ > Advanced Settings):
Node.js
To put before any other controller:
Other method using the helmet NPM package:
Directives
max-agedefines the period of application of a given HSTS policy by browsers (31536000 = for one year),includeSubDomainsallows to apply HSTS to both domain and subdomains,preloadallows to add the site in the preloaded HSTS lists.
max-age is required unlike the other ones.
- RFC 6797
- Verify its HSTS configuration via HSTS preload