Skip to content

michaelgregoryibizugbe/FIREWALL-X

Repository files navigation

🔥 FirewallX - Interactive Firewall Manager

  ███████╗██╗██████╗ ███████╗██╗    ██╗ █████╗ ██╗     ██╗
  ██╔════╝██║██╔══██╗██╔════╝██║    ██║██╔══██╗██║     ██║
  █████╗  ██║██████╔╝█████╗  ██║ █╗ ██║███████║██║     ██║
  ██╔══╝  ██║██╔══██╗██╔══╝  ██║███╗██║██╔══██║██║     ██║
  ██║     ██║██║  ██║███████╗╚███╔███╔╝██║  ██║███████╗███████╗
  ╚═╝     ╚═╝╚═╝  ╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝╚══════╝╚══════╝

A beautiful, beginner-friendly interactive firewall management TUI for learning cybersecurity


✨ Features

Feature Details
🎨 Beautiful UI Gradient colors, emoji indicators, rich panels
⌨️ Autocomplete Tab-complete every command, parameter, and value
💡 Live Hints Context-aware hints appear as you type
📜 Command History ↑↓ arrow keys to browse history
🚦 Live Monitor Real-time traffic visualization
📊 Statistics Full dashboard with bar charts
🛡️ 10 Default Rules Pre-built security ruleset
🔧 Full Rule CRUD Add, remove, enable, disable, toggle rules
🚫 IP Management Block/unblock/whitelist IPs instantly
💾 Import/Export Save & restore rules as JSON
🎮 Traffic Simulator Test your rules with fake traffic
⌨️ Function Keys F1=Help, F2=Rules, F5=Stats

🚀 Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Run FirewallX

python firewallx.py

📖 Command Reference

🛡️ Rule Management

# Add rules
add rule MyRule ALLOW TCP BOTH --dst-port 443
add rule BlockIP DENY ANY BOTH --src-ip 10.0.0.5 --priority 1
add rule LogHTTP LOG TCP IN --dst-port 80 --desc "Monitor HTTP"

# Manage rules
list rules                    # Show all rules
list rules --action DENY      # Filter by action
list rules --enabled          # Only active rules
remove rule MyRule            # Delete a rule
enable rule default-006       # Enable a disabled rule
disable rule Allow-HTTP       # Disable a rule
toggle rule BlockHTTP         # Toggle on/off
flush rules                   # Remove all custom rules

🚫 IP Management

block ip 192.168.1.100                         # Block an IP
block ip 10.0.0.5 --reason "Port scanner"      # Block with reason
unblock ip 192.168.1.100                        # Unblock
whitelist ip 192.168.1.1 --reason "Gateway"     # Always allow
show blocked                                    # List blocked IPs
show whitelist                                  # List whitelist

📊 Monitoring

monitor                        # Live traffic monitor
monitor --filter DENY          # Only show blocked traffic
simulate                       # Simulate 20 random packets
simulate --count 100 --speed fast
show log                       # Traffic event log
show log --lines 50 --action DENY
show stats                     # Statistics + charts
show top                       # Top blocked IPs
dashboard                      # Full visual dashboard

💾 Import / Export

export                         # Export to timestamped file
export --file my_rules.json    # Export to specific file
import my_rules.json           # Import rules

⚙️ Utilities

help                           # Full command reference
help block ip                  # Detailed command help
version                        # Version info
clear                          # Clear screen + welcome
reset stats                    # Reset statistics
quit                           # Exit FirewallX

⌨️ Keyboard Shortcuts

Key Action
Tab Autocomplete command
/ Browse command history
Accept suggestion
F1 Quick help panel
F2 List all rules
F5 Show statistics
Ctrl+C Cancel current operation

🎨 Color Legend

Color Meaning
🟦 Cyan #00D4FF Info / Allow / Commands
🟣 Purple #7B2FBE Labels / Parameters
🟢 Green #00FF9C Success / Active
🔴 Red #FF3860 Blocked / Denied / Error
🟠 Orange #FF6B35 Dropped packets
🟡 Yellow #FFB800 Warning / Log
⚫ Gray #4A4A6A Muted / Disabled

📋 Default Rules

Priority Name Action Details
1 Block Null Packets DENY TCP no-flag packets
5 Block Telnet DENY Port 23
10 Allow HTTPS ALLOW Port 443
10 Allow HTTP ALLOW Port 80
10 Allow DNS ALLOW UDP Port 53
20 Block SSH Brute DENY Port 22 (disabled)
30 Allow SSH ALLOW Port 22
50 Allow ICMP ALLOW Ping
90 Block Priv Ports DROP Ports 1-1023
9999 Default Deny All DENY Catch-all

📁 Project Structure

firewallx/
├── firewallx.py       # Main TUI app + command handlers
├── firewall_engine.py # Core logic: rules, matching, stats
├── rule_parser.py     # Command parser + autocomplete
├── themes.py          # Colors, gradients, themes
├── dashboard.py       # UI widgets: tables, panels, charts
├── monitor.py         # Live traffic monitor
├── requirements.txt   # Python dependencies
└── README.md

⚠️ Disclaimer

FirewallX is an educational tool for learning firewall concepts.
It does not modify your actual system firewall.
For production use, use: iptables, nftables, ufw, pf, or Windows Firewall.


Made with ❤️ using Rich + Prompt Toolkit

About

Beautiful interactive TUI firewall manager for learning cybersecurity. Rule management, IP blocking, live monitoring & dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages