Skip to content

HSTS preload — alert when the header disappears after a deploy

Site is on the HSTS preload list, but after an nginx refactor the header is gone. In 3 months the domain will be removed from the preload list. Need a daily check.

Recipe

bash
#!/usr/bin/env bash
# Wrap as HTTP endpoint or run as a heartbeat-fed cron job.
URL="${1:-https://example.com}"
H=$(curl -sI -o /dev/null -w "%header{strict-transport-security}" "$URL")

[ -z "$H" ] && { echo "missing"; exit 1; }
echo "$H" | grep -q "preload"   || { echo "no-preload"; exit 1; }
echo "$H" | grep -q "max-age=31536000\|max-age=63072000" || { echo "max-age-low"; exit 1; }
echo "$H" | grep -q "includeSubDomains" || { echo "no-subdomains"; exit 1; }
echo "ok"

Same thing in Enterno.io

Already baked into Security Scanner — and into the Enterno SSL monitor via `assert_body`. Best paired: the scanner audits the policy deeply, the monitor pings you on regression instantly.

Set up Security Scanner → ← All recipes

Related recipes