59 Commits

Author SHA1 Message Date
Vincent Li
8b29912521 suricata-xdp: resolve memlock and stack smashing
suricata XDP support requires xdp-tools with
libbpf 1.4 to resolve stack smash issue.

also workaround memlock operation not permitted
by running suricata as root since load/attach
XDP program requires root privilige anyway.

see: https://github.com/vincentmli/BPFire/issues/54

Usage scenario:

since suricata IPS XDP capture mode works as
layer 2 bridge, BPFire netfilter firewall, NAT
IP route  will be bypassed. no IP address should
be assigned to red0 and green0 interface.

172.16.1.0/24          inline              172.16.1.0/24
red network<-->red0(xdp)<-->green0(xdp)<-->green network

we can run setup command to assign IP/Mask 0.0.0.0/0.0.0.0
to red0 and green0, then reboot BPFire, BPFire DHCP
will stops working after reboot. green network client
can get DHCP IP from upstream dhcp server.

start suricata manually

suricata -c /etc/suricata/suricata-xdp.yaml --af-packet
xdp_filter.bpf program will be attached to red0 and gree0
interface

not sure if we should add GUI for suricata XDP capture mode
since this is not common use case.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-18 19:47:59 +00:00
Vincent Li
1eceb143ed suricata: add suricata ebpf xdp capture mode
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-10-17 02:11:19 +00:00
Michael Tremer
89941c3d13 suricata: Update to 6.0.16
https://redmine.openinfosecfoundation.org/versions/201

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-09 14:14:46 +00:00
Matthias Fischer
bf85d30b58 suricata: Update to 6.0.15
Excerpt from changelog:

"6.0.15 -- 2023-10-18

Security #6363: mime: quadratic complexity in MimeDecAddEntity (6.0.x backport)
Bug #6407: email: disabled fields in suricata.yaml also get logged (6.0.x backport)
Bug #6403: detect: multi-level tunneling inspection fails (6.0.x backport)
Bug #6377: byte_jump with negative post_offset before start of buffer failure (6.0.x backport)
Task #6364: decode: add drop reason for stream reassembly memcap (6.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-10-20 08:44:02 +00:00
Matthias Fischer
c7e583d0f2 suricata: Update to 6.0.14
Excerpt from changelog:

"6.0.14 -- 2023-09-13

Security #6289: Crash in SMTP parser during parsing of email (6.0.x backport)
Security #6196: process exit in hyperscan error handling  (6.0.x backport)
Security #6156: dcerpc: max-tx config parameter, also for UDP (6.0.x backport)
Bug #6285: community-id: Fix IPv6 address sorting not respecting byte order (6.0.x backport)
Bug #6248: Multi-tenancy: crash under test mode when tenant signature load fails (6.0.x backport)
Bug #6245: tcp: RST with data used in reassembly (6.0.x backport)
Bug #6236: if protocol dcerpc first packet type is Alter_context, it will not parse dcerpc (6.0.x backport)
Bug #6228: ips/af-packet: crash when copy-iface is the same as the interface (6.0.x backport)
Bug #6227: windows: lua script path truncated (6.0.x backport)
Bug #6226: Decode-events of IPv6 GRE are not triggered (6.0.x backport)
Bug #6224: base64: complete support for RFC2045 (6.0.x backport)
Bug #6220: Backport tenant_id conversion to uint32_t
Bug #6213: file.magic: rule reload can lead to crashes (6.0.x backport)
Bug #6193: smtp: Attachment not being md5 matched (6.0.x backport)
Bug #6192: smtp: use every byte to compute email.body_md5 (6.0.x backport)
Bug #6182: log-pcap: fix segfault on lz4 compressed pcaps (6.0.x backport)
Bug #6181: eve/alert: deprecated fields can have unexpected side affects (6.0.x backport)
Bug #6174: FTP bounce detection doesn't work for big-endian platforms (6.0.x backport)
Bug #6166: http2: fileinfo events log http2 object instead of http object as alerts and http2 do (6.0.x backport)
Bug #6139: smb: wrong offset when parse SMB_COM_WRITE_ANDX record (6.0.x backport)
Bug #6082: pcap: device reopen broken (6.0.x backport)
Bug #6068: pcap: memory leaks (6.0.x backport)
Bug #6045: detect: multi-tenancy leaks memory if more than 1 tenant registered (6.0.x backport)
Bug #6035: stream.midstream: if enabled breaks exception policy (6.0.x backport)
Bug #5915: rfb: parser returns error on unimplemented record types (6.0.x backport)
Bug #5794: eve: if alert and drop rules match for a packet, "alert.action" is ambigious (6.0.x backport)
Bug #5439: Invalid certificate when Issuer is not present.
Optimization #6229: Performance impact of Cisco Fabricpath (6.0.x backport)
Optimization #6203: detect: modernize filename fileext filemagic (6.0.x backport)
Optimization #6153: suricatasc: Gracefully handle unsupported commands (6.0.x backport)
Feature #6282: dns/eve: add 'HTTPS' type logging (6.0.x backport)
Feature #5935: ips: add 'master switch' to enable dropping on traffic (handling) exceptions (6.0.x backport)
Documentation #6234: userguide: add installation from Ubuntu PPA section (6.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-09-19 11:06:24 +00:00
Matthias Fischer
dbd7bafb4d suricata: Update to 6.0.13
Excerpt from changelog:

