Structured Logging That Survives Production
How to make logs useful under real traffic: correlation IDs, JSON event shape, sampling rules, and PII redaction that does not depend on everyone remembering.
Tiny explainers grouped by topic. Spend less time Googling, more time building.
How to make logs useful under real traffic: correlation IDs, JSON event shape, sampling rules, and PII redaction that does not depend on everyone remembering.
Cert chains, renewals, mTLS, HSTS, and handshake debugging, explained from the operator’s side.
What actually breaks in CORS, which headers matter, and the server configs that fix browser errors without accidentally opening your API.
Env vars are only the beginning. This covers secret managers, rotation, least privilege, and delivery patterns that do not leak credentials across your stack.
CSRF never really left. Here’s how SameSite cookies, synchronizer tokens, custom headers, and Fetch Metadata fit together in modern apps.
Most teams do not need every authorization model. This shows where RBAC, ABAC, and ReBAC fit, and what gets painful later if you pick the wrong one.
What shipping passkeys actually involves: registration, sign-in, recovery, account settings, and the RP ID/origin mistakes that break rollouts.
Three ways to carry auth state, three different tradeoffs. Here’s where session cookies, JWTs, and PASETO fit without stateless-auth cargo culting.
The auth stack most teams inherit, minus the jargon: code + PKCE, refresh tokens, ID tokens, and machine-to-machine flows that actually matter.
A battle‑tested checklist and patterns: allowlists, size limits, magic‑byte checks, streaming to object storage, virus scanning, image/PDF sanitization, signed URLs, and safe download headers.
Practical, modern defaults for CSP, HSTS, Referrer-Policy, Permissions-Policy, COOP/COEP/CORP, X-Content-Type-Options, X-Frame-Options vs frame-ancestors, cookies, and cache controls—with NGINX/Apache/Express snippets.
Fixed/sliding windows, token & leaky buckets, GCRA, and real-world implementations (Redis, NGINX, Envoy). Covers headers, bursts, backoff, multi‑DC, and tuning.
Design access + refresh flows that are safe: short-lived access tokens, rotating refresh tokens with reuse detection, device-scoped sessions, and practical revocation strategies.
Multi-stage builds, cache-friendly layering, non-root users, and sane defaults for ENTRYPOINT/CMD, healthchecks, and secrets. Copy‑paste patterns for Node, Python, and Go.
Use Argon2id (or bcrypt) with unique per‑user salts, optional KMS‑backed pepper, and safe on‑login migrations. Includes copy‑paste snippets for Node, Python, and Go.
A diagram-first walkthrough of OAuth 2’s Authorization Code + PKCE flow: who does what, how the redirects work, and where the tokens end up.
Why you shouldn’t commit .env files, how to handle secrets differently in local, staging, and production, and the exact patterns to inject, validate, rotate, and audit configuration safely.
Base64 turns bytes into ASCII text for transport and storage. It is not a security mechanism. Learn how it works, common uses (MIME, URLs, JWTs), and what to use instead when you need secrecy or integrity.
A clear, practical comparison: authN proves who you are; authZ decides what you can do. Learn identities, sessions/tokens (OIDC/OAuth2), roles/scopes/permissions, and common pitfalls.
.env files are fine for some jobs and a liability for others. Here’s where they fit, where they don’t, and how to keep secrets out of repos and images.
Generate a key, load it into `ssh-agent`, add it to a server, and clean up your SSH config without the usual trial and error.
Demystify the TLS handshake—ClientHello, ServerHello, certificates, ECDHE key exchange, session keys—and why HTTPS protects confidentiality, integrity, and authenticity.
Where a gateway earns its keep, where a reverse proxy is enough, and why pushing business logic to the edge usually backfires.
A fast primer on Cross-Origin Resource Sharing—what “origin” means, how simple vs. preflighted requests work, when to send credentials, and the exact headers that fix the dreaded CORS error.
DMARC tells inboxes what to do when email fails SPF/DKIM checks — and sends you reports so you can fix issues.
SPF says who can send. DKIM signs the message. Use both for deliverability.