Headers, TLS and secrets
Secure defaults at the transport and browser layers reduce the blast radius.
What you will be able to do
- Redirect HTTP to HTTPS and send HSTS only after the site is fully HTTPS.
- Use a restrictive CSP and report violations.
- Rotate secrets and keep the service key server-only.
In plain English
HTTPS protects data in transit. HSTS prevents downgrade. Content Security Policy limits injected script. Cookies need secure flags. Secrets belong in a secret manager, not in Git, client bundles or logs.
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'; frame-ancestors 'none'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()Your turn
EasyAdd a secure header set
Write four headers that reduce MIME sniffing, framing and referrer leakage.
HTTP · starter
Content-Type: text/htmlCheck your understanding before moving on.
Knowledge checkQuestion 1
What does HSTS tell a browser?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.