]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agounix-socket: spelling
Victor Julien [Sat, 6 May 2023 05:19:28 +0000 (07:19 +0200)] 
unix-socket: spelling

2 years agoreputation: spelling
Victor Julien [Sat, 6 May 2023 05:19:08 +0000 (07:19 +0200)] 
reputation: spelling

2 years agoippair: spelling
Victor Julien [Sat, 6 May 2023 05:18:51 +0000 (07:18 +0200)] 
ippair: spelling

2 years agohost: spelling
Victor Julien [Sat, 6 May 2023 05:18:40 +0000 (07:18 +0200)] 
host: spelling

2 years agostats: spelling
Victor Julien [Sat, 6 May 2023 05:18:27 +0000 (07:18 +0200)] 
stats: spelling

2 years agoradix: spelling
Victor Julien [Sat, 6 May 2023 05:18:08 +0000 (07:18 +0200)] 
radix: spelling

2 years agohash: spelling
Victor Julien [Sat, 6 May 2023 05:17:51 +0000 (07:17 +0200)] 
hash: spelling

2 years agofile: spelling
Victor Julien [Sat, 6 May 2023 05:17:21 +0000 (07:17 +0200)] 
file: spelling

2 years agoprofiling: spelling
Victor Julien [Sat, 6 May 2023 05:16:46 +0000 (07:16 +0200)] 
profiling: spelling

2 years agounittests: spelling
Victor Julien [Sat, 6 May 2023 05:15:52 +0000 (07:15 +0200)] 
unittests: spelling

2 years agoreference: spelling
Victor Julien [Sat, 6 May 2023 05:14:30 +0000 (07:14 +0200)] 
reference: spelling

2 years agoclassification: spelling
Victor Julien [Sat, 6 May 2023 05:13:23 +0000 (07:13 +0200)] 
classification: spelling

2 years agoutil/lua: spelling
Victor Julien [Sat, 6 May 2023 05:12:52 +0000 (07:12 +0200)] 
util/lua: spelling

2 years agohash/lookup3: spelling
Victor Julien [Sat, 6 May 2023 05:08:25 +0000 (07:08 +0200)] 
hash/lookup3: spelling

2 years agoutil/misc: spelling
Victor Julien [Sat, 6 May 2023 05:07:37 +0000 (07:07 +0200)] 
util/misc: spelling

2 years agoqueue: spelling
Victor Julien [Sat, 6 May 2023 05:00:22 +0000 (07:00 +0200)] 
queue: spelling

2 years agorunmodes: spelling
Victor Julien [Sat, 6 May 2023 04:59:14 +0000 (06:59 +0200)] 
runmodes: spelling

2 years agoconf: spelling
Victor Julien [Sat, 6 May 2023 04:58:36 +0000 (06:58 +0200)] 
conf: spelling

2 years agostream: spelling
Victor Julien [Sat, 6 May 2023 04:58:16 +0000 (06:58 +0200)] 
stream: spelling

2 years agothreading: spelling
Victor Julien [Sat, 6 May 2023 04:57:42 +0000 (06:57 +0200)] 
threading: spelling

2 years agofuzz: spelling
Victor Julien [Sat, 6 May 2023 05:28:00 +0000 (07:28 +0200)] 
fuzz: spelling

2 years agotests: spelling
Victor Julien [Sat, 6 May 2023 04:55:58 +0000 (06:55 +0200)] 
tests: spelling

2 years agoeve: spelling
Victor Julien [Sat, 6 May 2023 04:55:19 +0000 (06:55 +0200)] 
eve: spelling

2 years agooutput: spelling
Victor Julien [Sat, 6 May 2023 04:55:03 +0000 (06:55 +0200)] 
output: spelling

2 years agolog: spelling
Victor Julien [Sat, 6 May 2023 04:54:32 +0000 (06:54 +0200)] 
log: spelling

2 years agoflow: spelling
Victor Julien [Sat, 6 May 2023 04:53:20 +0000 (06:53 +0200)] 
flow: spelling

