A product that works is not done, as there are many facets to consider - availability, scalability, security. Of those, security is probably the most costly to get wrong. This talk will build a threat model for a sample web application, showcasing a structured approach to securing your web application. Various vulnerabilities are shown and mitigated, based on current best practices. We take special care to show to eliminate entire classes of vulnerabilities, rather than tackling problems one by one. The code samples will be built on top of Apache Sling, but previous knowledge of Sling is not required. Talk delivered at BaselOne 2023