Dumbing Smart Shit Down
- Python 90.9%
- Makefile 9.1%
| .gitignore | ||
| fwctrl.py | ||
| fwctrl.service | ||
| LICENSE | ||
| main.py | ||
| Makefile | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
Dumbing Smart Shit Down
Monitors blocked connection attempts on a Linux firewall (iptables/ip6tables). By default, all inbound and outbound traffic is blocked; every attempt is logged and visualized live. Exemptions can be granted dynamically based on a domain whitelist.
Features
- Full block (DROP) for INPUT/OUTPUT/FORWARD (IPv4 + IPv6)
- Real-time monitoring via
journalctl -k -f - CLI output and Web UI (Flask + Socket.IO)
- Reverse DNS (RDNS) with domain display
- Domain whitelist with wildcards (
example.com,*.example.com,.example.com) - Automatically allow destination IPs belonging to whitelisted domains
- Separation of monitoring (user) and firewall control (root service)
Project Structure
main.py– Monitoring, RDNS, whitelist logic, controller clientfwctrl.py– System service: manages iptables/ip6tables rules, listenerapp.py– Flask Web App with Socket.IO streaming and statstemplates/index.html– Web UIfwctrl.service– systemd service definition for the root controllerMakefile– Service installation/management
Requirements
- Linux with systemd
- iptables/ip6tables
- Python 3.12+
- Root privileges to manage firewall rules
Install the Root Service
# Run as root
sudo make install
# Start service
sudo make start
# Status/Logs
sudo make status
make logs
The service runs from /opt/dssd and listens on 127.0.0.1:6000 via multiprocessing.connection.Listener. Configure the auth secret with FWCTRL_AUTH (see fwctrl.service).
CLI Monitor with Whitelist
A whitelist file contains one domain per line (# comments allowed). Wildcards are supported.
Example whitelist.txt:
# Exact
example.com
# Wildcards
*.github.com
.cloudflare.com
Start the monitor:
python3 main.py --whitelist whitelist.txt
- Shows only blocked outbound connections
- Performs RDNS and domain resolution
- If the destination domain matches the whitelist, resolve its IPs and send them to the root controller (
allow_ip) which applies appropriate iptables/ip6tables rules.
Security & Operations
- The firewall controller (
fwctrl.py) must run as root. - The monitor may run with root; it primarily needs access to
journalctl -k. - DNS (port 53, UDP/TCP) is allowed so RDNS and domain resolution work.
- Adjust
fwctrl.serviceas needed (path, auth key, working directory).
Useful Commands
# Current iptables rules
sudo iptables -L -v -n --line-numbers
sudo ip6tables -L -v -n --line-numbers
# Kernel logs
sudo journalctl -k -f
License
See LICENSE in the project root.