Ansible battle tested hardening for Linux, SSH, Nginx, MySQL

github.com

75 points by walterbell 6 days ago


ornornor - 3 hours ago

About ansible: I really like the idea and popularity of ansible but find it so painful to use. YAML sucks, and testing is not straightforward (I use molecule in docker containers with geerlingguy’s spécial images)

What’s your workflow for writing tested playbooks?

tuananh - 2 hours ago

I would much prefer to use RHEL/Fedora image mode for this. Use Dockerfile syntax. Immutable. Easy to update/rollback. CIS hardening baked in.

```

[customizations.openscap]

datastream = "/usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml"

profile_id = "xccdf_org.ssgproject.content_profile_cis"

custom_remediate_script_path = "/your/custom/script.sh"

```

yjftsjthsd-h - 13 hours ago

"battle tested" how? Widely deployed? Red teamed and shown to actually help?

TacticalCoder - 10 hours ago

The Linux hardening list lists quite some modifications but what hardening is made to SSH compared to a stock config? For Linux they summarize the list of hardened changes but for SSH I couldn't find it.

For SSH it's basically a list of default values with a comment saying "change this if you must". Some summary as to what is hardened compared to a stock SSH install would be nice.

Spivak - 12 hours ago

These playbooks apply the CIS benchmarks, very very useful for compliance. I use them at $dayjob to build our base AMIs.

As for whether they actually harden your servers, that's up for you to decide if you think that CIS actually helps. It certainly does reduce attack surface.

mhb - 13 hours ago

What does this mean?