---
name: "ufw-uncomplicated-firewall-rules"
description: "Configure, manage, and verify simple host-based Linux firewall policies via UFW."
metadata:
  author: "Canonical"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup ufw firewall"
  - "rate limit ssh ufw"
  - "ufw allow from ip"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# UFW (Uncomplicated Firewall) Host Security Policies

Administers Ubuntu/Debian firewalls with UFW: default deny policies, opening ports with service profiles (OpenSSH, Nginx Full), IP CIDR allowlists, rate limiting SSH brute-force attempts, and auditing ufw status numbered.

## When to Invoke
Invoke this skill whenever you need to:
- setup ufw firewall
- rate limit ssh ufw
- ufw allow from ip

## Execution SOP & Rules
1. Set baseline policies: ufw default deny incoming && ufw default allow outgoing.
2. Allow SSH before enabling firewall: ufw allow OpenSSH or ufw limit 22/tcp.
3. Allow specific IP access: ufw allow from 10.0.1.50 to any port 5432 proto tcp.
4. Enable firewall: ufw enable and inspect rules: ufw status verbose numbered.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
