Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,110 of 9,110 pages
About the help in other languages
All help pages

Hardening an Exponential site for a public body

For administrators and hosting teams of public sites - the hardening layers of Exponential in the order to work through them (web server, settings and secrets, administration, sign-in, sessions, headers, CSP, uploads…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/security/hardening-overview.md

On this page

Hardening an Exponential site for a public body

This page is for administrators, developers and hosting teams who prepare a public site for production. It orders the hardening work into layers and points to the detailed page for each. The project's two sources are Security hardening, the attacker-minded guide, and Chapter 13: Security hardening for production, the setting-by-setting reference. Since September 2026 a default installation is safe without extra work; hardening means keeping those defaults and closing what is left to the operator.

Warning

.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and page loading times go up drastically (measured). The only real fix is to switch the feature off for the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes to optimize a production configuration. Switch over right away: copy the rules of the example HTTPS virtual host into your virtual host (with the static cache, also staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and test the site. The same rules for other servers: nginx, LiteSpeed, Caddy, IIS, Velocity (built in); where virtual host rules go in a control panel: Plesk, cPanel, DirectAdmin, ISPConfig. On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.

Contents

  1. The principles
  2. The layers, in order
  3. What not to do
  4. Related pages

The principles

The hardening guide follows the OpenBSD yardstick: secure by default, least privilege, privilege separation, minimal attack surface, audit, and fixing forward in public (Principles: secure by default). For a public body the practical meaning is: do not loosen a default to make something work; find the cause.

The layers, in order

LayerDoPage in this section
1. Web servercurrent rewrite rules (.htaccess_root or the derived nginx block; ./console exp:setup:htaccess exits 1 when .htaccess has drifted); nothing below the root executed; dot files 404File uploads and SVG; HTTPS and HSTS
2. Secretssettings/override/ and config.php never in version control, mode 0640, backed up as a secret; old copies in var/backup/ removedSecrets in settings/override; config.php from the console
3. Administrationits own host name, restricted by network or a second authentication, RequireUserLogin=true, setup wizard closedSeparating the administration
4. Accountsone personal account per person, admin retired, least-privilege rolesRoles and least privilege
5. Sign-intwo-step sign-in, password policy, lockout decisionTwo-step sign-in; Password policy; Account lockout
6. SessionsCookieSecure=true, sensible timeout, separate cookie per siteaccessSessions and cookies
7. Headers and TLSsecurity headers present, HTTPS everywhere, HSTS when stableSecurity headers; HTTPS and HSTS
8. Content Security Policyreport-only, then enforce on the administration, then on sitesContent Security Policy; From report-only to enforce
9. Formsezformtoken activeCSRF and form tokens
10. DebugDebugOutput=disabled, PHP display_errors=OffDebug output in production
11. Filesone writer, no world-writable files, code read-onlyFile permissions and ownership
12. Configuration lockManagedByDeployment=enabled where configuration comes from version controlConfiguration managed by the deployment
13. A shield in frontrequest-shield, enforcing as installed (6.0.15); hook in config.php, site rules in settings/request-shield/request-shield; Setup > Request shield
14. Loggingaudit cronjob running, alert recipients, SIEM forwarding, weekly reviewAudit trail; Log review routine
15. Updatesfollow releases, test in a copy, composer audit, file consistency checkPatching cadence; File consistency check
16. Recoverybackups off the machine, restore testedBackups and recovery

What not to do

  • Do not set CheckValidity=true or AllowWizardOnInstalledSite=enabled on a live site.
  • Do not widen TrustedProxies[] to a provider network or 0.0.0.0/0 (13.10).
  • Do not add 'unsafe-inline' to the administration's policy to silence reports without knowing their source.
  • Do not run cronjobs or the console as root except for the documented tasks.
  • Do not give the Administrator role to colleagues "for a moment"; make a role.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x