Illustration of a default install reduced to only the components actually used, behind a shield

OS Installation and Hardening

Back to Server Setup · Operating System and Stack · Security Settings · Service Offerings

The first step of installation and configuration: a clean install with unnecessary services disabled, security baselines applied, and the attack surface kept to what's actually needed. The principle underneath it is short. Every service you do not run is one you never have to patch, never have to monitor, and never have to explain to an auditor.

1. Start Minimal, Add Deliberately

It is far easier to add a package than to work out whether something installed by default is safe to remove. So we install the smallest base the platform offers and add only what the application needs.

2. Apply a Recognised Baseline, Then Adjust

There is no reason to invent a hardening standard. Published benchmarks and vendor security guides cover the same ground far more thoroughly than anyone does from memory: filesystem mount options, kernel parameters, authentication policy, audit rules, permissions on sensitive files.

What matters is applying one with judgement. A baseline applied blindly breaks applications, and a broken application gets fixed by turning controls off wholesale — ending worse than before. So each deviation from the baseline gets recorded with a reason, which is also exactly what an auditor asks for. Where a compliance regime names a specific benchmark, that choice is already made for you; see security and compliance needs.

3. Accounts, Filesystems and Boot

4. Time, Logging and Auditing From the First Boot

Three things are worth enabling before the machine does anything useful, because they cannot be applied retrospectively:

5. Build It Once, Reproducibly

A hardened machine built by hand is hardened until the next one is built slightly differently. The build belongs in code — a golden image, a configuration management role, or both — so that the tenth server is identical to the first and the configuration can be reviewed like any other change. See infrastructure as code.

That also makes the state checkable. A hardened build drifts: someone opens something during an incident, a package pulls in a dependency that starts a service. Re-running the configuration in check mode, or re-scanning against the baseline periodically, is what keeps the build true rather than merely true on the first day.

What You Get