bolemo / aegis

Firewall blocklist for Netgear R7800, R9000, Orbi and possibly more models.
MIT License
8 stars 0 forks source link

Aegis ReadMe

A firewall blocklist script for Netgear R7800, R8900, R9000 and Orbi Routers [with Voxel firmware]. Might work with several other Netgear routers supporting Voxel firmware as well.

It will filter all traffic to and from WAN and WireGuard or OpenVPN clients tunnels.

Version: 1.7.12

Prerequisite

Install procedure

Once installed, you will likely want to launch the script. Use /opt/bolemo/scripts/aegis up -v or aegis up to generate updated directives (first launch), set and uprear the shield protection. Use of -v is to see the progress.

Anytime, you can use /opt/bolemo/scripts/aegis status or aegis status to check if everything is up and running or not.

If aegis was set and running before a router reboot, it should be back automatically after the reboot.

Cron job

You will probably want to setup a cron job to update the blocklists once a day (use Entware's cron or Kamoj's addon for that). For example: 15 3 * * * /bin/sh /opt/bolemo/scripts/aegis refresh, will update the blocklist (and the firewall) everyday at 3:15 in the morning (or local time if using Kamoj's addon); this will update and apply new sets without disturbing actual aegis state (up or down). Or if you want to make sure aegis is (re)started each time, use: 15 3 * * * /bin/sh /opt/bolemo/scripts/aegis up -refresh

What does install procedure do

1) If installed on external drive, it will:

2) If installed on internal memory, it will:

Then, for both (1) or (2), install will:

If installing iprange with Entware:

If installing iprange without Entware (on internal memory):


Upgrade

You do not need to go through the installation script to install a new version. The comnand aegis info will show the installed version and the latest version available online. The aegis upgrade command will also show installed and latest version available and ask if you want to upgrade if the online version is different than the one installed.

To upgrade, it is strongly advised to perform aegis unset then aegis upgrade, then aegis up


Usage

Usage: /opt/bolemo/scripts/aegis COMMAND [OPTION(S)] or aegis COMMAND [OPTION(S)]

Valid commands (only one):


Lists (online blocklists, custom blacklists, custom whitelists)


Web Companion

Aegis can install an optional Web Companion, to do so, once aegis is installed, just run aegis web -install; this will install or reinstall the Web Companion. To remove it, simply run aegis web -remove, or while using the command aegis unset, add the -rm-web option. Once installed, thr Web Companion is accessible here: http://routerlogin.net/bolemo/aegis.htm

If the Web Companion is installed, it will automatically get upgraded when aegis is upgraded from the command aegis upgrade.


Logging

Enable logging

To enable logging, just run aegis log -enable. If aegis is up, it will activate the logging immediatly. If aegis is down, it won't start it, but next time it will be started, logging will be enabled. You can also use the -log-enable option with the command up to (re)start aegis with logging on. This survives internal firewall restarts and router reboots. A specific log file is created in /var/log/log-aegis. A small daemon is loaded in memory to update this log file and is exited automatically when the log is turned off. The node id of the file is not changing with rotations, allowing to follow it.

Access the log

To watch the last entries of the log, use aegis log -show. To watch the last N entries of the log, use aegis log -show -lines=N. To watch the log live (in realtime), use aegis log -live. To exit use CTRL-C.

Disable logging

To stop logging, just use aegis log -disable (if aegis is up, it will desactivates the logging immediatly; if it is down, logging won't be active next time it is started). You an also use the option -log-disable when you are (re)starting then engine: aegis up -log-disable.


iprange

iprange is a great little utility dealing that is now part of the FireHOL project. Aegis needs iprange installed, as it allows great optimizations.

Since February 2021, Voxel's firmwares already include iprange.

With older firmwares, the install script wikl offers to install a version of it on the router 1) through Entware if you have it, or 2) directly on rootfs (in /usr/bin) if you don't have Entware (or don't want to install with Entware).

The source is here: https://github.com/firehol/iprange


Metrics

There are very basic privacy friendly metrics sent when an install or an upgrade is made (and only then).

What is sent then is:

It is using https://www.goatcounter.com/ that is open source and respects privacy.

All that is visible at the end is the country (no ip), router model, aegis version being downloaded as well as installation being internal or external. Nothing more.

This is to have basic statistics about aegis (how many people are downloading it, where in the world, router models).

Only installations or upgrades are sending these basic metrics: once an upgrade or install is done, it does not send anything until next upgrade. No data collection, metrics, stats... are ever sent when aegis is used. How and when you are using it is private.