UFW Manager is an interactive Terminal User Interface (TUI) for managing UFW (Uncomplicated Firewall) on Linux.
It provides a full-screen, curses-based interface to view, add, edit, and delete firewall rules, with extra features for service tagging, notes, and a panic mode for emergency resets.
- Live UFW status display (active/inactive/error)
- Scrollable, interactive rule list with highlighting
- Add / Edit rules with dropdown menus and text fields
- Attach custom service names and notes to firewall rules
- Delete rules with confirmation and auto-reindexing of notes/services
- Reload UFW directly from the interface
- Panic Mode — instantly reset firewall to defaults
- Persistent storage for notes and service names in
~/.config/ufwnotes
- Keyboard-driven navigation with minimal mouse dependence
- Python 3.7+
ufw
installed and configured on your system- Sudo privileges (required for modifying firewall rules)
- Linux terminal with at least 80 (columns) x 24 (rows) resolution - Yes, because actual terminals are still a thing! ;)
Install UFW if not present:
sudo apt update && sudo apt install ufw
Clone this repository:
git clone https://github.com/AvishayRapp/UFWManager.git
cd UFWManager
Run:
python3 ufwmanager.py
Note: You’ll need to run in a terminal capable of curses-based apps, preferably in full-screen mode.
The application has three main sections:
-
Header
- Displays current time, UFW status (Active/Inactive/Error), and app title.
-
Main Window
-
Lists firewall rules with columns:
- [#] — Rule number
- TO — Target of the rule
- ACTION — Allow, Deny, Reject, or Limit
- FROM/TO — Source or destination IP
- SERVICE — Custom label you assign
- NOTE — "Yes" if a note is attached, otherwise "No"
-
-
Footer
- Shows available keyboard shortcuts
- Displays status messages from actions
Key / Combo | Action |
---|---|
↑ / ↓ | Move selection up/down in rule list |
A | Add a new firewall rule |
Enter | Edit the currently selected rule |
D | Delete selected rule (with confirmation) |
R | Reload UFW firewall |
Shift+P | Panic Mode (reset firewall to defaults) |
Q | Quit the application |
When adding or editing a rule, you’ll see a form with the following fields:
- Action —
allow
,deny
,reject
,limit
- Direction —
in
orout
- Protocol —
tcp
,udp
, orany
- Port — Numeric port value (required)
- From/To IP — IP address or
any
- Service — Optional service label (stored persistently)
- Note — Optional note for the rule (stored persistently)
Navigation inside the form:
- Tab / ↓ — Move to next field
- Shift+Tab / ↑ — Move to previous field
- ← / → — Change dropdown values (Action, Direction, Protocol)
- Enter — Save rule
- Esc — Cancel without saving
Shift+P triggers Panic Mode, which:
- Prompts you for confirmation
- Runs
sudo ufw reset
to restore UFW to its default state - Removes all custom rules and resets notes/services
Use only if something has gone very wrong with your firewall setup.
Custom service names and notes are stored in:
~/.config/ufwnotes/services.txt
~/.config/ufwnotes/notes.txt
- These are persisted between sessions
- Automatically reindexed if rules are deleted
- UFW not found — Make sure UFW is installed (
sudo apt install ufw
) - Permission denied — You need sudo rights to modify firewall rules
- Terminal too small — Resize terminal to at least 80x15
This project is licensed under the MIT License — see the LICENSE file for details.