"6.0.13 -- 2023-06-15

Security #6119: datasets: absolute path in rules can overwrite arbitrary files (6.0.x backport)
Bug #6138: Decode-events of IPv6 packets are not triggered (6.0.x backport)
Bug #6136: suricata-update: dump-sample-configs: configuration files not found (6.0.x backport)
Bug #6125: http2: cpu overconsumption in rust moving/memcpy in http2_parse_headers_blocks (6.0.x backport)
Bug #6113: ips: txs still logged for dropped flow (6.0.x backport)
Bug #6056: smtp: long line discard logic should be separate for server and client (6.0.x backport)
Bug #6055: ftp:  long line discard logic should be separate for server and client (6.0.x backport)
Bug #5990: smtp: any command post a long command gets skipped (6.0.x backport)
Bug #5982: smtp: Long DATA line post boundary is capped at 4k Bytes (6.0.x backport)
Bug #5809: smb: convert transaction list to vecdeque (6.0.x backport)
Bug #5604: counters: tcp.syn, tcp.synack, tcp.rst depend on flow (6.0.x backport)
Bug #5550: dns: allow dns messages with invalid opcodes (6.0.x backport)
Task #5984: libhtp 0.5.44 (6.0.x backport)
Documentation #6134: userguide: add instructions/explanation for (not) running suricata with root (6.0.x backport)
Documentation #6121: datasets: 6.0.x work-arounds for dataset supply chain attacks"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-06-16 15:56:53 +00:00
Matthias Fischer
bf0aa7f25b suricata: Update to 6.0.12
"6.0.12 -- 2023-05-08

Bug #6040: tcp: failed assertion ASSERT: !(ssn->state != TCP_SYN_SENT) (6.0.x backport)
Bug #6039: TCP resets have incorrect len, nh in IPv6 (6.0.x backport)
Bug #6034: time: integer comparison with different signs (6.0.x backport)
Bug #6031: af-packet: reload not occurring until packets are seen (6.0.x backport)
Bug #6020: smtp: fuzz debug assertion trigger (6.0.x backport)
Bug #6018: scan-build warning for mime decoder (6.0.x backport)
Bug #6017: scan-build warnings for ac implementations (6.0.x backport)
Bug #6016: scan-build warnings in radix implementation (6.0.x backport)
Bug #6015: scan-build warning for detect sigordering (6.0.x backport)
Bug #6014: scan-build warnings for detect address handling (6.0.x backport)
Bug #6013: scan-build warning for detect port handling (6.0.x backport)
Bug #6007: Unexpected behavior of `endswith` in combination with negated content matches (6.0.x backport)
Bug #5999: exception/policy: make work with simulated flow memcap (6.0.x backport)
Bug #5997: perf shows excessive time in IPOnlyMatchPacket (6.0.x backport)
Bug #5980: rust: warning for future compile errors
Bug #5961: smb: wrong endian conversion when parse NTLM Negotiate Flags (6.0.x backport)
Bug #5958: bpf: postpone IPS check after IPS runmode is determined from the configuration file (6.0.x backport)
Bug #5934: app-layer-htp: Condition depending on enabled IPS mode never true (6.0.x backport)
Optimization #6033: detect using uninitialized engine mode (6.0.x backport)
Feature #5996: Add support for 'inner' PF_RING clustering modes (6.0.x backport)
Task #6052: github-ci: add windows + windivert build (6.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
2023-05-29 06:47:09 +00:00
Matthias Fischer
c1ef4566cf suricata: Update to 6.0.11
Excerpt from changelog:

"6.0.11 -- 2023-04-13

