GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Kolgrim33/rulesmith: terminal app that lets you build firewall rules visually with arrow keys, not typing.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 

Repository files navigation

RuleSmith

Interactive nftables firewall builder with a terminal UI and safety rollback.

What it does

RuleSmith lets you build, test, and apply nftables firewall rules without hand-writing configuration files. It provides a live preview, packet simulator, preset rulesets, and a 30-second safety rollback to prevent lockouts.

Features

  • Interactive TUI — navigate rules with arrow keys, add/edit/delete via menus
  • Packet Simulator — test which rule catches a hypothetical packet before applying
  • Diff View — compare current live ruleset against pending changes
  • Preset Rulesets — one-key load for webserver, paranoid, and homelab profiles
  • Safety Rollback — after applying rules, a 30-second timer starts; press y to keep or wait for auto-revert
  • Backup History — automatic backups before every apply, with restore support
  • CLI Mode — non-interactive commands for scripts and automation

Requirements

  • Linux with nftables
  • Rust toolchain (for building from source)

Build

git clone https://github.com/Kolgrim33/rulesmith.git
cd rulesmith
cargo build --release
Usage
TUI (Interactive)
bash
sudo ./target/release/rulesmith
Without sudo it runs in read-only mode: you can view rules and simulate packets, but cannot edit or apply.
CLI (Non-interactive)
bash
# Show current ruleset
sudo ./target/release/rulesmith show

# Export to file
sudo ./target/release/rulesmith export /tmp/myrules.nft

# Apply a ruleset file directly
sudo ./target/release/rulesmith apply /tmp/myrules.nft

# Apply without safety timer (dangerous)
sudo ./target/release/rulesmith apply /tmp/myrules.nft --force

# List backups
./target/release/rulesmith list-backups

# Restore a backup
sudo ./target/release/rulesmith restore <backup-id>
TUI Key Reference
Dashboard
Table
Key	Action
q	Quit
?	Show help
a	Add new rule (opens editor)
d	Delete selected rule
Shift + Up/Down	Move rule up/down
t	Packet simulator
D	Diff view
A	Apply ruleset
p	Show preset menu, then 1/2/3 to load
b	Backup history
r	Refresh ruleset from system
Up/Down	Navigate rules
Left/Right	Navigate tables/chains
Rule Editor
Table
Key	Action
Up/Down	Navigate fields
Enter	Edit selected field
Space	Cycle preset values (family, protocol, action, direction)
s	Save rule and return to dashboard
Esc	Cancel and return
While editing a field:
Type normally
Enter to confirm
Esc to cancel
Backspace to delete
Applying Rules
Press A on the dashboard
Press Enter to confirm
Rules are pushed to the kernel
A 30-second timer starts; status bar shows ROLLBACK 27s
Press y to confirm permanently
If you do not confirm in 30 seconds, rules auto-revert to the last backup
Packet Simulator
Table
Key	Action
r	Run simulation
e	Edit packet fields
Esc	Back to dashboard
Presets
Table
Key	Name	Description
1	webserver	Allow SSH(22), HTTP(80), HTTPS(443); drop rest
2	paranoid	Only SSH from LAN; drop everything else
3	homelab	Allow LAN range, SSH, DNS, HTTPS; drop rest
Safety Tips
Always test in a VM or secondary machine first
The 30-second rollback prevents most lockouts, but if you break local loopback (lo) rules you may still lose local connectivity
Backups are stored in ~/.local/share/rulesmith/backups/
Read-only mode is automatically enabled when not running as root
License
MIT

About

terminal app that lets you build firewall rules visually with arrow keys, not typing.

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.