From 01bdadd2abf433a482c34a5a47b5b737536116ed Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 27 Apr 2026 10:01:47 +0700 Subject: [PATCH] Add modern security header rules --- README.md | 6 + checker/rules_modern_headers.go | 174 +++++++++++++++++++++++++++ checker/rules_modern_headers_test.go | 172 ++++++++++++++++++++++++++ 3 files changed, 352 insertions(+) create mode 100644 checker/rules_modern_headers.go create mode 100644 checker/rules_modern_headers_test.go diff --git a/README.md b/README.md index cc5736a..79ac2ad 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,14 @@ relies on TLS for transport. | `http.x_frame_options` | `X-Frame-Options` or CSP `frame-ancestors` provides clickjacking protection. | | `http.x_content_type_options` | `X-Content-Type-Options: nosniff` is set. | | `http.x_xss_protection` | Reports the legacy `X-XSS-Protection` header (recommendation: disable). | +| `http.referrer_policy` | `Referrer-Policy` is set to a privacy-preserving value (W3C Referrer Policy). | +| `http.permissions_policy` | `Permissions-Policy` is set (W3C Permissions Policy, replaces Feature-Policy). | +| `http.coop` | `Cross-Origin-Opener-Policy` isolates the document from cross-origin windows. | +| `http.coep` | `Cross-Origin-Embedder-Policy` requires CORP/CORS opt-in for embedded resources. | +| `http.corp` | `Cross-Origin-Resource-Policy` restricts cross-origin embedding of responses. | | `http.cookie_flags` | Every Set-Cookie has `Secure`, `HttpOnly`, and a `SameSite` attribute. | | `http.sri` | Cross-origin `