I have successfully installed the SURICATA-EXTRA package, based on glehel's post #31 in this thread and wanted to share my notes in case it helps / encourages others to try. I chose EXTRA so that I had NFQ capabilities
My signature shows the setup I have this running in ==> you need a router with sufficient RAM / CPU to be able to run the mode I have setup (please see the posts in this thread and the 2020 suricata v4 thread for guidance).
Please note I am in
LEARNING mode with Asuswrt and Suricata - I'm sure there are other / better ways to accomplish what I did and I welcome any and all feedback to help me learn more and improve.
Special thanks to glehel and many others in the original Suricata thread back in 2020 (Suricata - IDS on AsusWRT Merlin) for the tips and guidance!!!
Steps
1. Make a temporary directory (e.g. /tmp/packages) to download the package files from here -
https://bin.entware.net/aarch64-k3.10/test/suricata6/
2. Download the following packages to the temp directory
curl --progress-bar -o /tmp/packages/suricata6-extra_6.0.4-1_aarch64-3.10.ipk
https://bin.entware.net/aarch64-k3.10/test/suricata6/suricata6-extra_6.0.4-1_aarch64-3.10.ipk
curl --progress-bar -o /tmp/packages/libnss_3.69-1_aarch64-3.10.ipk
https://bin.entware.net/aarch64-k3.10/test/suricata6/libnss_3.69-1_aarch64-3.10.ipk
curl --progress-bar -o /tmp/packages/nspr_4.32-1_aarch64-3.10.ipk
https://bin.entware.net/aarch64-k3.10/test/suricata6/nspr_4.32-1_aarch64-3.10.ipk
*** Note - the Suricata package is dependent on the libnss and nsrp packages; libnss is dependent on nspr
3. Install the packages in the following order, due to dependencies
opkg install /tmp/packages/nspr_4.32-1_aarch64-3.10.ipk
opkg install /tmp/packages/libnss_3.69-1_aarch64-3.10.ipk
opkg install /tmp/packages/suricata-extra_6.0.4-1_aarch64-3.10.ipk
4. Create / update the suricata.yaml file, which configures suricata the way you want. I used the one in glehel's #31 post, with minor updates to suit my preferences:
Changed stats to "enabled: no"
changed eve-log to "enabled: no"
changed syslog to "enabled: yes" and uncommented "level: Info"
under the "outputs:" section, changed the syslog seetings as follows:
- syslog:
enabled: yes
level: info
facility: local5
format: "[%i] <%d> -- "
# type: json
changed host-mode: router
5. Create the S82suricata init.d file, so that Suricata starts on router bootup. I used the one in glehel's #31 post as is. Only change depends on which mode you want run
Place the file in the /opt/etc/init.d directory and make the file executable (chmod +x)
Comment / uncomment the "ARGS=" line - only one should be uncommented at a time.
IDS mode ==> ARGS="-c /opt/etc/suricata/suricata.yaml --af-packet -D" <== suggest starting in this mode until you have everything working the way you want
IPS mode ==> ARGS="-c /opt/etc/suricata/suricata.yaml -q 0 -D"
6. Create the rules update file - suricata_update.sh. Again, I used the one in glehel's #31 post as is
Make a surricata addon directory ==> mkdir /jffs/addons/suricata
Place the file in the /jffs/addons/suricata directory
Make the file executable ==> chmod + x /jffs/addons/suricata/suricata_update.sh
Add the following line to the /jffs/scripts/services-start file, so the rules can be updated nightly
cru a Suricata_Update.sh "0 3 * * * /jffs/addons/suricata/suricata_update.sh"
7. If running in IPS mode, add the following to the bottom of the /jfffs/scripts/post-mount script. This is the IPTABLEs noted in glahel's post #31
/usr/sbin/iptables -I FORWARD -j NFQUEUE # Suricata when running in IPS mode
Reboot the router and happy experimenting and learning