Security
Static websites: less technology, less attack surface
Most company websites change a few times a month but run on systems that query a database on every visit. A static website turns this around: it is built once and then only delivered.
In short
- On the server, a static website consists only of finished files, without a database or login page.
- This eliminates whole classes of attacks, such as SQL injection on the content management system or insecure plugins.
- Dynamic features such as forms are added deliberately and separately, not shipped by default.
What it is about
Many company websites run on a content management system that executes program code and queries a database on every page view. That is convenient, but it has a price: login page, database, extensions and themes all sit on the public server and all have to be maintained. Each of them is a possible door for attackers.
Yet most B2B websites change only a few times a month. A static website takes advantage of this. It is built once from texts and templates into finished HTML files and then only delivered. On the server, there is nothing that computes or writes during a visit.
How it works
A static site generator takes content, such as text files in several languages, and design templates, and creates all pages, the sitemap, preview images and search indexes from them. The result is a folder with HTML, CSS, images and little JavaScript. This folder is reviewed, approved as a package and uploaded.
The OWASP cheat sheet on attack surface analysis recommends knowing every entry point of an application and removing unnecessary ones. A static website is the consistent implementation: without a database there is no SQL injection on the content management system, without a login page no guessed passwords, without plugins no flaws in extensions. Where dynamic features are needed after all, such as an acceptance page for quotes or an inquiry form, they are added as small, separate modules that can be reviewed and secured specifically.
Where it goes wrong
The most common objection is maintenance. Anyone used to editing texts in the browser has to rethink. Content is maintained in files and published through a build. With a clear process of change, review and approval, this is not a drawback but a gain in traceability, because every version is under version control.
A second misunderstanding: static does not automatically mean secure. A static website also needs security headers, a Content Security Policy, TLS and a clean server configuration. The advantage is that these measures are much easier to implement, because there are hardly any exceptions. And the dynamic modules deserve special attention, because they are the only places where data is accepted.
How to proceed
Check which parts of your website really have to be calculated on every request. Usually it is only forms. Build the rest statically and deliver it as finished files. Keep editing and building separate from the public server. Add dynamic features as small modules in their own directories with their own review. Set strict headers and a strict CSP. And have the remaining modules tested regularly.
Read more: Running WordPress securely: hardening, plugins, updates, Content Security Policy in practice: step by step to a strict CSP and Credentials in projects: what never belongs in the repository.
How Airnite helps
We build fast, statically generated websites with several languages, SEO foundations and strict security headers. Where forms or acceptance pages are needed, we add them as separate, reviewed modules. We analyse existing websites for unnecessary attack surface in a penetration test.
Checklist
Sources
Every fact in this article is based on the following publications. Primary sources are marked.
- OWASPAttack Surface Analysis Cheat Sheet
- OWASPOWASP Top 10:2025
- web.dev (Google)Rendering on the Web
Matching services
Read on
Running WordPress securely: hardening, plugins, updates
WordPress itself is rarely the problem. The problem is the slider plugin nobody has used for three years, and the admin account called "admin".Security3 minContent Security Policy in practice: step by step to a strict CSP
Many websites have a Content Security Policy that allows everything and therefore protects nothing. A strict CSP is not rocket science, but it needs a clean inventory and a fixed process for every change.Security3 minCredentials in projects: what never belongs in the repository
An upload key in a configuration file, a password in a script: what is convenient quickly ends up in the version history and stays there. Separating secrets cleanly closes one of the most common gaps in software projects.Current incidents and warnings are covered in the Zero Day magazine. Go to the magazine