Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPS not blocking even though get blocked alerts #3211

Closed
L1ghtn1ng opened this issue Feb 9, 2019 · 18 comments
Closed

IPS not blocking even though get blocked alerts #3211

L1ghtn1ng opened this issue Feb 9, 2019 · 18 comments
Assignees
Labels
bug Production bug

Comments

@L1ghtn1ng
Copy link

As the title says, I am getting the above. I have et-pro-telemetry rules and I did have the opnsense app detect test rule enabled to block eicar and I get the alerts for that but it does not actually stop the download. I am running 19.1.1

@mimugmail
Copy link
Member

Can you check if rules in /usr/local/etc... are alert or drop?

@L1ghtn1ng
Copy link
Author

They are drop except for 1 rule in each file and in a few I have the following example

#@opnsense_download_hash:<hash>

@AdSchellevis
Copy link
Member

@L1ghtn1ng the @opnsense_download_hash doesn't do anything, it's for version control. When did your issue first appear? (up to which version are you sure your setup functioned?)

@L1ghtn1ng
Copy link
Author

L1ghtn1ng commented Feb 10, 2019 via email

@AdSchellevis
Copy link
Member

@L1ghtn1ng I think we got a bug here, can you try to install an older version, restart suricata (wait until fully loaded, cpu usage drops), and confirm that this issue is gone?

pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.1/latest/Latest/GeoIP.txz
pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.1/latest/Latest/suricata.txz
service suricata restart

To revert to the production version:

pkg install suricata
pkg remove GeoIP
service suricata restart

Make sure you can access the machine using another interface/console, in case netmap interferes with your traffic.

@L1ghtn1ng
Copy link
Author

L1ghtn1ng commented Feb 10, 2019 via email

@AdSchellevis
Copy link
Member

ok, can you do the same with suricata 4.0.6 from 18.7?

pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.7/MINT/18.7.9/OpenSSL/All/GeoIP-1.6.12.txz
pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.7/MINT/18.7.9/OpenSSL/All/suricata-4.0.6.txz

and then the exact same with suricata 4.1.0, to track when this issue seems to have appeared for the first time.

pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.7/MINT/18.7.9/OpenSSL/All/suricata-devel-4.1.0.txz

Thanks in advance!

@L1ghtn1ng
Copy link
Author

L1ghtn1ng commented Feb 10, 2019

Do not know if it makes a difference or not but I am using libreSSL instead of OpenSSL, will the commands above still be okay?

@AdSchellevis
Copy link
Member

oops, no, you need the Libre files, change OpenSSL for LibreSSL and you should be ok

@L1ghtn1ng
Copy link
Author

Is this something to worry about?

root@firewall:~ # pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.7/MINT/18.7.9/LibreSSL/All/suricata-devel-4.1.0.txz
Fetching suricata-devel-4.1.0.txz: 100% 1 MiB 1.1MB/s 00:01
Installing suricata-devel-4.1.0...
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/bin/suricata ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/etc/rc.d/suricata ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/etc/suricata/classification.config.sample ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/etc/suricata/reference.config.sample ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/etc/suricata/suricata.yaml.sample ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/etc/suricata/threshold.config.sample ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/bstr.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/bstr_builder.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_base64.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_config.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_connection_parser.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_core.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_decompressors.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_hooks.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_list.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_multipart.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_table.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_transaction.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_urlencoded.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_utf8_decoder.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/include/htp/htp_version.h ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/lib/libhtp.a ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/lib/libhtp.so ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/lib/libhtp.so.2 ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/lib/libhtp.so.2.0.0 ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/libdata/pkgconfig/htp.pc ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/man/man1/suricata.1.gz ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/AUTHORS ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/Basic_Setup.txt ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/GITGUIDE ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/INSTALL ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/INSTALL.PF_RING ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/INSTALL.WINDOWS ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/NEWS ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/README ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/Setting_up_IPSinline_for_Linux.txt ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/TODO ignored by forced mode
pkg: suricata-devel-4.1.0 conflicts with suricata-4.0.6 (installs files into the same place). Problematic file: /usr/local/share/doc/suricata/Third_Party_Installation_Guides.txt ignored by forced mode
Extracting suricata-devel-4.1.0: 100%
Message from suricata-devel-4.1.0:

===========================================================================

If you want to run Suricata in IDS mode, add to /etc/rc.conf:

suricata_enable="YES"
suricata_interface="<if>"

NOTE: Declaring suricata_interface is MANDATORY for Suricata in IDS Mode.

However, if you want to run Suricata in Inline IPS Mode in divert(4) mode,
add to /etc/rc.conf:

suricata_enable="YES"
suricata_divertport="8000"

NOTE:
Suricata won't start in IDS mode without an interface configured.
Therefore if you omit suricata_interface from rc.conf, FreeBSD's
rc.d/suricata will automatically try to start Suricata in IPS Mode
(on divert port 8000, by default).

Alternatively, if you want to run Suricata in Inline IPS Mode in high-speed
netmap(4) mode, add to /etc/rc.conf:

suricata_enable="YES"
suricata_netmap="YES"

NOTE:
Suricata requires additional interface settings in the configuration
file to run in netmap(4) mode.

RULES: Suricata IDS/IPS Engine comes without rules by default. You should
add rules by yourself and set an updating strategy. To do so, please visit:

http://www.openinfosecfoundation.org/documentation/rules.html
http://www.openinfosecfoundation.org/documentation/emerging-threats.html

You may want to try BPF in zerocopy mode to test performance improvements:

sysctl -w net.bpf.zerocopy_enable=1

Don't forget to add net.bpf.zerocopy_enable=1 to /etc/sysctl.conf

===========================================================================

@AdSchellevis
Copy link
Member

not really, the files overlap. if you reinstall the originals when done you should be ok.

pkg install suricata
pkg remove GeoIP
service suricata restart

@L1ghtn1ng
Copy link
Author

I can confirm that the problem happens with this version of suricata as all the other versions worked fine

pkg add -f https://pkg.opnsense.org/FreeBSD:11:amd64/18.7/MINT/18.7.9/LibreSSL/All/suricata-devel-4.1.0.txz

@AdSchellevis
Copy link
Member

@L1ghtn1ng thanks for confirming, we'll try to debug some more and take it up with the suricata people.

@AdSchellevis AdSchellevis self-assigned this Feb 10, 2019
@AdSchellevis AdSchellevis added the bug Production bug label Feb 10, 2019
@L1ghtn1ng
Copy link
Author

L1ghtn1ng commented Feb 10, 2019

No problem, I also have it set to block on lan and using hyperscan

@AdSchellevis
Copy link
Member

Just posting some stuff for my own reference, compiled some different versions and things seem to break between these commits:

[defective 6/2/2018] OISF/suricata@e96d9c1
[functional 31/1/2018] OISF/suricata@d212194

@AdSchellevis
Copy link
Member

@L1ghtn1ng ok, @inliniac helped us find the issue https://redmine.openinfosecfoundation.org/issues/2811

Can you try the following on your machine?

Make sure the latest suricata version is installed:

pkg install -f suricata

Patch for https://redmine.openinfosecfoundation.org/issues/2811, using:

opnsense-patch 86957375

Then go to the web interface and apply your settings, just to be sure, also stop/start suricata and test again.

Thanks in advance!

@L1ghtn1ng
Copy link
Author

@AdSchellevis @inliniac I can confirm that the patch fixes the problem

@AdSchellevis
Copy link
Member

@L1ghtn1ng Thanks, case closed, I'll ask @fichtner to include the patch in 19.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

3 participants