/ubuntu-security:firewall-removefrom ubuntu-security
Remove or tighten ufw firewall rules on an Ubuntu desktop or server — show the numbered rules, delete by number or by rule spec, dedupe redundant entries, replace a broad allow with a scoped one, or reset to a saved baseline. Confirms before deleting anything that was not added in this same session, and deletes highest number first because ufw renumbers after every delete. Use when the user says "remove the firewall rule for X", "close port X", "delete ufw rule 5", "clean up / dedupe the firewall rules", "tighten this rule to the LAN", "undo the rule we just added", or "reset ufw to the baseline".
Ships in ubuntu-security. 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.
sudo ufw status numbered
sudo ufw show added # the same rules as the commands that created them
Identify the target rule(s) with the user's description (port, service, source,
comment). Each IPv4 rule usually has a separate (v6) twin with its own number;
removing "port 8000" normally means both.
OpenSSH, 22/tcp, or the custom sshd port) unless the user explicitly insists
and another allow still covers their source address. Check the session's source:
echo "$SSH_CONNECTION" (first field is the client IP).By spec (preferred — removes the v4 and v6 rule together, and no numbering to
get wrong): prefix the original rule with delete, exactly as ufw show added prints
it.
sudo ufw delete allow 8000/tcp
sudo ufw delete allow from 192.168.1.0/24 to any port 445 proto tcp
sudo ufw delete allow OpenSSH
By number: ufw renumbers after every delete, so delete the highest number
first, and use --force to skip the interactive y/n prompt.
for n in $(printf '%s\n' 12 7 3 | sort -rn); do sudo ufw --force delete "$n"; done
Deleting by number removes only that one line — the (v6) twin stays unless its
number is in the list too.
To narrow allow 445/tcp (from anywhere) down to the LAN: add the scoped rule
first, then delete the broad one, so there is no gap.
sudo ufw allow from <lan-cidr> to any port 445 proto tcp comment 'SMB LAN'
sudo ufw delete allow 445/tcp
Group ufw status numbered lines by (action, direction, port/proto or app, source,
interface). For groups with more than one rule, keep the one with the most
descriptive comment and remove the others, highest number first. A broader rule
(e.g. Anywhere on tailscale0) makes narrower rules on the same interface redundant;
point this out, but only remove them if the user agrees.
Only on explicit request. It removes every rule added since the baseline.
STATE="${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/ubuntu-security/ufw"
ls -1 "$STATE"/baseline-*.rules
sudo ufw --force reset disables ufw and backs up the old rule files to
/etc/ufw/*.rules.<timestamp>. Re-apply the defaults and each baseline line
(ufw show added format: drop the leading ufw and run sudo ufw <rest>), then
sudo ufw --force enable. On a remote box, re-add the SSH allow before enabling.
sudo ufw status numbered
Show before → after in the reply (one line per removed rule). If the user keeps
snapshots (firewall-status §6), write a new one.
ufw delete of a rule that doesn't exist prints Could not delete non-existent rule and changes nothing: re-read the spec from ufw show added.firewall-status §5).What SKILL.md sets; muted values are Claude Code's defaults
ubuntu-security@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin ubuntu-securityOther plugins' skills for the same job
18 skills in this plugin
/av-installInstall and initialise malware and rootkit scanning on Ubuntu — the core set (ClamAV engine + clamd daemon + freshclam updater, ClamTk GUI on desktops, rkhunter) and, on request, the advanced layer (Lynis hardening audit, chkrootkit, AIDE file-integrity baseline, debsecan). Detects what is already installed, picks a reports folder, runs the first definitions update and baselines. Use when the user says "install antivirus", "set up clamav", "install rkhunter / lynis / aide / chkrootkit", "set up malware scanning", or when malware-scan finds no scanners installed./av-update-definitionsRefresh signature databases and data for every installed scanner on Ubuntu — freshclam (ClamAV), rkhunter --update, Lynis version check, debsecan CVE list — and report one status line per tool, without re-baselining rkhunter or AIDE. Also explains stale ClamAV signatures (freshclam service down, mirror rate-limiting). Use when the user says "update antivirus definitions", "refresh signatures", "update clamav", "is clamav up to date", or before a scan when signatures are old./complementary-pluginsList and install plugins that complement ubuntu-security: hardware-auth-keys, security-auditor, ubuntu-admin. Use on "related plugins".