Security #5947: byte_math: Division by zero possible. (6.0.x backport)
Bug #5970: detect: reload can stall if flow housekeeping takes too long (6.0.x backport)
Bug #5967: flowworker: Assertion in CheckWorkQueue (6.0.x backport)
Bug #5953: http: multipart data is not filled up to request.body-limit (6.0.x backport)
Bug #5951: detect: multi-tenancy crash (6.0.x backport)
Bug #5950: http2: quadratic complexity when reducing dynamic headers table size (6.0.x backport)
Bug #5949: smtp: quadratic complexity for tx iterator with linked list (6.0.x backport)
Bug #5948: fast_pattern assignment of specific content in combination with urilen results in FN (6.0.x backport)
Bug #5946: flow/manager: fix unhandled division by 0 (prealloc: 0) (6.0.x backport)
Bug #5942: exception/policy: flow action doesn't fall back to packet action when there's no flow (6.0.x backports)
Bug #5933: smb: tx logs sometimes have duplicate `tree_id` output (6.0.x backport)
Bug #5932: rfb/eve: depth in pixel format logged twice (6.0.x backport)
Bug #5906: dns: unused events field can overflow as an integer
Bug #5903: UBSAN: undefined shift in DetectByteMathDoMatch (6.0.x backport)
Bug #5899: smb: no consistency check between NBSS length and length field for some SMB operations (6.0.x backport)
Bug #5898: smb: possible evasion with trailing nbss data (6.0.x backport)
Bug #5896: base64_decode not populating up to an invalid character (6.0.x backport)
Bug #5895: stream: connections time out too early (6.0.x backport)
Bug #5889: stream: SYN/ACK timestamp checking blocks valid traffic (6.0.x backport)
Bug #5888: false-positive drop event_types possible on passed packets (6.0.x backport)
Bug #5887: stream: overlap with different data false positive (6.0.x backport)
Bug #5886: mime: debug assertion on fuzz input (6.0.x backport)
Bug #5879: netmap: Module registration displays whether info about new API usage
Bug #5863: netmap: packet stalls (6.0.x backport)
Bug #5854: SMTP does not handle LF post line limit properly (6.0.x backport)
Bug #5852: tcp/stream: session reuse on tcp flows w/o sessions (6.0.x backport)
Feature #5853: yaml: set suricata version in generated config (6.0.x backport)
Task #5985: libhtp 0.5.43 (6.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
2023-05-11 20:00:37 +00:00
Matthias Fischer
3178fa3b32 suricata: Update to 6.0.10
""6.0.10 -- 2023-01-31

Security #5804: Suricata crashes while processing FTP (6.0.x backport)
Bug #5815: detect: config keyword prevents tx cleanup (6.0.x backport)
Bug #5812: nfs: debug validation triggered on nfs2 read
Bug #5810: smb/ntlmssp: parser incorrectly assumes fixed field order (6.0.x backport)
Bug #5806: exceptions: midstream flows are dropped if midstream=true && stream.midstream-policy=drop-flow (6.0.x backport)
Bug #5796: TLS Handshake Fragments not Reassembled (6.0.x backport)
Bug #5795: detect/udp: different detection from rules when UDP/TCP header is broken (6.0.x backport)
Bug #5793: decode: Padded packet to minimal Ethernet length marked with invalid length event (6.0.x backport)
Bug #5791: smb: unbounded file chunk queuing after gap (6.0.x backport)
Bug #5763: libbpf: Use of legacy code in eBPF/XDP programs (6.0.x backport)
Bug #5762: detect/pcre: JIT not disabled when OS doesn't allow RWX pages
Bug #5760: nfs: ASSERT: attempt to subtract with overflow (compound) (6.0.x backport)
Bug #5749: iprep/ipv6: warning issued on valid reputation input (6.0.x backport)
Bug #5744: netmap: 6.0.9 v14 backport causes known packet stalls from v14 implementation in "legacy" mode too
Bug #5738: smb: failed assertion (!((f->alproto == ALPROTO_SMB && txd->files_logged != 0))), function CloseFile, file output-file.c (6.0.x backport)
Bug #5735: smtp: quoted-printable encoding skips empty lines in files (6.0.x backport)
Bug #5723: eve: missing common fields like community id for some event types like RFB
Bug #5601: detect: invalid hex character in content leads to bad debug message (6.0.x backport)
Bug #5565: Excessive qsort/msort time when large number of rules using tls.fingerprint (6.0.x backport)
Bug #5299: YAML warning from default config on 6.0.5
Optimization #5797: tls: support incomplete API to replace internal buffering
Optimization #5790: smb: set defaults for file chunk limits (6.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
2023-02-07 11:30:19 +00:00
Peter Müller
959fe5103b suricata: Update to 6.0.9
Full changelog:

Security #5710: smb: crash inside of streaming buffer Grow() (6.0.x backport)
Security #5694: smtp/base64: crash / memory corruption (6.0.x backport)
Security #5688: decoder/tunnel: tunnel depth not limited properly (6.0.x backport)
Security #5600: ips: encapsulated packet logged as dropped, but not actually dropped (6.0.x backport)
Bug #5715: smb: file not tracked on smb2 async (6.0.x backport)
Bug #5714: SMB2 async responses are not matched with its request (6.0.x backport)
Bug #5709: HTTP/2 decompression bug (6.0.x backport)
Bug #5696: Integer overflow at dcerpc.rs:846 (6.0.x backport)
Bug #5695: readthedocs: not showing pdf download option for recent versions (6.0.x backport)
Bug #5683: FlowSwapFileFlags function is incorrect (6.0.x backport)
Bug #5635: track by_rule|by_both incorrectly rejected for global thresholds (6.0.x backport)
Bug #5633: Pass rules on 6.0.8 are generating alert events when passing tunneled traffic
Bug #5608: base64: skip over all invalid characters for RFC 2045 mode (6.0.x backport)
Bug #5607: base64_decode does not populate base64_data buffer once hitting non-base64 chars (6.0.x backport)
Bug #5602: dcerpc: rust integer underflow (6.0.x backport)
Bug #5599: eve: mac address logging for packet records reverses direction (6.0.x backport)
Bug #5598: detect/tag: timeout handling issues on windows (6.0.x backport)
Bug #5594: ips/tap: in layer 2 ips/tap setups, warn that mixed usage of ips and tap will be removed in 8.0 (6.0.x backport)
Bug #4883: Netmap configuration -- need a configuration option for non-standard library locations (6.0.x backport)
Feature #5478: Support for RFC2231 (6.0.x backport)
Task #5698: libhtp 0.5.42
Task #5570: transversal: update references to suricata webpage version 2 (backport 6.0.x)
Task #4852: netmap: new API version (14) supports multi-ring software mode (6.0.x backport)

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-11-29 14:32:57 +01:00
Matthias Fischer
b655b21a45 suricata: Update to 6.0.8
Changelog:

