Forum Moderators: phranque

Message Too Old, No Replies

HTTPS Security Headers

Headers to expect from an SSL site

         

dstiles

11:14 am on Oct 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The headers below SHOULD be set up for HTTPS sites to be REASONABLY secure and may be used to verify sites if required. Settings are taken from my own SSL web sites. Some sites may need different values (eg to enable in-line javascript). I recommend Scott Helme's site for details.

httpOnlyCookies true
requireSSL true

Name: Strict-Transport-Security
Value: max-age=15552001; includeSubDomains; preload

Name: X-Frame-Options
Value: DENY

Name: X-Xss-Protection
Value: 1; mode=block

Name: X-Content-Type-Options
Value: nosniff

Name: X-Permitted-Cross-Domain-Policies
Value: none

Name: Referrer-Policy
Value: strict-origin-when-cross-origin

Name: Content-Security-Policy
Value: default-src 'self'; style-src 'self' 'unsafe-inline';
(for javascript add: script-src 'self' 'unsafe-inline';)

Public Key Pinning (HPKP) - I haven't set up this one yet but it's recommended for "serious" sites. It requires changing every time the SSL cert is updated.

And coming soon...

Expect-CT

[edited by: phranque at 12:57 pm (utc) on May 13, 2020]
[edit reason] disable graphic smile faces [/edit]

glitterball

9:48 am on Jun 6, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I was seeing google.es being blocked, so presumably that would also cause google.de etc to also be blocked. I think websites that rely on adsense should be very careful about implementing this, that's all.

keyplyr

1:38 am on Jun 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



- Summary of Security Headers -

Server - displays the software being run on the server but you can remove or change this value.

Content Security Policy - an effective measure to protect your site from XSS attacks. By whitelisting sources of approved content, you can prevent the browser from loading malicious assets.

Strict-Transport-Security - an excellent HTTP feature to support on your site and strengthens your implementation of TLS by getting the User Agent to enforce the use of HTTPS.

X-Frame-Options - tells the browser whether you want to allow your site to be framed or not. By preventing a browser from framing your site you can defend against attacks like clickjacking.

X-Content-Type-Options - stops a browser from trying to MIME-sniff the content type and forces it to stick with the declared content-type. The only valid value for this header is "X-Content-Type-Options: nosniff".

X-XSS-Protection - sets the configuration for the cross-site scripting filters built into most browsers. The best configuration is "X-XSS-Protection: 1; mode=block".

Referrer-Policy - a header that allows a site to control how much information the browser includes with navigations away from a document and should be set by all sites.

- - -

keyplyr

3:28 am on Jun 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



X-Permitted-Cross-Domain-Policies - when you don’t want to allow content producers to embed your work in their content, ensure you have no crossdomain.xml files within your website’s directory structure and use this header.
This 33 message thread spans 2 pages: 33