2 years agocapture: spelling
Victor Julien [Fri, 5 May 2023 19:11:20 +0000 (21:11 +0200)] 
capture: spelling

2 years agodetect: spelling
Victor Julien [Sat, 6 May 2023 06:29:38 +0000 (08:29 +0200)] 
detect: spelling

2 years agodefrag: spelling
Victor Julien [Fri, 5 May 2023 18:46:05 +0000 (20:46 +0200)] 
defrag: spelling

2 years agodecode: spelling
Victor Julien [Fri, 5 May 2023 18:45:48 +0000 (20:45 +0200)] 
decode: spelling

2 years agoapp-layer: spelling
Victor Julien [Sat, 6 May 2023 06:51:41 +0000 (08:51 +0200)] 
app-layer: spelling

2 years agooutput/alert: spelling
Victor Julien [Fri, 5 May 2023 18:44:14 +0000 (20:44 +0200)] 
output/alert: spelling

2 years agoscripts: spelling
Victor Julien [Fri, 5 May 2023 18:41:17 +0000 (20:41 +0200)] 
scripts: spelling

2 years agorust: spelling
Victor Julien [Fri, 5 May 2023 18:40:54 +0000 (20:40 +0200)] 
rust: spelling

2 years agompm/spm: spelling
Victor Julien [Fri, 5 May 2023 18:39:56 +0000 (20:39 +0200)] 
mpm/spm: spelling

2 years agoyaml: spelling
Victor Julien [Fri, 5 May 2023 18:39:05 +0000 (20:39 +0200)] 
yaml: spelling

2 years agorules: spelling
Victor Julien [Fri, 5 May 2023 18:37:48 +0000 (20:37 +0200)] 
rules: spelling

2 years agoqa: spelling
Victor Julien [Fri, 5 May 2023 18:37:26 +0000 (20:37 +0200)] 
qa: spelling

2 years agolua: spelling
Victor Julien [Fri, 5 May 2023 18:35:15 +0000 (20:35 +0200)] 
lua: spelling

2 years agoeve/schema: spelling
Victor Julien [Fri, 5 May 2023 18:34:55 +0000 (20:34 +0200)] 
eve/schema: spelling

2 years agoebpf: spelling
Victor Julien [Fri, 5 May 2023 18:30:35 +0000 (20:30 +0200)] 
ebpf: spelling

2 years agodoxygen: spelling
Victor Julien [Fri, 5 May 2023 18:29:54 +0000 (20:29 +0200)] 
doxygen: spelling

2 years agodoc/userguide: spelling
Victor Julien [Fri, 5 May 2023 18:29:40 +0000 (20:29 +0200)] 
doc/userguide: spelling

2 years agodoc/readme: spelling
Victor Julien [Fri, 5 May 2023 18:28:12 +0000 (20:28 +0200)] 
doc/readme: spelling

2 years agoconfigure: spelling
Victor Julien [Sat, 6 May 2023 05:26:11 +0000 (07:26 +0200)] 
configure: spelling

2 years agochangelog: spelling
Victor Julien [Fri, 5 May 2023 18:26:54 +0000 (20:26 +0200)] 
changelog: spelling

2 years agogithub-ci: spelling
Victor Julien [Fri, 5 May 2023 18:17:09 +0000 (20:17 +0200)] 
github-ci: spelling

2 years agoftp: rename enum to fix spelling
Victor Julien [Sat, 6 May 2023 06:50:58 +0000 (08:50 +0200)] 
ftp: rename enum to fix spelling

2 years agoenip: rename struct to fix spelling
Victor Julien [Sat, 6 May 2023 06:50:17 +0000 (08:50 +0200)] 
enip: rename struct to fix spelling

2 years agodnp3: rename flag to fix spelling
Victor Julien [Sat, 6 May 2023 06:49:35 +0000 (08:49 +0200)] 
dnp3: rename flag to fix spelling

