A solid starting point for locking down Linux boxes with CIS-aligned configs. Covers the usual suspects: SSH hardening (no root login, key-based auth only), firewall rules via UFW or iptables, kernel parameter tweaks in sysctl, and auditd for tracking changes to sensitive files. The examples are copy-paste ready, which is helpful when you're setting up a new production server or trying to pass a compliance audit. It won't do everything for you, but it gives you the essential commands and config snippets in one place. Pair it with fail2ban and SELinux/AppArmor as suggested and you've got a reasonable baseline for most deployments.

skills.sh installs
832
GitHub stars
1.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add bagelhole/devops-security-agent-skills --skill linux-hardening --agent claude-code

Installs into .claude/skills of the current project.

Files

Linux Hardening

Secure Linux servers following CIS benchmarks and security best practices.

When to Use This Skill

Use this skill when:

  • Hardening production servers
  • Meeting compliance requirements
  • Implementing security baselines
  • Configuring secure SSH access

SSH Hardening

# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
AllowUsers deploy admin
Protocol 2

User Security

# Password policy
sudo apt install libpam-pwquality
# /etc/security/pwquality.conf
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1

# Lock inactive accounts
useradd -D -f 30

# Audit sudo usage
echo "Defaults logfile=/var/log/sudo.log" >> /etc/sudoers

Firewall Configuration

# UFW setup
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 443/tcp
ufw enable

# Or iptables
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

Kernel Hardening

Sponsors

Details

Repository
github.com/bagelhole/devops-security-agent-skills
Categories
Security, DevOps & CI/CD, AI & Agent Building
First seen
Jun 3, 2026

More from bagelhole/devops-security-agent-skills

All 2

Recommended

More Security
1aradotso avatarzen-ai-pentest-frameworkaradotso/security-skillszen ai pentest framework676skills.sh installs
2wshobson avatark8s-security-policieswshobson/agentsImplement Kubernetes security policies including NetworkPolicy, PodSecurityPolicy, and RBAC for production-grade security. Use when securing Kubernetes clusters15.1Kskills.sh installs
3affaan-m avatarsecurity-reviewaffaan-m/eccUse this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provid7.6Kskills.sh installs
4affaan-m avatarspringboot-securityaffaan-m/eccSpring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.6Kskills.sh installs
5trailofbits avatarcosmos-vulnerability-scannertrailofbits/skillsScans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC +5.7Kskills.sh installs
6affaan-m avatarllm-trading-agent-securityaffaan-m/eccSecurity patterns for autonomous trading agents with wallet or transaction authority. Covers prompt injection, spend limits, pre-send simulation, circuit breake5.6Kskills.sh installs