Security
The security basics AI-built apps skip — secrets, logins, row-level security, bot abuse — and the isolation that keeps untrusted code contained.
140 posts · page 3 of 6
What Is a Man-in-the-Middle Attack? And How HTTPS Stops It
In a man-in-the-middle attack, someone positions themselves between two parties to read or change what they send. Where it happens (public Wi-Fi, rogue hotspots, compromised routers), how HTTPS and certificates defeat it, HSTS, and what developers must not do — like disabling certificate checks.
localStorage vs sessionStorage vs Cookies: Where Should You Store It?
Three ways to store data in the browser, with different lifetimes, sizes and security properties. What each one is for, why login tokens shouldn't go in localStorage, the size limits, and a simple rule for choosing.
Linux Capabilities: Splitting Root Into Pieces
Linux capabilities break root's power into about 40 separate privileges, so a process can have just the one it needs. The capability sets (permitted, effective, inheritable, bounding, ambient), file capabilities with setcap, Docker's default set and --cap-drop ALL, why CAP_SYS_ADMIN is 'the new root', and inspecting capabilities.
Landlock: Unprivileged Sandboxing Built Into the Linux Kernel
Landlock lets an unprivileged process restrict its own filesystem and network access, permanently, for itself and its children. How rulesets, access rights and ABI versions work, a minimal C/Rust-style walkthrough, how it compares with seccomp, namespaces and AppArmor, and why coding agents use it.
JWKS and Signing Key Rotation for JWTs
If your JWTs are signed with one secret that never changes, a single leak lasts forever. How asymmetric signing and JWKS endpoints work, the kid header, a zero-downtime rotation schedule, caching and refetch rules for verifiers, emergency revocation, and the verification mistakes that turn JWKS into an attack vector.
io_uring and Security: Why Sandboxes Turn It Off
io_uring made Linux I/O dramatically faster — and became one of the kernel's biggest sources of privilege-escalation bugs. How io_uring works, why it sidesteps seccomp filtering, which platforms disable it, the io_uring_disabled sysctl, restriction APIs, and what to do for containers and code sandboxes.
Hashing vs Encryption vs Encoding: What's the Difference?
Three ways to transform data that people mix up constantly — sometimes with security consequences. Encoding changes format (Base64), encryption hides data with a key you can reverse, hashing makes a one-way fingerprint. What each is for and the mistakes to avoid.
GitHub Actions Secrets: How to Store and Use Them Safely
GitHub Actions secrets keep API keys, tokens and passwords out of your code while letting workflows use them. How to add repository, environment and organisation secrets, use them in a workflow, secrets vs variables, the fork and pull_request_target pitfalls, and OIDC instead of long-lived keys.
How to Get a Claude API Key (and Keep It Safe)
Step by step: create an account on the Claude Developer Platform, add credits, create an API key, set a spend limit, and make your first request. Plus the difference between an API key and a Claude subscription, and where to store the key so it never leaks.
fail2ban: Automatically Ban IPs That Attack Your Server
fail2ban watches your logs for repeated failed logins and other abuse, then bans the offending IPs with the firewall. Install and configure jail.local, protect SSH and Nginx, check and unban IPs, write a simple custom filter, and know what fail2ban does and doesn't protect against.
DNS Rebinding Attacks: How a Website Reaches Your localhost
DNS rebinding lets a malicious web page send requests to services on your machine or private network — dev servers, admin panels, local MCP servers, routers — despite the same-origin policy. How the attack works step by step, why SSRF filters fall to it too, and the defences: Host header checks, authentication, binding, and resolve-then-pin.
Dependabot Explained: Automatic Security and Version Updates on GitHub
Dependabot watches your project's dependencies, alerts you to known vulnerabilities and opens pull requests to update them. The three features (alerts, security updates, version updates), a dependabot.yml example with grouping and cooldowns, and how to handle the PRs without drowning.
Do You Need a Cookie Banner? A Plain-English Guide for Small Apps
Cookie banners are required when you set non-essential cookies or trackers for EU and UK visitors — not for every cookie. What counts as essential, when you need consent, what a compliant banner must do, and how to avoid needing one at all.
What Is Clickjacking? And the One Header That Stops It
Clickjacking tricks a user into clicking something on your site while they think they're clicking something else, by loading your page invisibly inside an attacker's page. How it works, what it can do, and the fix: CSP frame-ancestors and X-Frame-Options — with examples for Nginx, Next.js and Express.
Clerk vs Auth0 vs Supabase Auth: Which Should Handle Your Logins?
Three popular ways to add authentication to an app. How Clerk (drop-in UI, great DX), Auth0 (enterprise features) and Supabase Auth (bundled with your database) compare on setup, features, pricing model, data ownership and lock-in — plus when an open-source library like Better Auth fits.
Claude Code Security Review: /security-review, the Security Plugins, and When to Use Each
Claude Code has several layers of security checking: the /security-review command for your branch, a security-guidance plugin that reviews code as Claude writes it, a Claude Security plugin for deep scans, and Code Review on pull requests. What each catches and how to use them on an AI-built app.
The Claude Code Sandbox: Limit What Shell Commands Can Touch
Claude Code's built-in sandbox wraps the shell commands Claude runs in an OS-enforced boundary: writes limited to your project, network only to allowed domains. How to turn it on, auto-allow mode, allowWrite, denyRead, allowedDomains, excludedCommands, credential masking, and what runs outside it.
Certbot and Let's Encrypt: Free HTTPS for Nginx, Step by Step
Get a free HTTPS certificate from Let's Encrypt with Certbot and Nginx: install, issue for several domains, automatic renewal and how to test it, wildcard certificates with DNS challenges, rate limits, shorter certificate lifetimes, and fixing common Certbot errors.
Bubblewrap (bwrap): Building Unprivileged Sandboxes From Namespaces
Bubblewrap is the small, unprivileged sandboxing tool behind Flatpak and several AI coding agent sandboxes. How it assembles a sandbox from user, mount, PID and network namespaces, practical bwrap command lines, adding seccomp, network allow-listing via a proxy, the Ubuntu AppArmor user-namespace restriction, and its limits.
What Is a Brute Force Attack? And How to Protect Your App
A brute force attack tries huge numbers of passwords or keys until one works. The variants — dictionary attacks, credential stuffing, password spraying, SSH bots — and the defences that work: rate limiting, lockouts, 2FA, strong hashing, breached-password checks and SSH keys.
How to Generate and Manage API Keys for Your Users
Letting customers call your API means issuing API keys. How to generate secure keys, prefixes that make them identifiable and scannable, storing only a hash, showing the key once, scopes and expiry, rotation, rate limits per key, logging usage, and revoking keys.
API Authentication Methods: API Keys, Sessions, JWTs, OAuth and mTLS
How should clients prove who they are to your API? API keys for server-to-server, session cookies for your own web app, bearer tokens for mobile and SPAs, OAuth for third-party access, HMAC signatures for webhooks, mTLS for service meshes. When to use each and how to do it safely.
AI Guardrails Explained: Keeping an AI Feature Safe and On-Topic
Guardrails are the checks around an AI model that stop it going off-topic, leaking data, producing harmful content or being tricked by users. The main kinds — input checks, output checks, permissions, limits and human review — and a practical set for a small AI app.
401 vs 403: Unauthorized vs Forbidden, Explained
401 means 'we don't know who you are' — log in or send valid credentials. 403 means 'we know who you are, and you're not allowed'. How to tell them apart, the common causes of each, how to fix them as a user or developer, and when to return 404 instead.