Is it possible to enable HSTS for the cPanel and WHM interfaces?
Security auditors whining about not having HSTS set in these.
Thanks,
Chuck
Security auditors whining about not having HSTS set in these.
Thanks,
Chuck
Is this something that cPanel might consider adding? I ask because Mozilla now suggests it among their web security recommendations for creating secure web applications.cPanel/WHM doesn't use HSTS
Header always set Strict-Transport-Security "max-age=300; includeSubDomains; preload"
I also just want to inform that HSTS should only be present in https. So, I use the following for the, it works with apache in a cpanel server. You can either add this to the .htaccess or, you can add the to the main config file i.e., by following my 2nd way. Adding it to the .htaccess file of a website will only affect the particular website, and the folder the .htaccess file is placed in. mod_headers should be enabled in apache.Hi @carock
cPanel/WHM doesn't use HSTS but you can force a secure connection using Tweak Settings -> Security:
Require SSL for cPanel Services
This option forces the server to redirect unencrypted cPanel, Webmail, WHM, and DAV requests to secure ports according to the SSL redirection settings. If “Choose the closest matched domain for which that the system has a valid certificate when redirecting from non-SSL to SSL URLs” is enabled, the system will redirect to the best matched certificate for the domain. If “Choose the closest matched domain for which that the system has a valid certificate when redirecting from non-SSL to SSL URLs” is disabled, the system will redirect to the https:// URL for the domain, even if no valid certificate exists for the domain.
Header always set Strict-Transport-Security "max-age=300; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
The env=HTTPS doesn't work sometimes on subdomains with https e.g. https://subdomain.example.com. Am I missing something?Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-Options nosniff
depending how you implemented you want to add the end bit env=HTTPSGood afternoon.
Sorry if I use any wrong words. Possible language conflict.
I need help to configure the HSTS correctly.
On a consultation website, I received the following error.
Warning: Unnecessary HSTS header over HTTP
The HTTP page at http: //domain.com sends an HSTS header. This has no effect over HTTP, and should be removed.
Does anybody know how to solve this?
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
depending how you implemented you want to add the end bit env=HTTPS
Code:Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
Preloading
When using preload, the max-age directive must be at least 31536000 (1 year), and the includeSubDomains directive must be present. Not part of the specification.
Thanks a lot!That's an excellent question, especially since the HSTS documentation says this about that value:
![]()
Strict-Transport-Security - HTTP | MDN
The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) informs browsers that the site should only be accessed using HTTPS, and that any future attempts to access it using HTTP should automatically be converted to HTTPS.developer.mozilla.org
I'll reach out to the web development team to see if there is an explanation for this, or if we should update our documentation to make that time longer. I won't have details tonight, but hopefully I'll hear back from them tomorrow.Code:Preloading When using preload, the max-age directive must be at least 31536000 (1 year), and the includeSubDomains directive must be present. Not part of the specification.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
T | Cannot Enable Force HTTPS Redirect | Security | 5 | |
D | Breached cPanel - multiple logged logins even with 2FA enabled | Security | 2 | |
D | How to enable HSTS on WHM Interface | Security | 3 | |
T | Need to temporarily enable TLSv1 | Security | 10 | |
D | SOLVED Enable SNI for Primary Domain | Security | 3 |