"6.0.8 -- 2022-09-27

Task #5552: libhtp 0.5.41

6.0.7 -- 2022-09-27

Security #5430: mqtt: DOS by quadratic with too many transactions in one parse (6.0.x backport)
Bug #5559: BUG_ON triggered from TmThreadsInjectFlowById (6.0.x backport)
Bug #5549: Failed assert DeStateSearchState (6.0.x)
Bug #5548: tcp: assertion failed in DoInsertSegment (BUG_ON) (6.0.x)
Bug #5547: rules: less strict parsing of unexpected flowbit options
Bug #5546: rules: don't error on bad hex in content
Bug #5540: detect: transform strip whitespace creates a 0-sized variable-length array: backport6
Bug #5505: http2: slow http2_frames_get_header_value_vec because of allocation [backport6]
Bug #5471: Reject action is no longer working (6.0.x backport)
Bug #5467: rules: more graceful handling of anomalies for stable versions
Bug #5459: Counters are not initialized in all places. (6.0.x backport)
Bug #5448: nfs: add maximum number of operations per compound (6.0.x backport)
Bug #5436: Infinite loop if the sniffing interface temporarily goes down (6.0.x backports)
Bug #5335: flow: vlan.use-for-tracking is not used for ICMPv4 (6.0.x backport)
Bug #4421: flow manager: using too much CPU during idle (6.0.x backport)
Feature #5535: ips: add "reject" action to exception policies (6.0.x backport)
Feature #5500: ips: midstream: add "exception policy" for midstream (6.0.x backport)
Task #5551: doc: add exception policy documentation (6.0.x)
Task #5533: detect/parse: add tests for parsing signatures with reject and drop action (6.0.x backport)
Task #5525: exceptions: error out when invalid configuration value is passed (6.0.x backport)
Task #5381: add `alert-queue-expand-fails` command-line option (6.0.x backport)
Task #5328: python: distutils deprecation warning (6.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-09-30 15:45:58 +00:00
Matthias Fischer
b7f887e3b1 suricata: Update to 5.0.10
Changelog:

"5.0.10 -- 2022-07-12

Bug #5429: TCP flow that retransmits the SYN with a newer TSval not properly tracked (5.0.x backport)
[Note: Therefore 'suricata-5.0-stream-tcp-Handle-retransmitted-SYN-with-TSval.patch' could be removed]

Bug #5424: inspection of smb traffic without smb/dcerpc doesn't work correct.  (5.0.x backport)
Bug #5423: DCERPC protocol detection when nested in SMB (5.0.x backport)
Bug #5404: detect: will still inspect packets of a "dropped" flow for non-TCP (5.0.x backport)
Bug #5388: detect/threshold: offline time handling issue (5.0.x backports)
Bug #5358: test failure on Ubuntu 22.04 with GCC 12 (5.0.x backport)
Bug #5354: detect/alert: fix segvfault when incrementing discarded alerts if alert-queue-expand fails (5.0.x backport)
Bug #5345: CIDR prefix calculation fails on big endian archs (5.0.x backport)
Bug #5343: ftp: quadratic complexity for tx iterator with linked list (5.0.x backport)
Bug #5341: decode/mime: base64 decoding for data with spaces is broken (5.0.x backport)
Bug #5339: PreProcessCommands does not handle all the edge cases (5.0.x backport)
Bug #5325: FTP: expectation created in wrong direction (5.0.x backport)
Bug #5305: cppcheck: various static analyzer "warning"s
Bug #5302: Failed assert DeStateSearchState
Bug #5301: eve: payload field randomly missing even if the packet field is present
Bug #5289: Remove unneeded stack-on-signal initialization.
Bug #5283: 5.0.x: ftp: don't let first incomplete segment be over maximum length
Bug #5124: alerts: 5.0.8/6.0.4 count noalert sigs towards built-in alert limit (5.0.x backport)
Bug #5113: Off-by-one in flow-manager flow_hash row allocation
Bug #5055: Documentation copyright years are invalid
Bug #5021: dataset: error with space in rule language
Bug #4926: Rule error in SMB dce_iface and dce_opnum keywords (5.0.x backport)
Bug #4646: TCP reassembly, failed assert app_progress > last_ack_abs, both sides need to be pruned
Optimization #5123: alerts: use alert queing in DetectEngineThreadCtx (5.0.x backport)
Optimization #5121: Use configurable or more dynamic @ PACKET_ALERT_MAX@ (5.0.x backport)
Task #5322: stats/alert: log out to stats alerts that have been discarded from packet queue (5.0.x backport)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-07-14 09:42:28 +00:00
Peter Müller
40811ff383 Suricata: Install Core Update 167 converter script
My fault, again. :-/

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-05-08 09:01:24 +00:00
Peter Müller
4d4f5df0c8 Merge branch 'temp-stevee-idsv4' into next 2022-05-05 16:07:41 +00:00
Matthias Fischer
30f306a3e2 suricata: Update to 5.0.9
Changelog:

