Support Request a quote

Websites

HTTP Observatory: what the security grade of your website means

Mozilla's HTTP Observatory grades a website's security headers from F to A+. What it tests, how the score works and which headers a small business site needs.

The HTTP Observatory is a free test by Mozilla, the makers of Firefox, that grades the security settings of a website from F to A+. You enter the address and get a grade in a few seconds. Many small business sites score a D or an F without anyone knowing. This guide explains what the HTTP Observatory tests, how the score is built and which settings a small business site needs, with an example for the most common hosting.

What it looks at

The test does not try to break into your site. It reads the answer your server sends with every page: the headers, a few lines of instructions for the browser that the visitor never sees. Good headers tell the browser to use only an encrypted connection, to load scripts only from places you trust and to refuse to show your page inside someone else's frame.

Setting What it prevents Typical value on a small site
Redirection to HTTPS Visitors landing on an unencrypted version Every http address forwards to https
Strict-Transport-Security A connection being switched back to unencrypted max-age of one or two years
Content-Security-Policy Injected scripts running on your pages Only your own domain plus the services you use
X-Content-Type-Options Files being read as something they are not nosniff
Frame protection Your page shown inside another site to trick visitors frame-ancestors 'self' in the Content-Security-Policy
Referrer-Policy Full addresses of your pages leaking to other sites strict-origin-when-cross-origin
Cookies Cookies sent unencrypted or read by scripts Secure, HttpOnly and SameSite flags

The test also checks cross-origin settings, the integrity of scripts loaded from other servers and the Cross-Origin-Resource-Policy header.

How the score is built

Every site starts at 100. Missing or weak settings take points away. If the result is 90 or more, bonuses for extra protection are added on top. The lowest score is 0 and the highest is currently 145.

The grades follow the score: 100 or more is an A+, 90 to 99 an A, 85 to 89 an A- and so on down to F for 24 points or less. Mozilla says itself that the grade bands are partly arbitrary and based on what security professionals consider important.

The Content-Security-Policy weighs the most. It is also the hardest to set. A strict one has to list every service the site loads: analytics, the cookie banner, maps, fonts, booking widgets. If one is forgotten, that part of the site stops working. This is why many sites skip it and stay at a B or below.

What an A+ does not mean

The Observatory tests protective settings. It does not test whether your WordPress and its plugins are up to date, whether passwords are stored safely or whether a contact form can be abused. Mozilla's own FAQ says these are just as important. An A+ with an outdated plugin is still a site at risk.

An example for Apache hosting

Most shared hosting in Italy runs Apache, where the headers go into a file called .htaccess in the main folder of the site. A starting point looks like this:

Header always set Strict-Transport-Security "max-age=63072000"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Content-Security-Policy "default-src 'self'; frame-ancestors 'self'; base-uri 'self'; form-action 'self'"

The last line is the one to adapt. As it stands it allows only files from your own domain, which would block Google Analytics, an embedded map or an external booking widget. Each service you use has to be added to the right place in the policy. Then the site has to be tested page by page with the cookie banner accepted and refused. A wrong line in .htaccess can also take the whole site offline, so keep a copy of the old file before you change it.

Where to start

Run the test on your home page. If the grade is C or lower, the redirection and the simple headers are a quick gain. The Content-Security-Policy is worth the effort once the rest is in place.

When you write to us with the address of your site, we run the test and look at what the site loads. We set the headers in your hosting, build a Content-Security-Policy that fits the services you use and test every page with and without consent. You get the grade before and after and a written quote at a fixed price before we start. The article on what to do when a website is hacked covers the other half of security. The cookie banner test checks that nothing loads before consent. Our GDPR and privacy service covers the work. Write to us with the address of your website.

Sources

Tell us about your project

The first meeting is free. You get a written quote that lists what is included and what is not.

Request a quote