A self-hardening content filter for Arch Linux that blocks adult content and locks itself down so even you can't easily undo it.
- ~12M blocked domains — downloads and periodically refreshes from blocklistproject.github.io
- Custom block list — add your own domains alongside the main list
- Whitelist — exempt specific domains from blocking
- DNS lockdown — iptables blocks port 53 (DNS), 853 (DoT), and 443 (DoH) to prevent circumvention
- DNS provider blocking — drops traffic to Cloudflare, Google, Quad9, OpenDNS, NextDNS, AdGuard, ControlD
- Immutable hosts —
/etc/hostsis setchattr +ito prevent tampering - Self-healing — hidden backup copies (4 locations) restore the core script if corrupted or deleted
- Block page server — serves a "Site Blocked" page on ports 80 (HTTP) and 443 (HTTPS) with a self-signed cert
- Timed unlock — request an auto-unlock after N hours (default 24); runs
unlock-now.shwhen the timer expires - Watchdog — systemd timer verifies blocking every 5 minutes and re-applies if missing
- Firefox DoH disabled — automatically sets
network.trr.mode = 5in all Firefox profiles - Faillock — 3 wrong sudo attempts = 10 minute lockout
- SafeSearch enforcement — redirects Google and Bing to their SafeSearch IPs via hosts entries
- No-password sudo —
cerberusCLI runs via passwordless sudo for the configured user only
sudo ./setup.shThis installs everything under /opt/cerberus/, sets up systemd services, creates the cerberus CLI command, and applies the blocklist immediately.
cerberus status Show blocking status
cerberus lock Apply and lock immediately
cerberus unlock [hours] Auto-unlock after N hours (min: 1, default: 24)
cerberus cancel Cancel pending unlock
cerberus block add <domain> Add domain to custom block list
cerberus block rm <domain> Remove domain from custom block list
cerberus block list List custom blocked domains
cerberus whitelist add <domain> Add domain to whitelist
cerberus whitelist rm <domain> Remove domain from whitelist
cerberus safesearch list Show SafeSearch redirects
cerberus safesearch apply Apply SafeSearch redirects
cerberus update Self-update from git and reapply rules
cerberus refresh Force refresh blocklist from internet
| Component | Location | Role |
|---|---|---|
core.sh |
/opt/cerberus/core.sh |
Applies hosts, iptables, self-heals |
cli.sh |
/opt/cerberus/cli.sh |
User-facing CLI (cerberus command) |
blockpage.py |
/opt/cerberus/blockpage.py |
Block page HTTP/HTTPS server |
unlock-now.sh |
/opt/cerberus/unlock-now.sh |
Removes all blocking rules |
config |
/opt/cerberus/config |
Whitelist, blocklist URL, backup locations |
custom-block.txt |
/opt/cerberus/custom-block.txt |
User-defined domains to block |
cerberus.service |
systemd | Applies blocking on boot |
cerberus-watchdog.timer |
systemd | Runs every 5 min to verify blocking |
cerberus-blockpage.service |
systemd | Serves block page on port 80 |
cerberus-blockpage-https.service |
systemd | Serves block page on port 443 |
cerberus-refresh.service |
systemd | Fetches fresh blocklist on start |
cerberus-refresh.timer |
systemd | Triggers refresh daily at midnight |
/var/lib/cerberus/state |
file | Entry count, iptables status, immutable state |
Backup copies of core.sh are stored in hidden locations (listed in config) and are also made immutable. If the main script is altered or deleted, it's restored from backup on the next check cycle.
To make it truly irreversible:
- Run
passwdand set a password you don't know (mash the keyboard). - Delete any saved passwords from your session.
- The only way out is waiting for the unlock timer or rebooting from a live USB.
- Arch Linux
curl,openssl(installed automatically bysetup.sh)systemd-resolvedfor DNS