2 years agoclassification: spelling
Victor Julien [Sat, 6 May 2023 05:56:55 +0000 (07:56 +0200)] 
classification: spelling

2 years agoexception/policy: spelling
Victor Julien [Sat, 6 May 2023 05:14:01 +0000 (07:14 +0200)] 
exception/policy: spelling

2 years agodetect/threshold: reword alloc failure message
Victor Julien [Sat, 6 May 2023 06:27:53 +0000 (08:27 +0200)] 
detect/threshold: reword alloc failure message

2 years agodetect: spelling: DetectBufferMpmRegistry
Victor Julien [Sat, 6 May 2023 06:24:23 +0000 (08:24 +0200)] 
detect: spelling: DetectBufferMpmRegistry

2 years agodetect: spelling: SIG_FLAG_INIT_PRIO_EXPLICIT
Victor Julien [Sat, 6 May 2023 06:20:17 +0000 (08:20 +0200)] 
detect: spelling: SIG_FLAG_INIT_PRIO_EXPLICIT

2 years agodetect: spelling: update SigTableApplyStrictCommandLineOption
Victor Julien [Sat, 6 May 2023 06:18:51 +0000 (08:18 +0200)] 
detect: spelling: update SigTableApplyStrictCommandLineOption

2 years agodetect: spelling: multi-tenancy fixes
Victor Julien [Sat, 6 May 2023 06:01:03 +0000 (08:01 +0200)] 
detect: spelling: multi-tenancy fixes

2 years agofuzz: spelling: AFLFUZZ_PERSISTENT_MODE
Victor Julien [Sat, 6 May 2023 05:26:35 +0000 (07:26 +0200)] 
fuzz: spelling: AFLFUZZ_PERSISTENT_MODE

2 years agodoc/install: point to userguide
Victor Julien [Sat, 6 May 2023 05:33:49 +0000 (07:33 +0200)] 
doc/install: point to userguide

2 years agodoc: remove legacy windows install guide
Victor Julien [Sat, 6 May 2023 05:36:26 +0000 (07:36 +0200)] 
doc: remove legacy windows install guide

2 years agodoc: remove legacy pfring install guide
Victor Julien [Sat, 6 May 2023 05:36:12 +0000 (07:36 +0200)] 
doc: remove legacy pfring install guide

2 years agoprscript: remove as it is obsolete
Victor Julien [Fri, 5 May 2023 18:35:51 +0000 (20:35 +0200)] 
prscript: remove as it is obsolete

2 years agodoc: add docutils.conf to disable smart quotes
Wes Hurd [Wed, 3 Mar 2021 11:10:29 +0000 (06:10 -0500)] 
doc: add docutils.conf to disable smart quotes

2 years agorunmode/unix-socket: don't lead http range memory 8817/head
Victor Julien [Fri, 5 May 2023 15:01:51 +0000 (17:01 +0200)] 
runmode/unix-socket: don't lead http range memory

Init was per run, Deinit global, so Init overwrote memory if multiple
pcaps were processed.

Bug: #6046.

2 years agodetect/loader: set proper thread flags
Victor Julien [Fri, 5 May 2023 12:54:09 +0000 (14:54 +0200)] 
detect/loader: set proper thread flags

Fixes: 13beba141c98 ("source: add THV_RUNNING flag to notify of running state")
Bug: #6043.

2 years agorust: rustfmt files with recent new tests 8815/head
Victor Julien [Fri, 5 May 2023 11:42:34 +0000 (13:42 +0200)] 
rust: rustfmt files with recent new tests

2 years agorust: fix new clippy warnings
Victor Julien [Fri, 5 May 2023 11:40:30 +0000 (13:40 +0200)] 
rust: fix new clippy warnings

2 years agodoc: add note on the hashsize recommendation for datasets
Andreas Herz [Thu, 20 Apr 2023 14:24:18 +0000 (16:24 +0200)] 
doc: add note on the hashsize recommendation for datasets

2 years agosmb: add unit tests
Lancer Cheng [Tue, 4 Apr 2023 15:29:10 +0000 (15:29 +0000)] 
smb: add unit tests