"5.0.9 -- 2022-04-21

Security #4889: ftp: SEGV at flow cleanup due to protocol confusion
Security #5025: ftp: GetLine function buffers data indefinitely if 0x0a was not found int the frag'd input
Security #5028: smtp: GetLine function buffers data indefinitely if 0x0a was not found in the frag'd input
Security #5253: Infinite loop in JsonFTPLogger
Feature #4644: pthreads: set minimum stack size
Bug #4466: dataset file not written when run as user
Bug #4678: Configuration test mode succeeds when reference.config file contains invalid content
Bug #4745: Absent app-layer protocol is always enabled by default
Bug #4819: tcp: insert_data_normal_fail can hit without triggering memcap
Bug #4823: conf: quadratic complexity
Bug #4825: pppoe decoder fails when protocol identity field is only 1 byte
Bug #4827: packetpool: packets in pool may have capture method ReleasePacket callbacks set
Bug #4838: af-packet: cluster_id is not used when trying to set fanout support
Bug #4878: datasets: memory leak in 5.0.x
Bug #4887: dnp3: buffer over read in logging base64 empty objects
Bug #4891: protodetect: SMB vs TLS protocol detection in midstream
Bug #4893: TFTP: memory leak due to missing detect state
Bug #4895: Memory leak with signature using file_data and NFS
Bug #4897: profiling: Invalid performance counter when using sampling
Bug #4901: eve: memory leak related to dns
Bug #4932: smtp: smtp transaction not logged if no email is present
Bug #4955: stream: too aggressive pruning in lossy streams
Bug #4957: SMTP assertion triggered
Bug #4959: suricatasc loop if recv returns no data
Bug #4961: dns: transaction not created when z-bit set
Bug #4963: Run stream reassembly on both directions upon receiving a FIN packet
Bug #5058: dns: probing/parser can return error when it should return incomplete
Bug #5063: Not keyword matches in Kerberos requests
Bug #5096: output: timestamp missing usecs on Arm 32bit + Musl
Bug #5099: htp: server personality radix handling issue
Bug #5101: defrag: policy config can setup radix incorrectly
Bug #5103: Application log cannot to be re-opened when running as non-root user
Bug #5105: iprep: cidr support can set up radix incorrectly
Bug #5107: detect/iponly: rule parsing does not always apply netmask correctly
Bug #5109: swf: coverity warning
Bug #5115: detect/ip_proto: inconsistent behavior when specifying protocol by string
Bug #5117: detect/iponly: mixing netblocks can lead to FN/FP
Bug #5119: smb: excessive CPU utilization and higher packet processing latency due to excessive calls to Vec::extend_from_slice()
Bug #5137: smb: excessive memory use during file transfer
Bug #5150: nfs: Integer underflow in NFS
Bug #5157: xbits: noalert is allowed in rule language with other commands
Bug #5164: iprep: use_cnt can get desynchronized (SIGABRT)
Bug #5171: detect/iponly: non-cidr netmask settings can lead incorrect radix tree
Bug #5193: SSL : over allocation for certificates
Bug #5213: content:"22 2 22"; is parsed without error
Bug #5227: 5.0.x: SMB: Wrong buffer being checked for possible overflow.
Bug #5251: smb: integer underflows and overflows
Task #5006: libhtp 0.5.40"

Additionally, I moved the 'suricata' patch files into a separate directory.
Apart from some line numbers, nothing else was changed.

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
2022-04-23 14:25:03 +00:00
Stefan Schantl
0d99255c06 suricata: Create empty threshold.config file.
The file is referenced in the suricata config file and if not
present some ugly warnings will be displayed/logged during startup.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 14:49:52 +02:00
Stefan Schantl
d44d4ccf34 suricata: Create directory to store the downloaded ruleset files.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 14:48:35 +02:00
Stefan Schantl
b75baeff28 suricata: Do not longer install YAML file for default rules.
This file got obsolete, because it's content will be generated
dynamically by the backend code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 14:42:22 +02:00
Peter Müller
9a7e4d8506 Switch checksums from MD5 to BLAKE2
Historically, the MD5 checksums in our LFS files serve as a protection
against broken downloads, or accidentally corrupted source files.

While the sources are nowadays downloaded via HTTPS, it make sense to
beef up integrity protection for them, since transparently intercepting
TLS is believed to be feasible for more powerful actors, and the state
of the public PKI ecosystem is clearly not helping.

Therefore, this patch switches from MD5 to BLAKE2, updating all LFS
files as well as make.sh to deal with this checksum algorithm. BLAKE2 is
notably faster (and more secure) than SHA2, so the performance penalty
introduced by this patch is negligible, if noticeable at all.

