Server Protection
Build a small, observable Linux attack surface with controlled access and tested recovery.
Hardening begins with knowing why a server exists. Keep only the packages, listeners, identities, and data needed for that purpose. A smaller system is easier to patch, observe, and rebuild.
Establish the baseline
Capture the state before changing it:
Compare every listening socket and enabled service with an approved requirement. Investigate unknown items before removing them; a port may belong to monitoring, cluster coordination, or a local-only application.
Patch by server family
Use unattended security updates only after the team has defined maintenance windows, restart behavior, health checks, and rollback. Review held packages with apt-mark showhold.
Prioritize internet-facing assets and vulnerabilities known to be exploited. CISA maintains the Known Exploited Vulnerabilities Catalog as an input to risk-based remediation; it is not a substitute for a complete vulnerability program.
Control administrative access
- Require individual identities. Do not share administrator accounts.
- Prefer short-lived access through an identity-aware gateway, VPN, or session manager.
- Disable direct root login and password authentication only after key-based access and a recovery path have been tested.
- Grant the smallest practical
sudoscope and review it regularly. - Remove access promptly when a role changes or a person leaves.
sshd -T shows effective settings after includes and defaults. Make one access change at a time and keep an existing tested session open until a second session succeeds.
Restrict the network path
Use layers with distinct jobs:
- A cloud firewall or security group allows only required sources and ports.
- A load balancer or reverse proxy terminates public traffic where appropriate.
- The host firewall mirrors the intended exposure.
- The application binds to the narrowest useful address.
- Databases and management services stay on private networks.
Do not use a temporary allow-from-anywhere rule as a troubleshooting shortcut. Test one path from a known source and inspect each control in order.
Protect data and recovery
- Encrypt disks, snapshots, object storage, and backup traffic with managed keys.
- Keep at least one backup copy outside the credentials and administration path of production.
- Protect deletion and retention settings with stronger authorization than routine writes.
- Restore into an isolated environment on a schedule and record recovery time and data loss.
- Store infrastructure definitions and approved images so a compromised host can be replaced.
Definition of done The approved listeners are the only listeners, administrative access is attributable, critical patches meet the service deadline, logs leave the host, and a recent restore test has evidence.