Issue: 4865

2 years agodoc: fix description of iptables rules
Victor Julien [Fri, 5 May 2023 09:30:15 +0000 (11:30 +0200)] 
doc: fix description of iptables rules

2 years agosmb/ntlmssp: fix parsing of negotiate flags
tianjinshan [Wed, 8 Mar 2023 07:38:55 +0000 (15:38 +0800)] 
smb/ntlmssp: fix parsing of negotiate flags

Ticket: #5783

2 years agodoc/optimization: move "convert.py" to Python3
Bazzan Don [Tue, 25 Oct 2022 21:04:37 +0000 (22:04 +0100)] 
doc/optimization: move "convert.py" to Python3

Ticket: #5596

2 years agoyaml: grammar fixup
Morris Chan [Mon, 8 Aug 2022 09:43:32 +0000 (17:43 +0800)] 
yaml: grammar fixup

2 years agodevguide: clarify clang formatting changes policy
Juliana Fajardini [Tue, 9 Aug 2022 18:42:18 +0000 (15:42 -0300)] 
devguide: clarify clang formatting changes policy

It was pointed out by a contributor that our workflow mentioned
rewrite-branch as the preferred way, while in fact our policy is to add
said changes to a different commit. Updating documentation to prevent
other situations like that.

2 years agoscripts/clang: remove mention to rewrite-branch
Juliana Fajardini [Tue, 9 Aug 2022 18:20:25 +0000 (15:20 -0300)] 
scripts/clang: remove mention to rewrite-branch

Although we prefer that formatting changes (e.g. the ones made by
running clang) go in a different commit, our script error message was
still suggesting `rewrite-branch` as an option. Removed that and added
that the changes made by the script should go into a separate commit.

2 years agodocs: remove obsolete af-packet warning
Rafael Girão [Wed, 27 Apr 2022 12:57:58 +0000 (14:57 +0200)] 
docs: remove obsolete af-packet warning

2 years agoapp-layer: remove APP_LAYER_PARSER_OPT_UNIDIR_TXS
Jason Ish [Thu, 16 Mar 2023 04:35:23 +0000 (22:35 -0600)] 
app-layer: remove APP_LAYER_PARSER_OPT_UNIDIR_TXS

This flag is no longer needed as a parser can now create a transaction
as unidirectional.

Setting this flag also doesn't make sense on parsers that may have
request/reply and some unidirectional messaging.

2 years agonetmap: Correct LB + Netmap YAML usage
John Dewey [Wed, 10 Mar 2021 20:47:41 +0000 (12:47 -0800)] 
netmap: Correct LB + Netmap YAML usage

Corrected the example YAML configuration when using Netmap and
LB.

2 years agoapp-layer: shorter code for proto string helpers
Philippe Antoine [Thu, 23 Mar 2023 16:32:45 +0000 (17:32 +0100)] 
app-layer: shorter code for proto string helpers

2 years agoscripts: fix setup app layer for output
Philippe Antoine [Thu, 23 Mar 2023 15:45:42 +0000 (16:45 +0100)] 
scripts: fix setup app layer for output

using rust nowadays.

Also remove useless code about files that do not need changes
anymore

2 years agodebug: use AppProtoToString
Philippe Antoine [Thu, 23 Mar 2023 15:41:30 +0000 (16:41 +0100)] 
debug: use AppProtoToString

instead of recoding it.
This way, setup-app-layer.py needs to patch one file less

2 years agodetect: allow 0-sized non-NULL buffers to match
Philippe Antoine [Thu, 27 Apr 2023 14:39:31 +0000 (16:39 +0200)] 
detect: allow 0-sized non-NULL buffers to match

Such as a HTTP1 header with an empty value

Ticket: #6025

2 years agocapture: use uint16_t for max_pending_packets
Jason Ish [Wed, 3 May 2023 21:21:26 +0000 (15:21 -0600)] 
capture: use uint16_t for max_pending_packets