In preparation of this patch, the toolchain files currently used have
been supplied with BLAKE2 checksums as well on
https://source.ipfire.org/.

Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremeripfire.org>
2022-04-02 14:19:25 +00:00
Michael Tremer
a7834bcf10 suricata: Fix check for level one cache line size
riscv64 does not return any value on our machine (maybe because it is
emulated?). "undefined" is however seen as a valid value, which makes
the build fail.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-02-22 19:41:39 +00:00
Stefan Schantl
b822cb159a suricata: Set correct ownership for default rules file.
The file has to be write-able for the WUI.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-01-08 16:17:09 +01:00
Stefan Schantl
9e9d89ae37 suricata: Fix ownership of the classification.config file.
The file has to be write-able for the nobody user.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:32:43 +01:00
Michael Tremer
5a3e97b8d3 suricata: Load *.config files from default location
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-12-19 13:31:13 +01:00
Stefan Schantl
65d5ec52ce suricata: Disable sid 2210059.
This rule emits a massive logspam and temporary will be disabled until
a better solution is found.

Fixes #12738.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-12-11 09:51:24 +00:00
Stefan Schantl
74070fe153 suricata: Move default loaded rulefiles to own included file.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-12-11 09:49:22 +00:00
Michael Tremer
73d18835c0 suricata: Handle retransmitted SYN with TSval
Read more in the patch.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-11-24 09:09:18 +00:00
Michael Tremer
c5c1f30447 suricata: This package is supported on all architectures
There is no need to list them specifically.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-11-24 09:08:23 +00:00
Michael Tremer
30f411694c suricata: Include all default rules
These rules do not drop anything, but only alert when internal parts of
the engine trigger an event. This will allow us more insight on what is
happening.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-11-24 09:06:14 +00:00
Matthias Fischer
58d399710b suricata: Update to 5.0.8
For details see:
https://forum.suricata.io/t/suricata-6-0-4-and-5-0-8-released/1942

"Various security, performance, accuracy and stability issues have been fixed,
including two TCP evasion issues. CVE 2021-37592 was assigned."

Changelog:

"5.0.8 -- 2021-11-16

Security #4635: tcp: crafted injected packets cause desync after 3whs
Security #4727: Bypass of Payload Detection on TCP RST with options of MD5header
Bug #4345: Failed assert in TCPProtoDetectCheckBailConditions size_ts > 1000000UL
Bug #4382: fileinfo "stored: false" even if the file is kept on disk
Bug #4626: DNP3: intra structure overflow in DNP3DecodeObjectG70V6
Bug #4628: alert count shows up as 0 when stats are disabled
Bug #4631: Protocol detection : confusion with SMB in midstream
Bug #4639: Failed assertion in SMTP SMTPTransactionComplete
Bug #4646: TCP reassembly, failed assert app_progress > last_ack_abs, both sides need to be pruned
Bug #4647: rules: Unable to find the sm in any of the sm lists
Bug #4674: rules: mix of drop and pass rules issues
Bug #4676: rules: drop rules with noalert not fully dropping
Bug #4688: detect: too many prefilter engines lead to FNs
Bug #4690: nfs: failed assert self.tx_data.files_logged > 1
Bug #4691: IPv6 : decoder event on invalid fragment length
Bug #4696: lua: file info callback returns wrong value
Bug #4718: protodetect: SEGV due to NULL ptr deref
Bug #4729: ipv6 evasions : fragmentation
Bug #4788: Memory leak in SNMP with DetectEngineState
Bug #4790: af-packet: threads sometimes get stuck in capture
Bug #4794: loopback: different AF_INET6 values per OS
Bug #4816: flow-manager: cond_t handling in emergency mode is broken
Bug #4831: SWF decompression overread
Bug #4833: Wrong list_id with transforms for http_client_body and http file_data
Optimization #3429: improve err msg for dataset rules parsing
Task #4835: libhtp 0.5.39"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2021-11-24 08:57:17 +00:00
Matthias Fischer
bacde6d9c1 suricata: Update to 5.0.7
For details see:

https://forum.suricata.io/t/suricata-6-0-3-and-5-0-7-released/1489

and

https://redmine.openinfosecfoundation.org/versions/166

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-08-16 06:31:32 +00:00
Arne Fitzenreiter
aafdd71b04 switch arm 32 bit arch from armv5tel to armv6l
we have no supported armv5tel board left so we can switch to the higher
arch. This now can use the vpu (still in softfp calling convention to
not break existing installations.)
this fix many compile problems, also boost is now working again.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-07-05 07:42:39 +02:00
Michael Tremer
198443e60c suricata: Disable build on riscv64 for lack of Rust
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-03-06 11:14:51 +00:00
Matthias Fischer
a9285618b9 suricata: Update to 5.0.6
For details see:
https://forum.suricata.io/t/suricata-6-0-2-and-5-0-6-released/1170

and

