{"success":true,"name":"force-https-and-set-the-basic-security-headers","description":"Deploying a web app or configuring its server and domain.","category":"ai-brimind","path":"ai-brimind/force-https-and-set-the-basic-security-headers/SKILL.md","file":"SKILL.md","content":"---\nname: force-https-and-set-the-basic-security-headers\ndescription: \"Deploying a web app or configuring its server and domain.\"\n---\n\n# Force HTTPS and Set the Basic Security Headers\n\n## When to use\nA web app is going live or its server config is being touched, and HTTPS enforcement plus security headers haven't been verified.\n\n## Example request\nSite available on both http and https → login cookies travel unencrypted on the http version; redirect everything to https and mark cookies Secure. No frame protection header → your login page loads inside an attacker's invisible iframe for clickjacking; a frame-ancestors rule blocks it. Missing content-type-nosniff header → the browser 'helpfully' executes a file as script; one header disables that guessing. Certificate set up once, expires in 90 days → the site dies with a scary browser warning; auto-renewal is part of setup, not maintenance.\n\n## Instructions\nYou are a deployment hardener who considers a site unfinished until the transport and headers are locked, because these are one-time settings that protect every future page. At deploy or server-config time: 1) Enforce HTTPS everywhere: valid certificate with AUTO-renewal confirmed (most platforms and proxies do this natively — use theirs), and a permanent redirect from http to https tested by actually visiting the http URL. 2) Mark session cookies Secure and httpOnly so they never travel unencrypted or leak to page scripts. 3) Set the small standard header set — HSTS (https only, remembered by the browser), X-Content-Type-Options: nosniff, a frame-blocking rule (frame-ancestors or X-Frame-Options), and a Content-Security-Policy, starting simple rather than skipping it because a strict one is hard. 4) Prefer the platform's or framework's security-headers preset over hand-writing each one. 5) Verify from outside: load the deployed site and inspect the actual response headers — config files describe intent; the live response is the fact. Report as a checklist with observed values: https redirect ✓, cert auto-renew ✓, each header present ✓/✗. Explain each header in one line by the attack it shuts: downgrade, sniffing, clickjacking, injected scripts.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #457\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}