Servers
Replace servers instead of changing them by hand. Rebuild any server from code, install security updates by themselves, and close every port you do not use.
- Required 2
- Recommended 7
These rules cover virtual machines and rented servers, from a fleet behind a load balancer to one small machine that runs everything. Containers have their own chapter in the operations playbook. How each service runs on the machine is covered in Run each service as its own user and Lock the service in a sandbox.
Required
Install security updates by themselves
INF-46Let every long-lived server install security updates by itself every day, and reboot in a set window when the kernel needs it. Servers you replace instead of patching get a rebuilt image within 24 hours of each security update.
Allow SSH with keys only
INF-48Turn off password logins and direct root logins over SSH. Give each person their own key, and remove it the day they leave.
Recommended
Replace servers instead of patching them
INF-43Build a new machine image for every change, start new servers from it and stop the old ones. Never change a running server by hand.
Configure long-lived servers from code
INF-44When a server lives for months, set up its packages, files and services from code that can run again without changing anything.
Rebuild any server from code
INF-45Keep everything needed to rebuild each server in code, so one command builds a fresh one. Prove it on a new machine in the quarterly restore drill.
Turn on a firewall on every host
INF-47Run a firewall on every server that refuses all incoming traffic except the ports it serves. Allow SSH only from named admin addresses.
Keep server clocks in sync
INF-49Run a time sync client on every server with at least two time sources. Keep every server on UTC, and alert when a clock is more than 1 second off.
Remove services the server does not need
INF-50Install only the packages and services the server's job needs. Remove the rest, and disable what cannot be removed.
Check server images against a hardening checklist
INF-51Scan every server image against a published hardening checklist, such as a CIS Benchmark or a DISA STIG profile. Fail the image build on any failed check without a written exception.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/infrastructure/servers">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.