https://redmine.openinfosecfoundation.org/versions/164

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-03-03 13:27:03 +00:00
Matthias Fischer
3b8e39553d suricata: Downgrade to 5.0.5
Triggered by https://lists.ipfire.org/pipermail/development/2020-December/008868.html

Workaround for https://bugzilla.ipfire.org/show_bug.cgi?id=12548

Downgrading to 'suricata 5.0.5' bypasses Bug #12548 for now,
but its only a temporary workaround...

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-12-16 09:58:56 +00:00
Stefan Schantl
66970ccba3 suricata: Proper use confgured LDFLAGS.
Fixes #12513.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-29 11:30:23 +00:00
Michael Tremer
aa81aaf836 suricata: Link against libatomic on armv5tel
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-27 18:22:05 +00:00
Stefan Schantl
0cdb151831 suricata: Update to 6.0.0.
* Enable RDP and SIP parsers.
* Enable new introduced parsers for RFB and DCERPC.

Because HTTP2 support and parser currently is experimental the suricata
developers decided to disable it at default - we keep this default
setting for now.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-27 11:50:56 +00:00
Stefan Schantl
97fbbaa333 suricata: Update to 5.0.4
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-15 15:34:39 +00:00
Peter Müller
d6d2019fae Suricata: update to 5.0.3
Release notes (https://suricata-ids.org/2020/04/28/suricata-5-0-3-released/, truncated):

    This is the first release after Suricata joined the Oss-Fuzz program, leading to
    discovery of a number of (potential) security issues. We expect that in the coming
    months we’ll fix more such issues, as the fuzzers increase their coverage and we
    continue to improve the seed corpus.

    Feature #3481: GRE ERSPAN Type 1 Support
    Feature #3613: Teredo port configuration
    Feature #3673: datasets: add ‘dataset-remove’ unix command
    Bug #3240: Dataset hash-size or prealloc invalid value logging
    Bug #3241: Dataset reputation invalid value logging
    Bug #3342: Suricata 5.0 crashes while parsing SMB data
    Bug #3450: signature with sticky buffer with subsequent pcre check in a different buffer loads but will never match
    Bug #3491: Backport 5 BUG_ON(strcasecmp(str, “any”) in DetectAddressParseString
    Bug #3507: rule parsing: memory leaks
    Bug #3526: 5.0.x Kerberos vulnerable to TCP splitting evasion
    Bug #3534: Skip over ERF_TYPE_META records
    Bug #3552: file logging: complete files sometimes marked ‘TRUNCATED’
    Bug #3571: rust: smb compile warnings
    Bug #3573: TCP Fast Open – Bypass of stateless alerts
    Bug #3574: Behavior for tcp fastopen
    Bug #3576: Segfault when facing malformed SNMP rules
    Bug #3577: SIP: Input not parsed when header values contain trailing spaces
    Bug #3580: Faulty signature with two threshold keywords does not generate an error and never match
    Bug #3582: random failures on sip and http-evader suricata-verify tests
    Bug #3585: htp: asan issue
    Bug #3592: Segfault on SMTP TLS
    Bug #3598: rules: memory leaks in pktvar keyword
    Bug #3600: rules: bad address block leads to stack exhaustion
    Bug #3602: rules: crash on ‘internal’-only keywords
    Bug #3604: rules: missing ‘consumption’ of transforms before pkt_data would lead to crash
    Bug #3606: rules: minor memory leak involving pcre_get_substring
    Bug #3609: ssl/tls: ASAN issue in SSLv3ParseHandshakeType
    Bug #3610: defrag: asan issue
    Bug #3612: rules/bsize: memory issue during parsing
    Bug #3614: build-info and configure wrongly display libnss status
    Bug #3644: Invalid memory read on malformed rule with Lua script
    Bug #3646: rules: memory leaks on failed rules
    Bug #3649: CIDR Parsing Issue
    Bug #3651: FTP response buffering against TCP stream
    Bug #3653: Recursion stack-overflow in parsing YAML configuration
    Bug #3660: Multiple DetectEngineReload and bad insertion into linked list lead to buffer overflow
    Bug #3665: FTP: Incorrect ftp_memuse calculation.
    Bug #3667: Signature with an IP range creates one IPOnlyCIDRItem by signe IP address
    Bug #3669: Rules reload with Napatech can hang Suricata UNIX manager process
    Bug #3672: coverity: data directory handling issues
    Bug #3674: Protocol detection evasion by packet splitting
    Optimization #3406: filestore rules are loaded without warning when filestore is not enabled
    Task #3478: libhtp 0.5.33
    Task #3514: SMTP should place restraints on variable length items (e.g., filenames)
    Documentation #3543: doc: add ipv4.hdr and ipv6.hdr
    Bundled libhtp 0.5.33
    Bundled Suricata-Update 1.1.2

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 12:26:11 +00:00
Stefan Schantl
8877c587ce suricata: Update to 5.0.2
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-02-15 11:03:24 +00:00
Stefan Schantl
1a65ea1b72 Suricata: Update to 5.0.1
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-02-12 13:28:02 +00:00
Matthias Fischer
ad6d02ccc0 suricata: Update to 4.1.6
Excerpt from 'ChangeLog':

"4.1.6 -- 2019-12-13

Bug #3276: address parsing: memory leak in error path (4.1.x)
Bug #3278: segfault when test a nfs pcap file (4.1.x)
Bug #3279: ikev2 enabled in config even if Rust is disabled
Bug #3325: lua issues on arm (fedora:29) (4.1.x)
Bug #3326: Static build with pcap fails (4.1.x)
Bug #3327: tcp: empty SACK option leads to decoder event (4.1.x)
Bug #3347: BPF filter on command line not honored for pcap file (4.1.x)
Bug #3355: DNS: DNS over TCP transactions logged with wrong direction. (4.1.x)
Bug #3356: DHCP: Slow down over time due to lack of detect flags (4.1.x)
Bug #3369: byte_extract does not work in some situations (4.1.x)
Bug #3385: fast-log: icmp type prints wrong value (4.1.x)
Bug #3387: suricata is logging tls log repeatedly if custom mode is enabled (4.1.x)
Bug #3388: TLS Lua output does not work without TLS log (4.1.x)
Bug #3391: Suricata is unable to get MTU from NIC after 4.1.0 (4.1.x)
Bug #3393: http: pipelining tx id handling broken (4.1.x)
Bug #3394: TCP evasion technique by overlapping a TCP segment with a fake packet (4.1.x)
Bug #3395: TCP evasion technique by faking a closed TCP session (4.1.x)
Bug #3402: smb: post-GAP some transactions never close (4.1.x)
Bug #3403: smb1: 'event only' transactions for bad requests never close (4.1.x)
Bug #3404: smtp: file tracking issues when more than one attachment in a tx (4.1.x)
Bug #3405: Filehash rule does not fire without filestore keyword
Bug #3410: intermittent abort()s at shutdown and in unix-socket (4.1.x)
Bug #3412: detect/asn1: crashes on packets smaller than offset setting (4.1.x)
Task #3367: configure: Rust 1.37+ has cargo-vendor support bundled into cargo (4.1.x)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-29 19:09:25 +00:00
Arne Fitzenreiter
cafef39aa2 Revert "suricata: Enable rust support"
This reverts commit 5b87687cb1.
2019-10-18 20:39:47 +02:00
Stefan Schantl
5b87687cb1 suricata: Enable rust support
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-08 19:08:37 +00:00
Matthias Fischer
dbf1ae2a10 suricata: Update to 4.1.5
Changelog:
"4.1.5 -- 2019-09-24

Feature #3068: protocol parser: vxlan (4.1.x)
Bug #2841: False positive alerts firing after upgrade suricata 3.0 -> 4.1.0 (4.1.x)
Bug #2966: filestore (v1 and v2): dropping of "unwanted" files (4.1.x)
Bug #3008: rust: updated libc crate causes depration warnings (4.1.x)
Bug #3044: tftp: missing logs because of broken tx handling (4.1.x)
Bug #3067: GeoIP keyword depends on now discontinued legacy GeoIP database (4.1.x)
Bug #3094: Fedora rawhide af-packet compilation err (4.1.x)
Bug #3123: bypass keyword: Suricata 4.1.x Segmentation Faults (4.1.x)
Bug #3129: Fixes warning about size of integers in string formats (4.1.x)
Bug #3159: SC_ERR_PCAP_DISPATCH with message "error code -2" upon rule reload completion (4.1.x)
Bug #3164: Suricata 4.1.4: NSS Shutdown triggers crashes in test mode
Bug #3168: tls: out of bounds read
Bug #3170: defrag: out of bounds read
Bug #3173: ipv4: ts field decoding oob read
Bug #3175: File_data inspection depth while inspecting base64 decoded data (4.1.x)
Bug #3184: decode/der: crafted input can lead to resource starvation
Bug #3186: Multiple Content-Length headers causes HTP_STREAM_ERROR (4.1.x)
Bug #3187: GET/POST HTTP-request with no Content-Length, http_client_body miss (4.1.x)"

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-08 18:37:29 +00:00
Erik Kapfer
21a8382383 suricata: Enable EVE logging
The EVE output facility outputs alerts, metadata, file info and protocol specific records through JSON.
for further informations please see --> https://suricata.readthedocs.io/en/suricata-4.1.2/output/eve/index.html .

Signed-off-by: Erik Kapfer <ummeegge@ipfire.org>
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-05 12:44:49 +01:00
Stefan Schantl
a59052cec6 suricata: Update to 4.1.4
This is a minor update to the latest available version from
the suricata 4.1 series.

Fixes #12068.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-05-02 19:33:38 +02:00
Stefan Schantl
728f3d2e8f suricata: Fix ownership and file permissions of files inside /var/lib/suricata.
These files needs to have nobody.nobody as owner but requires read-acces from everyone
to allow the suricata user reading-in this files during startup.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-16 12:28:30 +00:00
Stefan Schantl
e8b1b397c1 suricata: Remove unneeded stuff during build
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-13 10:03:48 +01:00
Stefan Schantl
f717b1dc55 IDS: Set owner of suricata logging directory to correct user
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-10 18:52:40 +01:00