Use a fixed type of max_pending_packets instead of intmax_t which can
differ based on the platform/standard library.

Should also prevent lints about possible arithmetic overflow.

2 years agoutil/mime: enable debug validation check
Shivani Bhardwaj [Thu, 4 May 2023 16:01:23 +0000 (21:31 +0530)] 
util/mime: enable debug validation check

2 years agosmtp: return on line completion
Shivani Bhardwaj [Tue, 25 Apr 2023 07:12:16 +0000 (12:42 +0530)] 
smtp: return on line completion

Problem:
If we receive a long line w/o LF, we cap it to 4k bytes and wait until a
line with LF comes in order to consider the previous line complete. Any
data post the 4k bytes is discarded. Currently, if a line with LF comes
in after a long line, we reset all the parameters used for processing it
like the line.len and line.delim_len but we still make the call to
SMTPProcessRequest fn without even the need to process anything. Since
such a line (with len and delim_len set to 0) should not reach mime
decoder, a debug assertion triggers there in this case.

Fix:
Make sure to return early as the line has to be skipped and not
processed at all.

Bug 6019

2 years agoaf-packet: Ignore outgoing packets on loopback interfaces
Arne Welzel [Wed, 29 Mar 2023 15:29:31 +0000 (17:29 +0200)] 
af-packet: Ignore outgoing packets on loopback interfaces

When reading a loopback interface, packets are received twice: Once as
outgoing packets and once as incoming packets.

Libpcap ignores outgoing packets. With current versions of Suricata, sniffing
a single http://localhost:80 request over lo using the af-packet source
minimally shows two syn packets, two synacks and twice as many packets in
the stats entries than you'd expect when running tcpdump or Wireshark.

2 years agoerror: minor header cleanup
Victor Julien [Thu, 4 May 2023 13:01:55 +0000 (15:01 +0200)] 
error: minor header cleanup

2 years agorespond/reject: fix IPv6 TCP resets
Victor Julien [Thu, 4 May 2023 04:47:58 +0000 (06:47 +0200)] 
respond/reject: fix IPv6 TCP resets

Fix length and next header field settings.

Bug: #6038.

2 years agorespond/reject: minor code cleanups
Victor Julien [Thu, 4 May 2023 04:47:37 +0000 (06:47 +0200)] 
respond/reject: minor code cleanups

2 years agorespond/reject: minor cleanups
Victor Julien [Thu, 4 May 2023 04:47:25 +0000 (06:47 +0200)] 
respond/reject: minor cleanups

2 years agorust/time: add note why this needs to be pinned 8798/head
Jason Ish [Tue, 2 May 2023 20:50:53 +0000 (14:50 -0600)] 
rust/time: add note why this needs to be pinned

2 years agorust: update x509-parser to 0.15.0
Jason Ish [Mon, 1 May 2023 16:03:02 +0000 (10:03 -0600)] 
rust: update x509-parser to 0.15.0

2 years agoutil/mime: disable assertion check until resolution 8794/head
Shivani Bhardwaj [Tue, 2 May 2023 06:36:11 +0000 (12:06 +0530)] 
util/mime: disable assertion check until resolution

2 years agodetect: register multi-buffer keywords 8792/head
Victor Julien [Fri, 24 Mar 2023 16:19:50 +0000 (17:19 +0100)] 
detect: register multi-buffer keywords

Register the keywords that use multi buffer support as such, so that
rule parsing can set them up with multi-instance support.

Ticket: #5784.

2 years agodetect: support multi buffer matching
Victor Julien [Tue, 21 Mar 2023 05:37:31 +0000 (06:37 +0100)] 
detect: support multi buffer matching

Multi buffer matching is implemented as a way for a rule to match
on multiple buffers within the same transaction.

Before this patch a rule like:

    dns.query; content:"example"; dns.query; content:".com";

would be equivalent to:

    dns.query; content:"example"; content:".com";

If a DNS query would request more than one name, e.g.:

    DNS: [example.net][something.com]

