Whats up with the snort package(s)? Seems only snort 2 is available.
Wiki states
Packages for both Snort 2.x as well as Snort 3.x are currently available. This page is focused exclusively on the 3.x series.
Makes things quite confusing. packages for snort3 are not available in 23.05.3.
1 Like
greem
April 9, 2024, 1:51pm
2
[heavily edited reply now]
snort v2 was deprecated from snapshot in January '24, leaving only snort3. But you're right, snort3 isn't in 23.05.3 - and that is confusing!
1 Like
efahl
April 9, 2024, 3:48pm
3
snort3 is built in 22.x and earlier, but not in the 23 series. I have no idea why, as the package and makefile look fine when you switch to the v23.05.3 branch.
I think something is broken in the build config, make menuconfig
on v23.05.xxx shows no snort entries, but if you look for it in 22.x or main
, it's there and can be configured and built.
efahl
April 9, 2024, 6:35pm
4
1 Like
hnyman
April 9, 2024, 8:59pm
5
Source code is your friend...
My two cents are on the backport of the HAS_LUAJIT_ARCH dependency.
Main/master shows that definition:
.config - OpenWrt Configuration
> Search (LUAJIT) ────────────────────────────────────────────────────────────
┌──────────────────────────── Search Results ─────────────────────────────┐
│ Symbol: HAS_LUAJIT_ARCH [=y] │
│ Type : bool │
│ Defined at tmp/.config-package.in:26439 │
│ │
But 23.05 has no idea about that:
.config - OpenWrt Configuration
> Search (LUAJIT) ───────────────────────────────────────────────────────────────
┌────────────────────────────── Search Results ──────────────────────────────┐
│ │
│ Symbol: HAS_LUAJIT_ARCH [=HAS_LUAJIT_ARCH] │
│ Type : unknown │
│ │
And that symbol is a hard dependency since this in master:
committed 03:42PM - 25 Sep 23 UTC
Add HAS_LUAJIT_ARCH dependency to any user of luajit to fix circular
dependency … limitation.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
That requirement in snort3 has been backported into 23.05 by thuis commit
openwrt:openwrt-23.05
← graysky2:snort-23.05
opened 12:15PM - 25 Feb 24 UTC
Backport of:
3696345783ab13f69bcd353c8fbf41c51e46e267
de26e96ffde51b7cda28cd8e… 02bcd1a07f3ab073
Which updates snort3 to 3.1.81.0 and also builds against both hyperscan and gperftools.
Changelog: https://github.com/snort3/snort3/releases/tag/3.1.81.0
,,_ -*> Snort++ <*-
o" )~ Version 3.1.81.0
'''' By Martin Roesch & The Snort Team
http://snort.org/contact#team
Copyright (C) 2014-2024 Cisco and/or its affiliates. All rights reserved.
Copyright (C) 1998-2013 Sourcefire, Inc., et al.
Using DAQ version 3.0.14
Using LuaJIT version 2.1.0-beta3
Using OpenSSL 3.0.13 30 Jan 2024
Using libpcap version 1.10.4 (with TPACKET_V3)
Using PCRE version 8.45 2021-06-15
Using ZLIB version 1.3.1
Using Hyperscan version 5.4.2 2024-02-16
Using LZMA version 5.4.6
Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne
Probably @ansuel @bkpepe know more about HAS_LUAJIT_ARCH
Ansuel
April 9, 2024, 9:01pm
6
I guess the commit has to be backported as well?
hnyman
April 9, 2024, 9:04pm
7
No idea, I just stumbled into the "disappearing package" and looked for reasons why snort3 does show up in menuconfig. Never used or compiled snort3 (or luajit) by myself.
1 Like
efahl
April 9, 2024, 10:27pm
8
One thing solved and another pops up...
@hnyman , good sleuthing. Turns out that HAS_LUAJIT_ARCH only appears in the backported snort3/Makefile. Editing the make file to remove the reference now shows snort3 in menuconfig.
But...
When I include the package in .config, the snort3 package build fails miserably, lots of missing symbols. Reported here https://github.com/openwrt/packages/issues/20994
[10/819] Building CXX object src/main/CMakeFiles/main.dir/oops_handler.cc.o
FAILED: src/main/CMakeFiles/main.dir/oops_handler.cc.o
/home/efahlgren/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/bin/x86_64-openwrt-linux-musl-g++ -DHAVE_CONFIG_H -Dinline=inline -Drestrict=__restrict -I/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/network_inspectors -I/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src -I/home/efahlgren/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include/luajit-2.1 -I/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0 -I/home/efahlgren/openwrt/openwrt/staging_dir/host/include -I/home/efahlgren/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include/hs -I/home/efahlgren/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include/uuid -I/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0=snort3-3.1.81.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/efahlgren/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include/daq3 -I/home/efahlgren/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include/tirpc -fvisibility=hidden -DNDEBUG -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DNDEBUG -std=c++17 -MD -MT src/main/CMakeFiles/main.dir/oops_handler.cc.o -MF src/main/CMakeFiles/main.dir/oops_handler.cc.o.d -o src/main/CMakeFiles/main.dir/oops_handler.cc.o -c /home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc
/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc: In member function 'void OopsHandler::set_current_message(DAQ_Msg_h, snort::SFDAQInstance*)':
/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc:61:9: error: 'DIOCTL_GetPrivDataLen' was not declared in this scope
61 | DIOCTL_GetPrivDataLen ioctl_data = {cur_msg, 0};
| ^~~~~~~~~~~~~~~~~~~~~
/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc:62:48: error: 'DIOCTL_GET_PRIV_DATA_LEN' was not declared in this scope
62 | if (DAQ_SUCCESS == daq_instance->ioctl(DIOCTL_GET_PRIV_DATA_LEN, &ioctl_data, sizeof(ioctl_data)))
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc:62:75: error: 'ioctl_data' was not declared in this scope
62 | if (DAQ_SUCCESS == daq_instance->ioctl(DIOCTL_GET_PRIV_DATA_LEN, &ioctl_data, sizeof(ioctl_data)))
| ^~~~~~~~~~
/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc: In member function 'void OopsHandler::eternalize(int)':
/home/efahlgren/openwrt/openwrt/build_dir/target-x86_64_musl/snort3-3.1.81.0/src/main/oops_handler.cc:97:27: error: 'daq_msg_get_priv_data' was not declared in this scope; did you mean 'daq_msg_get_data'?
97 | memcpy(priv_data, daq_msg_get_priv_data(msg), std::min<size_t>(priv_data_len, sizeof(priv_data)));
| ^~~~~~~~~~~~~~~~~~~~~
| daq_msg_get_data
ninja: build stopped: subcommand failed.
I'll carry on over on the -devel list, and stop posting on this thread, at least until something is resolved (no sense in posting everything twice).
Belay that, discussion will be continued at https://github.com/openwrt/packages/issues/23861
1 Like
efahl
April 20, 2024, 5:51pm
9
Snort3 has just appeared in the 23.05.3 release branch (at least for x86/64):
https://downloads.openwrt.org/releases/packages-23.05/x86_64/packages/snort3_3.1.82.0-1_x86_64.ipk
(@kimboslice , you should probably mark this thread as "solved".)
2 Likes
Thanks for opening that issue and getting this resolved!
2 Likes
quba
April 30, 2024, 10:58am
11
Don't know if I'm jumping onto correct thread, but I have installed snort3
today with opkg
and tried to follow wiki, but snort-rules
and snort-mgr
utilities seem to not be present:
# snort-rules
-ash: snort-rules: not found
# snort-mgr
-ash: snort-mgr: not found
1 Like
efahl
April 30, 2024, 4:48pm
12
Correct, they are only present in snapshot, and don't appear in 23.05 or earlier.
All of the new stuff is just scripts (sh
and ucode
), so probably works on 23.05... Look in https://github.com/openwrt/packages/tree/master/net/snort3 (the Makefile
can tell you how its layed out, and files/
contains the scripts and supporting files).
1 Like
system
Closed
May 10, 2024, 4:48pm
13
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.