Skip to content
D-bug Station

Security Basics Every App Should Ship With

3 min read
  • Security
  • DevOps
  • Architecture

Most breaches in small products are not clever attacks. They are basics nobody got round to.

Most security incidents in small and growing products are not sophisticated attacks. They are basics that nobody got round to: a key in the code, a check that only happened in the app, a backup that had never been restored. These are the things every app should ship with.

Keep secrets out of the code

API keys, database passwords and signing keys do not belong in the repository or inside the app. Anything shipped in a mobile app or a web page can be extracted. Keep secrets on the server, load them from the environment, and rotate any that have ever been committed.

Check everything on the server

The app is not a security boundary. Prices, permissions, payment confirmations and "is this user allowed to see this record?" must be decided on the server, every time. A request can be crafted to say anything; the server must not believe it.

Authentication done properly

  • Hash passwords with a modern algorithm, never store them readable.
  • Use short-lived sessions or tokens, and make logging out actually end the session on the server.
  • Rate-limit sign-in and one-time-code attempts.
  • Offer two-factor sign-in for admin accounts at the very least.

Least privilege

Each person, service and API key should have only the access it needs. A support agent does not need to delete data; a reporting job does not need to write to the database. When something is compromised, least privilege limits the damage.

Keep dependencies current

Most products are mostly other people's code. Libraries publish security fixes regularly, and automated tools can flag known vulnerabilities. Updating in small, regular steps is far safer than one large upgrade after a problem becomes public.

Backups you have restored

A backup that has never been restored is a hope, not a backup. Schedule them, keep a copy somewhere separate, and test a restore regularly so you know how long it takes.

Logs that answer questions

Record sign-ins, permission changes, admin actions and errors, without writing passwords or personal data into the logs. When something looks wrong, you need to know what happened and when.

HTTPS and security headers everywhere

Encrypt every connection, and set the standard browser security headers on web products. Both are cheap and close off whole categories of problems.

Security hardening is part of how we set up infrastructure and releases for every product we build. For AI features, prompt injection adds a new item to this list.

Building something along these lines?