Skip to content
HELMET Source Back to HELMET
Menu
HELMET's front page: the headline 'HELMET. Put it on before you ship.' and the composer require command beside a chalkboard play where five rushers, XSS, clickjack, fake HTTPS, fixation and false down, are stopped at the line by CSP, frames, proxies, session and /up, in front of the HELMET mark marked 'your app'. Sacks allowed: 0.

HELMET#

Three members of the band Helmet, two guitarists and a drummer at a Tama kit, tinted blue against a hazy orange and gold backdrop GIF via Tenor

php ^8.3 license MIT psr-15: middleware GitHub CI

Put it on before you ship. Security headers, a hardened session and an honest proxy check, snapped on before the first page is served.

HELMET is the Wayne State app stack's baseline runtime: one small framework-free PHP core that sends the security headers, hardens the session, decides whether the request really arrived over HTTPS, answers the load balancer's /up ping, and writes structured logs.

Pick your path#

  • New here? The Quick start puts a raw PHP app behind the baseline in four steps.
  • Installing it now? Install has the requirements, the Composer line and the verify step.
  • Looking for a setting or a function? The Reference group starts with Environment variables, every HELMET_ variable the package reads.

Install#

composer require waynestate/helmet

Then boot it once at the top of the front controller, before anything is echoed:

use function Waynestate\Helmet\helmet_boot;

$helmet = helmet_boot([
    'preset' => 'citadel',
]);

helmet_boot() sends the headers, strips X-Powered-By, and answers /up with 200 ok before your code runs. It returns the nonce, the logger and the request ID so the rest of the app can use them.

Version 0.3.0, MIT licensed.

Agents: the machine-readable map of these docs lives at https://helmet.apps.wayne.edu/llms.txt.

Milquetoast is a Helmet song. It is not a Content-Security-Policy.

Every HELMET_ environment variable the package reads, with its meaning, default and the file that reads it, is in the configuration reference.