Securing a web application: a checklist that actually ships
Most breaches are not exotic. They are a missing access check, an old dependency, a leaked key or a SQL string built by hand. Close those and you have done most of the work.
Authentication
- Hash passwords with bcrypt or argon2. Rate-limit login and password reset.
- Session cookies
httpOnly,secure,SameSite. Rotate on privilege change.
Authorisation
Check permission on every request, server-side, against the resource owner — not just "is logged in". Hiding a button is not access control.
Input and output
- Parameterised queries everywhere. No string-built SQL.
- Validate and type-coerce every input at the boundary. Escape on output; set a Content-Security-Policy.
- Lock down file uploads by type and size; serve them from a path that enforces an ownership check.
Supply chain and secrets
Automated dependency scanning in CI. Secrets in a manager or environment, never in the repo. Least-privilege database and cloud credentials.
Observability
Log auth events and admin actions. Alert on spikes in 4xx/5xx and on new error signatures. You cannot respond to what you cannot see.
Security headers worth setting
- Strict-Transport-Security — forces HTTPS.
- Content-Security-Policy — limits where scripts and other resources can load from. Test it carefully: a policy that is too strict silently breaks analytics, fonts or payment widgets, so check the browser console after every change.
- X-Content-Type-Options, Referrer-Policy and frame-ancestors — cheap protections against common attacks.
Admin panels
Admin areas are high-value targets. Use strong unique passwords and two-factor authentication, keep admin accounts personal rather than shared, log every admin action, and consider restricting the admin path by IP or VPN. Ask for confirmation before destructive actions like deleting records.
Payments and personal data
Let the payment gateway handle card data so it never touches your servers. Verify payment callbacks with the gateway's signature or hash — never trust a "payment successful" redirect on its own. Collect only the personal data you need, and know where it is stored and who can access it.
Backups and incident response
Keep automated off-site backups, test restoring them, and write down what to do if you are breached: who to call, how to rotate keys, how to inform affected users. When a secret leaks — for example in a code repository — rotate it immediately; deleting the file is not enough.
Make it routine
Review this checklist at every release, keep dependencies updated monthly, and get an external review before handling sensitive data at scale.
Talk to us
Want security updates and monitoring handled for you? See our website maintenance plans, or get a free quote — we reply within one business day.