If persistent storage is enabled all the rules are joined together at every (re)start of the snort service in /mnt/data/ns-snort/rules/snort.rules. On the command line this becomes visible with:
# service snort restart
Backup created at /mnt/data/ns-snort/old.rules
Processing rule file /mnt/data/ns-snort/snort-rules/rules/snort3-protocol-icmp.rules
<TRUNCATED>
Processing rule file /mnt/data/ns-snort/snort-rules/rules/snort3-browser-firefox.rules
Appended 9186 rules to /mnt/data/ns-snort/rules/snort.rules
Removing testing rules...
Note the 9186 rules, However in the logs there is no prove this rules-file is actually loaded, in /mnt/data/log/messages the rule count is indeed quite low (219 in my case)
Hi, I’d suggest moving this into another topic, but it’s the correct behaviour.
See, BanIP only needs current logs, which are available under /var/log/messages, however this path is volatile and gets deleted upon reboot.
The /mnt/data/log/messages is just the same file, but stored on non-volatile storage.
If you have any other issue, feel free to report them in another topic, or if a mod can split this conversation, it’ll be much appreciated.
Whops, mb for not getting back here, feel free to open an issue if you’re able to reproduce it! You can even open PRs if you want, I’ll gladly review them.
I’m not so surewhat the right solution is.. a kind of man the the mountain or mountain to the man:
Copy the snort rules from persistent storage (/mnt/data/ns-snort) to snort’s config dir (/var/ns-snort) every reboot/reload if persistent storage exist’s or
change snort’s config dir to /mnt/data/ns-snort and copy all the contents of /var/ns-snort at creation of the persistent storage.
My initial solution was the first mentioned.. @ndrosis do you have suggestions for a solution?
(I wil open an issue on github the coming day’s if @ndrosis does not beat me to it…)
Filed it now, just reproduced: IPS doesn't load any rules when storage is configured · Issue #1950 · NethServer/nethsecurity · GitHub
Fix coming up
Fix here: simpler then the one implemented, @mark_nl, @ndrosis are you available for a quick test?
Thanks!