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 5
- Recommended 1
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
Configure long-lived servers from code
RequiredWhen 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
RequiredKeep 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.
Install security updates by themselves
RequiredLet every server install security updates by itself every day, and reboot in a set window when the kernel needs it.
Turn on a firewall on every host
RequiredRun a firewall on every server that refuses all incoming traffic except the ports it serves. Allow SSH only from named admin addresses.
Allow SSH with keys only
RequiredTurn 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
RecommendedBuild a new machine image for every change, start new servers from it and stop the old ones. Never change a running server by hand.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers infrastructure playbook: https://agentwranglers.se/playbook/infrastructure/servers.