Suricata 4.1.4_2 not blocking hosts
-
To anyone else experiencing this issue of the latest Suricata package not blocking hosts when Legacy Mode blocking is enabled, I am aware and looking into the fix. Pretty sure this is a side effect from fixing another different bug. The issue is within the custom blocking plugin I wrote for Suricata, so I will have to patch and then submit an updated Suricata binary to correct the problem.
-
The fix for this bug is posted for the pfSense team to review and merge. I've asked them to expedite this one, so keep checking for a new Suricata package to show up in PACKAGE MANAGER either later today or early tomorrow.
The pull request for the fix is here: https://github.com/pfsense/FreeBSD-ports/pull/652.
-
Just got the update installed, so thanks for fixing things. I do want to mention though that just like when I rebuilt everything from scratch it did not automatically start on my WAN interface but did on my LAN and when I go look up the rules it tells me the app-layer-event.rules can not be found or something. On the bright side at least its blocking again.
-
@jchud said in Suricata 4.1.4_2 not blocking hosts:
Just got the update installed, so thanks for fixing things. I do want to mention though that just like when I rebuilt everything from scratch it did not automatically start on my WAN interface but did on my LAN and when I go look up the rules it tells me the app-layer-event.rules can not be found or something. On the bright side at least its blocking again.
There is a fix for that in the update, but unfortunately you don't get the fixed file in effect until after you install the update. By that point the old file has already messed up your install. You can fix your problem by doing what I just wrote in the Release Notes here. Delete the Suricata package and then install it again. That will restore the missing app-layer-events.rules and other events rules files.
-
@bmeeks Alright did an uninstall followed by a reinstall and it got rid of the app-layer-event.rule thing. The only thing that it still did was not autostart on my WAN interface like it did on my LAN, any idea how to correct that?
-
@jchud said in Suricata 4.1.4_2 not blocking hosts:
@bmeeks Alright did an uninstall followed by a reinstall and it got rid of the app-layer-event.rule thing. The only thing that it still did was not autostart on my WAN interface like it did on my LAN, any idea how to correct that?
There should be a message in the
suricata.log
file for the interface. It can also take Suricata a little time to start on an interface if you have lots of rules enabled. That little icon on the INTERFACES tab will show a spinning gear if Suricata is still starting for an interface. If you see just the red X (for stopped), then check the log file to see what's up. And just one more thing: don't use the Service Watchdog package with Suricata or Snort. You haven't said you are, but I just mention it because several folks have done that and it leads to issues. -
@bmeeks Well unfortunately I do not have a copy of the log prior to me starting it manually, but I will check next I reboot or something. Though speaking about that log I did notice that while it is blocking I still get a few entries (like when it wasn't) saying "<Warning> -- [ERRCODE: SC_WARN_UNCOMMON(230)] - alert-pf -> Firewall interface IP change notification thread received an invalid IP address via kernel routing message socket.", "<Error> -- [ERRCODE: SC_ERR_INVALID_ARGUMENT(13)] - Argument "tree" NULL", and some about IP address on the interface being changed. Also as far as I know I am not using the Service Watchdog package.
-
@jchud said in Suricata 4.1.4_2 not blocking hosts:
@bmeeks Well unfortunately I do not have a copy of the log prior to me starting it manually, but I will check next I reboot or something. Though speaking about that log I did notice that while it is blocking I still get a few entries (like when it wasn't) saying "<Warning> -- [ERRCODE: SC_WARN_UNCOMMON(230)] - alert-pf -> Firewall interface IP change notification thread received an invalid IP address via kernel routing message socket.", "<Error> -- [ERRCODE: SC_ERR_INVALID_ARGUMENT(13)] - Argument "tree" NULL", and some about IP address on the interface being changed. Also as far as I know I am not using the Service Watchdog package.
Are you sure you got the updated binary? Those errors were the old bug manifesting itself. That can't happen in the fixed binary. Did you delete the Suricata package entirely and then install it again? If not, do it this way ---
-
Go to the PACKAGE MANAGER tab, and on the Installed Packages tab click the trash icon beside the Suricata package to remove it from the firewall. It will take serveral seconds to uninstall. Let it finished and DO NOT leave the page until you get a green status bar saying removal succeeded.
-
Click the Available Packages tab, locate Suricata in the list, and install it again. Pay careful attention to the dependency packages listed underneath the Suricata entry. You should a line that says
suricata-4.1.4_2
. If you seesuricata-4.1.4_1
or older, then the new binary is not yet posted. This might be the case if you have a Netgate appliance as firmware and package updates for those may be delayed a day or so.
-
-
@bmeeks At first I just did an in place upgrade, then I did a uninstall and reinstall to get rid of that app-layer-event.rule thing. As things stand right now it says I have version 4.1.4_4 installed and it lists 4.1.4_2 as a dependency. I am happy to do another uninstall/reinstall if you think it will make a difference?
-
@jchud said in Suricata 4.1.4_2 not blocking hosts:
@bmeeks At first I just did an in place upgrade, then I did a uninstall and reinstall to get rid of that app-layer-event.rule thing. As things stand right now it says I have version 4.1.4_4 installed and it lists 4.1.4_2 as a dependency. I am happy to do another uninstall/reinstall if you think it will make a difference?
You should not be getting those error messages in your
suricata.log
, especially the one about "Argument 'tree' NULL". Are you sure those are in the current log? Stop and restart Suricata again and see if the message reappears.If they do, then open a CLI session on the firewall and run this command at a shell prompt:
suricata -V
That will print the current Suricata binary version. See what it says.
-
@bmeeks The only thing I noted when I stopped the service from the homepage is that it still showed as if it were running even though it had stopped on both the interface. When I restarted the service again the WAN didn't automatically start but the LAN did. And the log for the when did not contain any of those errors after the I started it back up again. Lastly when running the command you mention it tells me I am running version 4.1.4.
-
@jchud: the "still running" indication would be a symptom of a zombie process or a crashed process where the PID file did not get cleaned up. The GUI senses the presence of the PID file with a valid process ID within it to determine what icon to show for Suricatat status.
It sounds much better that you no longer are seeing those errors in the
suricata.log
file.In the future, when upgrading the package, it is always safer to first delete it and then install it again instead of just clicking the "Reinstall" icon. The way PHP and the
pkg
utility work on the system can lead to a mixup of new and old files if you just do the reinstall option. While reinstall will work for some simple updates, other updates need to change files that are sometimes cached and held open by the system during a reinstall. That can prevent some migration actions for the new version from happening. -
@bmeeks I killed the zombie process and got everything to start back up again normally. In the suricata.log I still get the change of IP address thing along with the [ERRCODE: SC_WARN_UNCOMMON(230)], which I am guessing has something to do with the fact that when this is restarted on the WAN side "/rc.newwanip" starts doing some stuff like claiming the IP has changed even though its exactly the same as it was before.
-
@jchud said in Suricata 4.1.4_2 not blocking hosts:
@bmeeks I killed the zombie process and got everything to start back up again normally. In the suricata.log I still get the change of IP address thing along with the [ERRCODE: SC_WARN_UNCOMMON(230)], which I am guessing has something to do with the fact that when this is restarted on the WAN side "/rc.newwanip" starts doing some stuff like claiming the IP has changed even though its exactly the same as it was before.
No, that SC_WARN_UNCOMMON error is definitely not supposed to be there. What kind of interface is your WAN? Is it configured for DHCP or is it a PPPoE connection?
It really sounds like your binary is not the patched one. Look at the file date and time for this file:
/usr/local/bin/suricata
and let me know what it says. Giving the me size in bytes will help as well. The latest file should show a date of June 13, 2019 and have a file size of 4,340,864 bytes.
-
@bmeeks Yes my WAN is configure for DHCP and the date/time for that file is June 13 17:49 and the size in bytes is 4499944.
-
@jchud said in Suricata 4.1.4_2 not blocking hosts:
@bmeeks Yes my WAN is configure for DHCP and the date/time for that file is June 13 17:49 and the size in bytes is 4499944.
I'm working the same issue with another user in a different thread, and he is reporting the same file size. That is certainly different from what is on my machine. Is your hardware an Intel-base AMD64 CPU, or is it an ARM-based Netgate appliance? Trying to figure out why the binary is different.
-
@bmeeks Intel based, built the computer its running on myself
-
@jchud : Good, that means we are on the same CPU. My virtual machine box that works is running on VMware Workstation on a Windows host with an Intel i7 CPU.
Let's compare MD5 hashes to see if your binary is the same as mine. Run this command from a shell prompt on the firewall:
md5 -q /usr/local/bin/suricata
The output should be:
cc5200e8369def9268b9e30c0c3f41c6
Let me know what you get.
-
I just found this thread from a google search. I'm having the exact same issue.
It started yesterday, I noticed Suricata would run, and then just crash. I could restart it and it would work fine for a few hours, crash again.
I am getting the same error messages; [ERRCODE: SC_ERR_INVALID_ARGUMENT(13)] - Argument "tree" NULL
Last night, I found the thread with you talking about the bug. I uninstalled and reinstalled suricata, and it ran all night and most of today w/ no issues, but it just crashed again.
So, again, I uninstalled Suricata ... waited for it to finish. Made sure it was gone, and then reinstalled it. Once I started Suricata, the error messages showed up again. Here's the output from what you where asking @jchud about.
Also, I hadn't noticed, but yes, it is not blocking hosts now either. It will Alert.
[2.4.4-RELEASE][admin@fw.alteredreality.cc]/root: suricata -V This is Suricata version 4.1.4 RELEASE [2.4.4-RELEASE][admin@fw.alteredreality.cc]/root: ls -l /usr/local/bin/suricata -rwxr-xr-x 1 root wheel 4499944 Jun 13 17:49 /usr/local/bin/suricata [2.4.4-RELEASE][admin@fw.alteredreality.cc]/root: md5 -q /usr/local/bin/suricata c962d5d995867c5baf3136035a34fac7 [2.4.4-RELEASE][admin@fw.alteredreality.cc]/root:
Thanks
-
when exactly have you reinstalled it? in the last 30 min ? because the new update with the right crc appeared on my pf sense 2.5 only 30 min ago max 1 hour ago