| name | security-hardening |
| description | Use when hardening servers or cloud environments. Covers CIS benchmark implementation, OS-level hardening (SSH, firewall, fail2ban), cloud security posture, audit logging, compliance checks, and vulnerability scanning workflows. |
| user-invocable | false |
| allowed-tools | ["Read","Write","Bash","Grep"] |
Security Hardening
SSH Hardening
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
LoginGraceTime 30
AllowUsers deploy admin
Protocol 2
X11Forwarding no
AllowTcpForwarding no
ClientAliveInterval 300
ClientAliveCountMax 2
Firewall (iptables/nftables)
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp comment 'SSH'
ufw allow 80/tcp comment 'HTTP'
ufw allow 443/tcp comment 'HTTPS'
ufw enable
OS Hardening Checklist
Best Practices
- Patch regularly — Enable auto security updates
- Minimal attack surface — Remove unneeded packages/services
- Audit logging — Log all privileged actions
- Network segmentation — Isolate by function and sensitivity
- MFA everywhere — SSH, cloud console, VPN access
- Vulnerability scanning — Regular scans with OpenVAS, Nessus, or Qualys
- Compliance checks — CIS benchmark scanning with tools like Lynis
- Incident response — Documented and tested IR procedures