Eeach would be inspected to have both patterns present. Otherwise,
it would not be a match. So the rule above would not match, as neither
example.net and somthing.com satisfy both conditions at the same time.

This patch changes this behavior. Instead of the above, each time the
sticky buffer is specified, it creates a separate detection unit. Each
buffer is a "multi buffer" sticky buffer will now be evaluated against
each "instance" of the sticky buffer.

To continue with the above example:

    DNS: [example.net] <- matches 'dns.query; content:"example";'
    DNS: [something.com] <- matches 'dns.query; content:".com"'

So this would now be a match.

To make sure both patterns match in a single query string, the expression
'dns.query; content:"example"; content:".com";' still works for this.

This patch doesn't yet enable the behavior for the keywords. That is
done in a follow up patch.

To be able to implement this the internal storage of parsed rules
is changed. Until this patch and array of lists was used, where the
index was the buffer id (e.g. http_uri, dns_query). Therefore there
was only one list of matches per buffer id. As a side effect this
array was always very sparsely populated as many buffers could not
be mixed.

This patch changes the internal representation. The new array is densely
packed:

    dns.query; content:"1"; dns.query; bsize:1; content:"2";

    [type: dns_query][list: content:"1";]
    [type: dns_query][list: bsize:1; content:"2";]

The new scheme allows for multiple instances of the same buffer.
These lists are then translated into multiple inspection engines
during the final setup of the rule.

Ticket: #5784.

2 years agodetect: fix setting of flag for rule reload
Jason Ish [Mon, 1 May 2023 16:50:40 +0000 (10:50 -0600)] 
detect: fix setting of flag for rule reload

As part of 6d8b50b748844e9de6010cde5a6b139148c0e937, the settings of
THV_CAPTURE_INJECT_PKT ended up in a location unreachable by capture
methods that did not have PktAcqBreakLoop.

Instead, always call TmThreadsCaptureBreakLoop which handles the logic
for how the read loop should be broken.

This fixes the case where read threads won't "break" for rule reloads
until packets are seen.

Ticket: #6021

2 years agorunmodes: introduce unknown engine mode 8791/head
Lukas Sismis [Fri, 31 Mar 2023 12:34:38 +0000 (14:34 +0200)] 
runmodes: introduce unknown engine mode

Querying an engine mode with an unknown value signals a bug when
the engine mode has not been determined but is already queried by
other functions.

Ticket: #5959

2 years agopolicy: postpone evaluation of exception policy after setting the engine mode
Lukas Sismis [Sun, 2 Apr 2023 08:41:08 +0000 (10:41 +0200)] 
policy: postpone evaluation of exception policy after setting the engine mode

Master exception policy queried engine mode earlier than it was
determined from the configuration file/command line. As a result it
used the default (IDS) mode. However, the engine mode could have been
reconfigured later on to the IPS mode. This lead into an undefined behavior
as master exception policy behaves according to the configured engine mode.

Ticket: #5960

2 years agobpf: refactor the BPF code and postpone querying of the engine mode
Lukas Sismis [Fri, 31 Mar 2023 12:31:59 +0000 (14:31 +0200)] 
bpf: refactor the BPF code and postpone querying of the engine mode

BPF codebase queried engine mode earlier than it was determined from
the configuration file/command line. As a result it used the default (IDS)
mode where it could've been configured later on to the IPS mode.
This could lead into an undefined behavior as some Suricata modules behave
according to the engine mode.

PF-Ring, Netmap and AF-Packet all shared almost identical code for
determining the engine mode. It was put into one common function.
Omitted the usage of SCStrdup function in PF-Ring module as it is
uppercased during thread initialization phase.

Ticket: #5957

2 years agosource/nfq: Improve retry counter limit name 8787/head
Jeff Lucovsky [Mon, 3 Apr 2023 13:01:55 +0000 (09:01 -0400)] 
source/nfq: Improve retry counter limit name

The NFQ verdict retry is based on attempts, not time; thus, we rename
the token controlling it to reflect that.