Most teams harden servers one at a time, by hand, under pressure. The result is drift: two systems that should be identical end up with different settings, different packages, and different exposure. The fix is a baseline that you can apply everywhere and update in a controlled way.
This guide covers how to build a baseline once, keep it readable, and apply it across your fleet without getting buried in process.
1. Choose a baseline standard
Start with a known standard and tailor it to your environment. You do not need to implement every control to get value.
Practical options:
- CIS Benchmarks for your OS (Linux or Windows).
- AWS security best practices for EC2 workloads.
Reference:
2. Define a minimal baseline
Your baseline should be short, clear, and easy to verify. Aim for controls that reduce real risk.
Recommended baseline items:
- Disable password-based SSH and require keys.
- Enforce OS patching and reboot strategy.
- Restrict inbound ports to only what the service needs.
- Configure time sync and log forwarding.
- Remove unused packages and services.
Reference:
3. Build hardened images, not manual steps
The cleanest way to apply a baseline is to bake it into images.
Practical approach:
- Use EC2 Image Builder or Packer to create hardened AMIs.
- Version your images and tag them by baseline version.
- Do not allow ad-hoc AMIs for production.
Reference:
4. Enforce config at runtime
Images are a starting point. You still need to ensure the baseline stays in place.
Practical approach:
- Use AWS Systems Manager to apply and verify settings.
- Run a daily or weekly compliance check to detect drift.
- Alert when critical settings change.
Reference:
5. Lock down access paths
Hardening is not just OS config. Access paths are part of the baseline.
Practical steps:
- Use SSM Session Manager instead of SSH where possible.
- Restrict SSH to a single management subnet or bastion.
- Rotate SSH keys on a schedule.
Reference:
6. Centralize logs and auditing
If hardened systems do not report their state, you will miss problems.
Practical steps:
- Forward system logs to CloudWatch Logs or a central log account.
- Enable audit logs (for example,
auditdon Linux). - Monitor for privilege escalation and repeated auth failures.
Reference:
7. Keep the baseline small and versioned
Baselines should change over time. The key is to keep changes explicit.
Practical steps:
- Version the baseline in git.
- Release baseline updates on a schedule.
- Track which systems run which baseline version.
8. Build a clear exception process
Some systems need exceptions. The process should be simple and traceable.
Practical steps:
- Document why the exception exists.
- Set an expiration date.
- Review exceptions quarterly.
Closing thought
Hardening baselines are about consistency. If you can create a clear baseline, build it into your images, and verify it at runtime, you will cut risk without slowing delivery.
If you want help building or tuning your baseline, we can help. We focus on pragmatic controls that fit your team and your systems. Reach out through our consulting page to start a quick conversation.