Snort 2.9.2.3 pkg v. 2.5.0 Issues
-
miles267, it aint't over yet. Make sure you patch the various classification.config files as well. The manual patches to classification.config won't survice any rule updates…
Fesoj, understood. Can you point me to info on how to patch the classification.config file(s) also? Sorry I must've overlooked that detail. Thanks for your patience.
-
(1) Find all the classification.config files with find /usr/local -name 'classification.config*'. If you have n interfaces defined for snort you should get at least n+1 copies.
(2) Append config classification: sdf,Sensitive Data was Transmitted Across the Network,2 to the end of each file if the sdf classification is missing.
This is a long story short.
UPDATE: with package vs. 2.5.1 this is obsolete
-
Hi,
I pretty sure that I have a quick patch for the update problem, though I am not sure whether I should post it.
If others can confirm my recent patches, i.e. snort with sensible data preproc enabled, I could go on with this, otherwise it simply does not make any sense. Please reply if you have some time left.
-
mdima,
HOME_NET != WHITELIST. On the WAN side, I have the default HOME_NET, but a special whitelist (including the IP address on the WAN side (I don't know what to do in case of an ISP supplied address using DHCP)) and this works fine. It's just the way things are setup. As I said before, it is now easier than ever to shoot oneself in the foot.
Fesoj, I already specified as Whitelist the Alias where my WAN network is, and anyway it gets blocked. Before this didn't happen, I think it has something to do with the new features of the whitelist management…
Hi mdima, hi Fesoj,
I have the same problem with blocking my WAN gateway (local IP, not public). I left the default setting for Home_Net and I use a Whitelist with all my subnets (internal, external). Using the same config (blocking src and dst) I had no problem with the previous snort version but I have with this one. It is clear that it blocks the WAN IP which is included in the Whitelist.
/CS
-
Can you publish a screen dump of your whitelist? Just to make sure that you are using aliases. If you have upgraded from a previous version there might still be the old style list (which probably no longer works).
-
No I created a new Alias under the Firewall tab and I copied there my old IPs/Subnets. Then I used this Alias on the Whitelist settings.
Maybe after all these re-installations of snort it has now been fixed. I will turn blocking ON again and I will update my post. :)
-
CS, look also for failed system/shell commands like sed, cp, etc. in the system logs. They might point to the real reason of failure.
-
Hi,
to be sure, I just attacked my pfSense box from outside and started a p2p program from inside with the appropriate rules enabled. This time I have activated blocking for both sides. The offending machines from the WAN sides were blocked as well as my LAN client that started the p2p program. But the ips of the pfsense box nics were not blocked.
I am using the latest package with the patches described earlier.
-
I get errors about the command /usr/bin/sed (invalid command code) and my WAN gateway is still blocked.
-
(1) Find all the classification.config files with find /usr/local -name 'classification.config*'. If you have n interfaces defined for snort you should get at least n+1 copies.
(2) Append config classification: sdf,Sensitive Data was Transmitted Across the Network,2 to the end of each file if the sdf classification is missing.
This is a long story short.
Fesoj, I followed your instructions here to the letter and it worked PERFECTLY as expected. Snort seems to be running steadily for me now.
Would you mind posting screen captures (or e-mailin) of your IF SETTINGS and PREPROCESSOR settings for both your LAN and WAN interface? Of course anything sensitive masked. I just want to be sure I have mine setup correctly with regards to whitelists, home net, sensitive data settings, advanced pass thru settings, etc.
-
CS,
have a look at http://forum.pfsense.org/index.php/topic,51493.msg276317.html#msg276317. Since I haven't seen your system log, I don't know the exact reason of the failure, but I guess patching the sed calls in snort.inc will help.
-
miles267,
settings do not really matter, but which rules you enable could play a role. Also my pfsense box is not an edge router, so some issues cannot occur if you hook it up o an ISP directly and activate pfsense on the WAN NIC.
Feeling comfortable to tackle the rules updated problem?
-
Hello,
Fesoj: I checked all the messages you send, and my installation is compliant to all that… what I think is that there is some problem with the alert_pf output plugin.I made some test about that. The new version of the Snort package generate a whitelist for the box IPs like:
192.168.0.1/24 (referred to a single IP)
while in the old version (I just compared with a virtual machine I use as text that I didn't update) the IPs are written like:
192.168.0.1
.
So I run this test, I looked in the snort.conf file and I found:
output alert_pf: /usr/local/etc/snort/snort_35034_em2/default,snort2c,both,killI edited the /usr/local/etc/snort/snort_35034_em2/default file in order to change the format (for the single IPs) from:
IP/mask
to
IP
and I restarted Snort (without saving anything in order to avoid the "default" file to be recreated).
After some minutes, and some alerts generated, the only IPs that got blocked were the ones NOT included in the whitelist (as it should be and as it was before the latest package changes).
I made some investigation on the spoink plug-in, and yes, in its documentation the IPs in the whitelist are written without mask.So, I think there is something to fix for the alert_pf package, probably the procedure that generate its whitelist.
Thanks,
Michele -
Michele,
I haven't looked at the details of alert_pf yet. I am still busy with the update problem. It would be helpful if ermal finds some time to validate the latest patches so a standard installation would be at the current "patch level". Too many changes at the same time are typically a recipe for disaster.
As far as whitelisting goes, I would need to do some reading first. Currently I can cope with blocking quite easily, but I could imagine some scenarios where it gets more difficult. Before writing some code I'd like to suggest to collect some reference configurations that include the net topology, the snort interfaces, and the rules (actually sources and destinations would suffice). What I mean is, if you have a rule with ANY as the source and HOME_NET as the destination and you are blocking on the destination side, then this makes not always any sense.
PS: If you search the snort forums, you'll find several places where people have difficulties with IP ranges in whitelists, but I have not looked at the details whether this applies here, or whether these issues have been resolved, or whether the issues were due to a misunderstanding how snort works.
-
Whitelist has always been single IPs. It would be nice to use CDIR but it wasn't built that way. Ever since this change to the snort binary, https://github.com/bsdperimeter/pfsense-tools/commit/34fe38d61ba1f858f3c5bcdec6fa583a74e328a4, snort blocks everything unless its in a whitelist as single IP.
HOME_NET IP/Subnets should not be blocked at all.. If you want the system to be able to block an IP in your HOME_NET NETLIST then create a custom NETLIST that doesn't include IMHO.
But by default, HOME_NET should be exempt from blocking.. But since the binary change, this is not the case!
As far as the other issues, that has to do with the php code that Fesoj seems to be fixing, thanks Fesoj!… I'll test when i'm fully online later this week.
-
Cino,
But by default, HOME_NET should be exempt from blocking..
it actually depends. For example, if there is a company policy that forbids eDonkey and friends, then it could make sense to block machines in the HOME_NET. Sometimes this may be better than reporting the fellow to the management (actually 2 weeks ago I needed to attended a court case, where somebody got fired because of a "Facebook" issue) and sometimes, especially in some European countries, it might even be necessary to avoid legal actions because of excessive liability for interference claims. It all boils down to treat your colleagues or clients like little children, but this is a social problem.
-
PS: If you search the snort forums, you'll find several places where people have difficulties with IP ranges in whitelists, but I have not looked at the details whether this applies here, or whether these issues have been resolved, or whether the issues were due to a misunderstanding how snort works.
Whitelist has always been single IPs. It would be nice to use CDIR but it wasn't built that way. Ever since this change to the snort binary,
ok, we understood what the problem is. Before white lists were generated as "IP lists", now even the "default" whitelist is generated as a "network list" and it does not work anymore.
I am now looking at the Spoink code to see what we can do to restore this functionality… but for the moment I have to turn off the IP blocking or everything gets stuck in few minutes!
Ciao,
Michele -
Michel,
after reading Cino's comment, that is in line with what I had in mind, your analysis is right. CIDR entries in the default file seem to be wrong and don't seem to work as expected. For my box the generated entries contain
(1) the loopback address
(2) the WAN address of the box (which is static in my case, so that's fine) [currently the subnet]
(3) the LAN address of the box [currently the subnet]
(4) and the DNS serversI am wondering what happens if under point 2 the WAN address is dynamic. Would this mean that when blocking is enabled, you cannot generally avoid blocking yourself? Maybe there is an update mechanism.
-
Michel,
after reading Cino's comment, that is in line with what I had in mind, your analysis is right. CIDR entries in the default file seem to be wrong and don't seem to work as expected. For my box the generated entries contain
I am wondering what happens if under point 2 the WAN address is dynamic. Would this mean that when blocking is enabled, you cannot generally avoid blocking yourself? Maybe there is an update mechanism.Thanks! But consider, I have about 80 VIPs, 5 NICs, it would be unconfortable to mantain a IP list aligned for the local IPs…
I mean, managing the HOME_NET with an Alias is awesome, just the whitelists should be managed as before, with an "host alias" for the part the user can decide (probably this should be noticed in the interface), and for the "default" part of the white list as single IP addresses without CIR.Now that the problem is known and identified, I trust in Ermal to fix it... ;) Thanks!!
Michele
-
Imho I think the default home_net list should be exempt. If you need blocking, create a custom netlist.
-
Cino,
understood. As long as a custom list is possible.
-
If you see the following error message in your system log:
FATAL ERROR: /usr/local/etc/snort/snort_56964_re1/preproc_rules/sensitive-data.rules(1) Unknown ClassType: sdf
you can either add the type declaration by hand (see some of the earlier posts), or try the following patch:
https://github.com/bsdperimeter/pfsense-packages/pull/288
The reference classification.config file gets extracted from the rule set package (Snort.org and/or Emergingthreats.net), where the last download overwrites the first one. Currently the Snort.org rules are downloaded and unpacked before the ET rules, where the ET rules don't declare the sdf type. Hence the fatal error. The patch reverses the order of unpacking the archives since the Snort.org rules seem to have all the necessary declarations.
Happy patching.
UPDATE: with package vs. 2.5.1 this is obsolete
-
mdima,
HOME_NET != WHITELIST. On the WAN side, I have the default HOME_NET, but a special whitelist (including the IP address on the WAN side (I don't know what to do in case of an ISP supplied address using DHCP)) and this works fine. It's just the way things are setup. As I said before, it is now easier than ever to shoot oneself in the foot.
That is why the option of add wan ips is there.
It will get the right address when theip changes. at least on 2.0+ -
It's been part of the GUI for years and is still there. For custom Netlist.
-
It will get the right address when theip changes. at least on 2.0+
I checked that and the IP of the WAN nic does not get blocked.
-
ermal,
That is why the option of add wan ips is there.
part of the discussion today was about whether the IP ranges actually work in the whitelist (alert_pf). Essentially, they don't work, but I might be wrong.
-
I pushed some fixes to snort to prevent issues with so rules.
Also changed a bit the upgrade process.Please test again.
Fesoj,
I tested the whitelist features and they work with ranges.
Have you installed teh latest binary? -
If you see the following error message in your system log:
FATAL ERROR: /usr/local/etc/snort/snort_56964_re1/preproc_rules/sensitive-data.rules(1) Unknown ClassType: sdf
The reference classification.config file gets extracted from the rule set package (Snort.org and/or Emergingthreats.net), where the last download overwrites the first one. Currently the Snort.org rules are downloaded and unpacked before the ET rules, where the ET rules don't declare the sdf type. Hence the fatal error.
In looking through the snort_check_for_rule_updates.php file, I see the following lines of code that are, I believe, supposed to prevent the classification.config overwrite when both snort and emgerging threats rules are used.
if ($snortdownload == 'off') { foreach (array("classification.config", "reference.config", "sid-msg.map", "unicode.map") as $file) { if (file_exists("{$snortdir}/rules/{$file}")) @copy("{$snortdir}/rules/{$file}", "{$snortdir}/{$file}"); }
This piece of code is in the Emerging Threats extraction and copy section, and it appears to be designed to prevent overwriting the classification.config and other files extracted earlier in the code when Snort rules are enabled. The value of the variable should be "on" when Snort rules are enabled, and thus the copying of the classification.config and other configuration files from the Emerging Threats rules package is bypassed. This would leave the "correct" versions of these files extracted from the Snort rules package.
Why is this section of code not working?
-
ermal,
I tested the whitelist features and they work with ranges.
give me a few days and I'll present an example, it just takes some time to document it. It is also possible that I am misunderstanding s.th. here. My setup is working, so I am fine. Also, I am using the latest binaries.
-
I removed subnets/cidr mask from auto generated addreses for whitelist and you can put them with the alias you configure if you want.
I bumped the package to 2.5.1
-
bmeeks,
Why is this section of code not working?
well, if you download both rule sets, then the ET part will enter the loop where some files from the rules directory of the unpacked archive are copied into the configuration directory, thereby overwriting the any previous version.
-
bmeeks,
Why is this section of code not working?
well, if you download both rule sets, then the ET part will enter the loop where some files from the rules directory of the unpacked archive are copied into the configuration directory, thereby overwriting the any previous version.
Well, it's sort of a moot point now since I see in the latest update Ermal changed the code a bit so Emerging Threats are done first.
The way I understood the old code, it unpacked each rule set into a temp directory and then copied files into the working directory. The snippet I posted should have been hit before the classification.config file from Emerging Threats was copied over into the working directory. If it saw that Snort downloads were "on", it should have skipped the @copy function where the Emerging Threats classification.config and other configuration files were copied from the temp area where they were extracted into the working directory along with the previously extracted and copied Snort files.
-
2.5.1 throws the following error which was not there before without changing any configuration (did complete reinstall):
FATAL ERROR: /usr/local/etc/snort/snort_4672_em1/rules/snort_botnet-cnc.rules(366) Unknown rule option: 'ssl_state'.
[EDIT] Suprise: the preprocessor page is heavily modified and now we have to enable SSL data separately. It was unchecked and thats where the error came from. Doing further testing now.
-
bmeeks,
https://github.com/Fesoj/pfsense-packages/compare/patch-3 :)
Update: Initially I picked the wrong patch.
-
judex,
FATAL ERROR: /usr/local/etc/snort/snort_4672_em1/rules/snort_botnet-cnc.rules(366) Unknown rule option: 'ssl_state'.
there is a section in the snort user's manual about the dynamic SSL preprocessor. I've never found a reason to activate this one.
On the other hand, did you activate this for the latest version or did the error message appear out of nowhere?
-
Thx for your answer and the investitgation you did during the last days Fesoj!
I edited my post because I found the new preproc settings and enabled SSL data there. Now snort starts without warning.
If I do not enable SSL-data an preproc page I get the errors from botnet-cnc and if disabled from exploit.rules…So I obviousely need it if I want to enable botnet rules etc.
-
I just updated the snort package and now upon restart its giving me
Jul 22 12:38:41 snort[26253]: FATAL ERROR: /usr/local/etc/snort/snort_44959_re0/rules/snort_botnet-cnc.rules(372) Unknown rule option: 'ssl_state'.
Jul 22 12:38:41 snort[26253]: FATAL ERROR: /usr/local/etc/snort/snort_44959_re0/rules/snort_botnet-cnc.rules(372) Unknown rule option: 'ssl_state'.I havent changed my rules/categories. The same as i have been running for some time.
Good news was when I updated I didnt get the errors in the system log like i did before upon completion of the install.
I noticed a new SSL option on the preprocesser Tab.
Enable that option and restarted no issues/errors so far.
I want to say thanks for all the work you all have been doing on this package to keep it updated/adding new features/ resolving bugs.
I cant imagine not having snort up and running. :-)
-
kilthro,
try to deactivate the rules that require the SSL preprocessor and see what happens. Then fiddle around with snort.conf for the associated interface(s). With some luck the snort user's manual contains sufficient info to do that.
Please report when things are running.
-
kilthro,
try to deactivate the rules that require the SSL preprocessor and see what happens. Then fiddle around with snort.conf for the associated interface(s). With some luck the snort user's manual contains sufficient info to do that.
Please report when things are running.
Sorry if my post was misleading. I had the error and I did get it to run fine after enabling the ssl option. I was just posting stating that I had the error, I found the new option and enabled it and all is working just fine now..
Just getting some strange mem cap reached alerts in snort now for pop normalization… Need to look into that.. Other than that, all appears good. Need to try the auto update out later . ;)
Thanks for your hard work with this package.
-
kilthro,
so the "Enable SSL Data" option was not checked? And after enabling it, the snort config was ok?