Home / Knowledge Base / Glossary / Security Headers: CSP, HSTS and Others

Security Headers: CSP, HSTS and Others

Glossary 3 min read Updated 27.07.2026
A few lines in the server response that explain to the browser what is allowed and what is not on the site. What each does, which to start with, and how to enable CSP without breaking anything.

Security headers are a few lines that the server adds to each response. The visitor does not see them, but the browser understands what can and cannot be done on your site. They are configured on the server and usually do not require changing the site code.

Analogy for the Site Owner

This is an instruction for the guard at the entrance. Without it, he allows everything: any script from any domain, embedding your page into someone else's site, attempts to guess the file type. With the instruction, a list appears: these can enter, these cannot, this door should remain closed. Headers do not fix holes in the code, but they prevent them from being exploited.

What Each Header Does

HeaderWhat It ProvidesSeverity
Strict-Transport-SecurityThe browser only accesses you via HTTPS and does not revert to an open connectionMedium
Content-Security-PolicySpecifies where scripts can be loaded from. The main protection against XSSMedium
X-Frame-OptionsPrevents your pages from being embedded in a frame on someone else's site (clickjacking)Low
X-Content-Type-OptionsPrevents guessing the file type — otherwise, an uploaded file may execute as a scriptLow
Referrer-PolicyLimits what address is sent to external sites when transitioningInfo
Permissions-PolicyDisables unnecessary browser capabilities: camera, microphone, geolocationInfo

Alongside, cookie flags are checked — Secure, HttpOnly, and SameSite: they prevent session hijacking.

How This Relates to Business and SEO

Headers themselves do not improve rankings — they are not a ranking factor. They operate on a different front: HSTS removes the risk of an open connection, and CSP prevents external scripts from adding hidden links and redirects to pages. Such injections lead to a drop in rankings and the label "this site may harm your computer" in the browser.

How It Looks in the Security Shield Report

Header checks occur in any mode, including the quick free one. Each missing header becomes a separate finding with its severity, CWE class, and OWASP category; from them, a score from A+ to F is formed. The absence of CSP and HSTS weighs more than the absence of Referrer-Policy. For this group, auto-correction works: the service collects a ready configuration fragment — .htaccess or a block for nginx.

How to Start

  1. Add X-Content-Type-Options: nosniff and Referrer-Policy: strict-origin-when-cross-origin — they almost never break anything.
  2. Close framing: X-Frame-Options: SAMEORIGIN — but check that you are not embedding your pages into other domains.
  3. Ensure that all HTTP redirects to HTTPS, and only then enable HSTS.
  4. Leave CSP for last and start with the report mode Content-Security-Policy-Report-Only.
CSP is enabled in two steps

In Report-Only mode, the policy does not block anything, it only reports what it would block. Let it run for a week on live traffic, analyze the reports, add the necessary domains — and only then switch to the live header. Otherwise, you risk disabling widgets, analytics, and payments.

How to Prevent Reoccurrence

Headers live in the server configuration, and it can be lost during migration, hosting changes, or CDN integration. Keep a config fragment in the repository along with the project and repeat the scan after infrastructure changes — how the service works is described in the article about Security Shield. For access to the cabinet — account security.

FAQ

Do security headers affect rankings?
Not directly, this is not a ranking factor. They reduce the risk of infection and browser warnings, which do impact traffic and rankings.
Can CSP be enabled immediately in production mode?
It's not advisable: a strict policy can disable widgets, analytics, and payments. Start with Report-Only mode, analyze the reports, and only then switch.
Do I need to change anything in the site code?
Usually not — headers are set in the server configuration. Code changes are often only needed for CSP if there are many inline scripts on the pages.
Try it on your project Everything described in the article is available in the dashboard — the registration bonus is already in your balance.
Open dashboard
Was this article helpful? Thank you! We will consider this in future updates.