Content Security Policy sounds intimidating, but its core idea is simple: tell the browser where scripts may come from.
Trust nothing that crosses a boundary
We review dependency updates like code, because they are code. A weekly job opens one pull request with the changelog links attached.
- Escape late, at the point of output
- Start CSP in report-only mode
- Review dependency updates weekly
- Require two-factor for deploy access
Security is a process, not a product.
Bruce Schneier
Headers that do real work
Two-factor authentication is on for every account that can deploy, and shared passwords live in a manager, not in a chat thread.
Sanitise on the way in, escape on the way out, and do both as late as possible. That one rule covers most of the bugs we find in reviews.
Clear and practical, thank you. One question: how long did the whole change take from start to finish?
I shared this with my team. The list near the end is going straight into our onboarding doc.
Good question. It took about three weeks, most of it waiting for review and measuring the results.
This is exactly the write-up I needed this week. We hit the same problem and ended up with a much messier fix.
Good question. It took about three weeks, most of it waiting for review and measuring the results.
This is exactly the write-up I needed this week. We hit the same problem and ended up with a much messier fix.
Glad it helped. A follow-up is on the list, so keep an eye on the blog.
Good question, I was wondering that too.
Nice to read something that admits the first attempt did not work. That is how it goes in real projects.
Bookmarked. The part about writing things down before changing anything is underrated.
Glad it helped. A follow-up is on the list, so keep an eye on the blog.
Great post. Did you measure this on a real phone as well, or only with throttling in the browser?