Harden the home lab with UFW firewall rules, fail2ban, SSH lockdown, and container security practices.
Ships in home-lab-developer-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when the user wants to:
homelab_piStatus for system overview, homelab_networkInfo for open ports and interfaces, and homelab_sshTest to verify connectivity.sudo ufw default deny incomingsudo ufw allow 22/tcpsudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow from 192.168.1.0/24 to any port 9090 proto tcp # Cockpit
sudo ufw allow from 192.168.1.0/24 to any port 9000 proto tcp # Portainer
sudo ufw enablesudo ufw status verbose.sudo apt install fail2ban/etc/fail2ban/jail.local with:
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
findtime = 600
[nginx-proxy-manager]
enabled = true
port = http,https
filter = npm
logpath = /opt/homelab/docker/nginx-proxy-manager/data/logs/fallback_access.log
maxretry = 5
bantime = 3600
homelab_systemdControl with unit: "fail2ban", action: "restart" and confirm: true, then confirm with homelab_fail2banStatus.ssh-management skill for detailed steps).homelab_nodeExec with node: "default" (or the target node), command: "sudo sshd -t && sudo systemctl reload ssh" and confirm: true.user: "1000:1000" in compose files.read_only: true with explicit tmpfs mounts for writable paths.cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
mem_limit and cpus.tecnativa/docker-socket-proxy instead of mounting /var/run/docker.sock directly.GRANT_SUDO=false for Code Server.SIGNUPS_ALLOWED=falseADMIN_TOKEN=<argon2-hash>homelab_serviceHealth to confirm all services are still running after hardening. Call homelab_networkInfo to verify firewall state.cap_drop, read_only, user, security_optUser: "Set up UFW on my Pi and configure fail2ban for SSH."
Agent response:
homelab_sshTest to confirm connectivity.homelab_networkInfo to identify current open ports.sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow from 192.168.1.0/24 to any port 9090 proto tcp
sudo ufw enable
homelab_serviceHealth to verify services remain accessible.homelab_piStatus for a final system check.| Tool | Purpose |
|---|---|
homelab_sshTest | Verify SSH access before and after lockdown changes |
homelab_piStatus | System overview before hardening |
homelab_networkInfo | Inspect open ports, interfaces, and firewall state |
homelab_serviceHealth | Confirm services survive firewall and config changes |
homelab_systemdControl | Restart or reload native services such as fail2ban (confirm: true) |
homelab_nodeExec | Validate and reload sshd in one step (sudo sshd -t && sudo systemctl reload ssh, confirm: true) |
homelab_serviceRestart | Restart a Docker container (for example Nginx Proxy Manager) after config updates |
homelab_journalLogs | Check fail2ban journal entries (unit: "fail2ban") for ban activity or errors |
homelab_composePs | Verify container state after security changes |
homelab_composeUp | Redeploy stacks with updated security options |
jail.local with ignoreip = 127.0.0.1/8 192.168.1.0/24.read_only: true and add tmpfs mounts for paths that fail./var/run/docker.sock gives a container full root access to the host. Use a socket proxy with limited API access.ufw-docker or use DOCKER_IPTABLES=false and manage rules manually.bantime and findtime match your threat model.ssh-management -- detailed SSH key and sshd_config hardeningansible-workflows -- automate security hardening across multiple nodesnetwork-configuration -- network-level security and VLAN isolationtroubleshooting -- debug connectivity issues after hardeningWhat SKILL.md sets; muted values are Claude Code's defaults
/home-lab-developer-tools:security-hardeningfrom home-lab-developer-tools
home-lab-developer-tools@nicu-ai-tools is listed by mascatunike/nicu-ai-tools — review the source before installing
npx claudepluginhub mascatunike/nicu-ai-tools --plugin home-lab-developer-toolsOther plugins' skills for the same job
22 skills in this plugin
/alerting-rulesWrite Prometheus alerting rules and configure Alertmanager routing for home lab notifications./ansible-workflowsWrite and run Ansible playbooks for multi-node home lab provisioning and configuration management./backup-recoveryConfigure and manage restic backups including scheduling, verification, and disaster recovery./certificate-managementLet's Encrypt, self-signed certs, renewal automation, NPM cert integration