# github/secure_headers

Manages application of security headers with many safe defaults

Repository: https://github.com/github/secure_headers
Canonical: https://ross.abutalabs.com/products/secure_headers
Language: Ruby
License: MIT
License Family: permissive
Topics: secure-headers, csp, hsts, referrer-policy, rack, middleware, xframe-options, ruby, cookie, content-security-policy
Last push: 2026-07-27T15:57:10+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 63, longevity 100
- inputs: {"age_days": 5013, "days_push": 37, "days_rel": 91, "gap_med": 102, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3228, forks 254 (observed 2026-08-28T04:07:50.057075+00:00)

## What it is
A Ruby gem that manages the application of HTTP security response headers such as Content Security Policy, HSTS, and X-Frame-Options with safe defaults. It provides global configuration, per-request overrides, and Rack middleware integration for Rails and Sinatra applications.

## Use cases
- add security headers to a rails app
- set up content security policy to prevent xss
- enforce https with hsts
- prevent clickjacking with x-frame-options
- mark cookies as secure httponly and samesite
- configure referrer-policy headers
- apply security headers in sinatra

## When to choose
- you run a Ruby web application and want secure default headers with minimal effort
- you need fine-grained CSP configuration with named and per-action overrides
- you want a battle-tested library maintained by GitHub

## When to avoid
- your stack is not Ruby or Rack-based
- you manage headers at the reverse proxy or CDN layer instead of the app
- you need a general web application firewall rather than header management

## Facets
- artifact type: library
- maturity: stable
- function: middleware, security
- domain: security, web-development, backend
- platform: ruby
- tags: security-headers, content-security-policy, hsts, rack-middleware, clickjacking-protection, xss-protection, web-server

## Member repositories
- github/secure_headers (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:50.057075+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:43:57.327400+00:00, confidence not recorded.
  - readme: https://github.com/github/secure_headers (fetched 2026-08-28T04:07:50.057075+00:00, sha 8fefa52a0a9b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
