Table of Contents
SSL is an additional layer of security on your site. But to optimize your site security, we recommend to use several important security headers on your site as well. To implement them, you can add the headers as listed below to your website’s .htaccess file. Please make sure to replace the double quotes in each line with a normal one, as WordPress changes it into a fancy one that doesn’t work in .htaccess files.
An important header you can add is HSTS, and HSTS preload, which prevents your website users to load a fake version of your website, created by a hacker. But there are more ways to break into a site. To make this as hard as possible, we recommend adding the below headers to your site.
HSTS
- Recommended
- Novice
Upgrade-Insecure-Requests
- Recommended
- Novice
The Upgrade-Insecure-Requests header provides an additional method to force http:// requests on your own domain to https://. All http:// requests will be automatically upgraded to https:// when this header is enabled.
HSTS Preload
- Recommended
- Experienced
X-Content-Type-Options
- Recommended
- Novice
X-XSS-Protection
- Recommended
- Novice
X-Frame-Options
- Recommended
- Experienced
Expect-CT, Certificate Transparency
- Recommended
- Novice
No Referrer When Downgrade header
- Recommended
- Novice
Content Security Policy
- Recommended
- Advanced
Read the instructions carefully first. When in reporting mode, CSP can slow down your site, as the reports are fired to your server, and saved using the CSP api. If you notice performance issues, please disable reporting only on low traffic moments, until you have gathered enough data to start enforcing.
With CSP you can define from which domains your website may load resources, like images, stylesheets, javascript files etc. This is one of the more advanced headers: because of the modular nature of WordPress, each plugin and theme can add their own resources, like Google Fonts. Also social services, like Facebook, Google Maps, etc, will load external resources. These will all need to be added to the “safe” list. To make this easy, Really Simple SSL has added a reporting mode, which will automatically log the requests that would be blocked. When you have run this a few days, you can check the detected list. If you see the resources is known and safe, you can add it to the list of safe resources. When you have done this with all reported items, you can enable the live mode.
Feature Policy
- Recommended
- Advanced
Read the instructions carefully first.
The Feature Policy header is a security header that controls which browser features can be used. Besides implementing these rules for your own content it can also prevent external iframes from using these browser features, making it a powerful header to secure your site.
The Permissions-Policy HTTP header replaces the existing Feature-Policy header for controlling delegation of permissions and powerful features. The header uses a structured syntax, and allows sites to more tightly restrict which origins can be granted access to features. This will be released in Really Simple SSL 4.1 before depracation.
Public-Key-Pins
- Not recommended
This is a security header which prevents a fraudulent SSL certificate to get loaded. We won’t be adding this one, as it’s a pretty advanced one, with many risks and possible issues, and which is also deprecated by Google, essentially killing this header in my opinion.
The internet will be relying on Expect CT instead of PKP.