]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agodecode: fix offset for DCE layer 9278/head
Philippe Antoine [Fri, 30 Jun 2023 08:45:37 +0000 (10:45 +0200)] 
decode: fix offset for DCE layer

Fixes: 136d351e403b ("decode: single network layer entrypoint")
Ticket: #3637
(cherry picked from commit fdf9cdf40068f00147bb07dd3f41a7556b8de823)

2 years agorust: fix compiler warnings 9277/head
Shivani Bhardwaj [Fri, 21 Jul 2023 12:23:49 +0000 (17:53 +0530)] 
rust: fix compiler warnings

2 years agodetect/multi-tenant: Make tenant_id 32 bits everywhere
Jeff Lucovsky [Wed, 21 Jun 2023 13:09:45 +0000 (09:09 -0400)] 
detect/multi-tenant: Make tenant_id 32 bits everywhere

Issue: 6047

This commit ensures that the tenant id is contained in a unsigned 32 bit
container.

(cherry picked from commit 9fd77c737f4f2d14f0e79df8958c21a3ccb3ed85)

2 years agodecode-ipv6: Set L4 proto on ipv6 incase of GRE decode error
Cole Dishington [Mon, 10 Jul 2023 02:02:18 +0000 (14:02 +1200)] 
decode-ipv6: Set L4 proto on ipv6 incase of GRE decode error

Set the L4 proto before decoding GRE in ipv6 decoding in case there is a
GRE header decoding error.

Bug: #6222
(cherry picked from commit 1b08c561f6f8f5ae3a1f29b68638f9884673fe58)

2 years agorust: lock proc-macro2 to maintain MSRV 9250/head
Victor Julien [Wed, 19 Jul 2023 05:15:46 +0000 (07:15 +0200)] 
rust: lock proc-macro2 to maintain MSRV

2 years agorfb: also set unimplemented auth types 9235/head 9249/head
Sascha Steinbiss [Fri, 30 Jun 2023 08:16:45 +0000 (10:16 +0200)] 
rfb: also set unimplemented auth types

(cherry picked from commit 1521b77edd04921a9b5f9419f84c62a812315e7a)

2 years agorfb: ensure logging of incompletely parsed txs
Sascha Steinbiss [Thu, 29 Jun 2023 22:20:12 +0000 (00:20 +0200)] 
rfb: ensure logging of incompletely parsed txs

(cherry picked from commit 1606aca881c5ba1c2cccbbe0de78530d47a4d8a1)

2 years agorfb: never return error on unknown traffic
Sascha Steinbiss [Fri, 9 Jun 2023 09:13:35 +0000 (11:13 +0200)] 
rfb: never return error on unknown traffic

We only try to parse a small subset of what is possible in
RFB. Currently we only understand some standard auth schemes
and stop parsing when the server-client handshake is complete.
Since in IPS mode returning an error from the parser causes
drops that are likely uncalled for, we do not want to return
errors when we simply do not understand what happens in the
traffic. This addresses Redmine #5912.

Bug: #5915.
(cherry picked from commit 1f8a5874fbc6816a7aeb59ba668ebd2bf7c206ed)

2 years agorfb: add myself as contributor
Sascha Steinbiss [Fri, 9 Jun 2023 09:12:24 +0000 (11:12 +0200)] 
rfb: add myself as contributor

(cherry picked from commit 836fff3679e6ea3b2ed75f87931ff3c7ec0ebd33)

2 years agorfb: be more strict parsing the version
Sascha Steinbiss [Fri, 9 Jun 2023 09:12:02 +0000 (11:12 +0200)] 
rfb: be more strict parsing the version

(cherry picked from commit bd1fbf392e04e0bfc4b8f7e680636ddee0a47c60)

2 years agorequirements: use libhtp 0.5.45
Victor Julien [Wed, 12 Jul 2023 17:31:00 +0000 (19:31 +0200)] 
requirements: use libhtp 0.5.45

(cherry picked from commit ce055111fe98d57d7e1c07e42abdd04a2f7d5319)

2 years agorequirements: suricata-update 1.2.8 9204/head
Jason Ish [Fri, 7 Jul 2023 18:05:43 +0000 (12:05 -0600)] 
requirements: suricata-update 1.2.8

2 years agodoc/devguide: language fix for sphinx
Jason Ish [Fri, 7 Jul 2023 18:34:48 +0000 (12:34 -0600)] 
doc/devguide: language fix for sphinx

Newer Sphinx does not allow a language of none, set to "en" like we do
for the user guide.

2 years agooutput/file: http2 metdata is logged in http object
Philippe Antoine [Fri, 16 Jun 2023 14:22:29 +0000 (16:22 +0200)] 
output/file: http2 metdata is logged in http object

as is done for http2 events and alerts.
The http.version integer can help to determine if this is HTTP2

Ticket: #6165
(cherry picked from commit 4f4651e360edf2916a648356db2e16ef1d560f7c)

2 years agoci: fix macos build with libhtp libiconv
Philippe Antoine [Thu, 6 Jul 2023 08:30:01 +0000 (10:30 +0200)] 
ci: fix macos build with libhtp libiconv

2 years agoci: update to macos latest
Philippe Antoine [Mon, 3 Jul 2023 13:23:19 +0000 (15:23 +0200)] 
ci: update to macos latest

(cherry picked from commit e1e03c25c9c4289e10bbcadd0fd86ab41a3e4003)

2 years agotls: update x509 crate to v0.8
Philippe Antoine [Fri, 30 Jun 2023 07:00:49 +0000 (09:00 +0200)] 
tls: update x509 crate to v0.8

Ticket: #5439

Fixes cetificate parsing without issuer, and do not require an
update to MSRV.

2 years agosmb: fix wrong data offset when wct = 12 9173/head
Lancer Cheng [Mon, 22 May 2023 09:16:34 +0000 (09:16 +0000)] 
smb: fix wrong data offset when wct = 12

Bug: #6008
(cherry picked from commit 000eb91078d5ca88ee93006340d7e68f97ade4bc)

2 years agodoc: fix typo encryption-handling 9139/head
Shivani Bhardwaj [Mon, 26 Jun 2023 11:42:18 +0000 (17:12 +0530)] 
doc: fix typo encryption-handling

(cherry picked from commit aeb408dd9dbf7d3f7b4af0f77c3a16fd45c56d39)

2 years agosuricatasc: Don't process empty cmds
Shivani Bhardwaj [Fri, 23 Jun 2023 06:38:25 +0000 (12:08 +0530)] 
suricatasc: Don't process empty cmds

(cherry picked from commit 6b3dbaa2f257a82171e14cd9a64bc3aaac006501)

2 years agosuricatasc: exit successfully on keyboardinterrupt
Shivani Bhardwaj [Fri, 23 Jun 2023 06:28:05 +0000 (11:58 +0530)] 
suricatasc: exit successfully on keyboardinterrupt

(cherry picked from commit 84ffe928730b283879edc1711dfbbaaed6d1dc29)

2 years agosuricatasc: add line numbers in error messages
Shivani Bhardwaj [Fri, 23 Jun 2023 06:27:21 +0000 (11:57 +0530)] 
suricatasc: add line numbers in error messages

(cherry picked from commit a512338afdbec725a8182225c30867d707401a98)

2 years agosuricatasc: handle exceptions in caller
Shivani Bhardwaj [Thu, 22 Jun 2023 12:21:05 +0000 (17:51 +0530)] 
suricatasc: handle exceptions in caller

(cherry picked from commit 46ce371d9c550ea840cb946b06c5614569ca98fa)

2 years agosuricatasc: handle exceptions interactive mode
Shivani Bhardwaj [Thu, 22 Jun 2023 08:17:37 +0000 (13:47 +0530)] 
suricatasc: handle exceptions interactive mode

(cherry picked from commit b42a584f4dccd5c96a829d07b8a35185542f384c)

2 years agodetect: Fix FTP bounce detection IP address comparison
Cole Dishington [Sun, 14 May 2023 20:03:23 +0000 (08:03 +1200)] 
detect: Fix FTP bounce detection IP address comparison

Fix the FTP bounce IP address comparison by only converting the IP
parsed from the FTP payload to network order.

Bug: #6087
(cherry picked from commit 746fb50d58c5adc5668f15537469d6dda9e7ba4d)

2 years agogithub-ci: allow pull request URL in SV_BRANCH 9124/head 9129/head
Jason Ish [Wed, 28 Jun 2023 18:32:35 +0000 (12:32 -0600)] 
github-ci: allow pull request URL in SV_BRANCH

Allow the SV_BRANCH variable to contain the full link to an
OISF/suricata-verify pull request. This will cause GitHub to create a
cross-link for us.

(cherry picked from commit f870dcd4cc1c72cdf5faf790a1582347ed87ab9f)

2 years agopcap-log: close pcap_dead_handle on close
Jason Ish [Wed, 28 Jun 2023 17:06:24 +0000 (11:06 -0600)] 
pcap-log: close pcap_dead_handle on close

Fixes leaked handle on exit.

(cherry picked from commit 8511ef5e2db4484424bc7cde058d57b8401e5005)

2 years agolog-pcap: one time errors on file open
Jason Ish [Tue, 27 Jun 2023 16:52:39 +0000 (10:52 -0600)] 
log-pcap: one time errors on file open

If compression was not enabled, the open error was actually suppressed
by default by only being logged at info level, however with
compression it was logged as an error. As opening is retried as long
as it fails to open, make both log as error but wrap in a flag so the
error is logged once until success.

(cherry picked from commit d2a5a55e0a99dee21a2a148647397bc02831ed78)

2 years agolog-pcap: only open dumper after successful file open (lz4)
Jason Ish [Tue, 27 Jun 2023 16:25:24 +0000 (10:25 -0600)] 
log-pcap: only open dumper after successful file open (lz4)

When LZ4 compression is enabled, open the dumper after successful open
of the file. The dump handle is what forms the check if opening the
file needs to be retried.

Ticket: #5022

(cherry picked from commit bf589f081287b71849658c6325fc50d209c60d20)

2 years agomime: compute full body md5 9120/head
Philippe Antoine [Fri, 16 Jun 2023 13:28:38 +0000 (15:28 +0200)] 
mime: compute full body md5

Previously, the problem was that nested headers/boundaries were not
used to compute the hash

Solution is to move up the call to the hash computation from
ProcessMimeBody to its caller ProcessMimeEntity, and add a set of
conditions to ensure that we are not in the principal headers.

Ticket: #6185
(cherry picked from commit a3168fda787d4f4eee45f5c84bcc1709f207ae0a)

2 years agosmtp: avoid counting last eol in file
Philippe Antoine [Thu, 22 Jun 2023 13:21:18 +0000 (15:21 +0200)] 
smtp: avoid counting last eol in file

As it is part of the boundary

Ticket: #6023

On the way, look for urls even on incomplete lines

(cherry picked from commit 2a768dfa9520c15116c11bea1d96c6ce17b8343c)

2 years agoeve/alert: warn on obsolete flags 9087/head
Jason Ish [Mon, 26 Jun 2023 16:57:00 +0000 (10:57 -0600)] 
eve/alert: warn on obsolete flags

Log a warning on obsolete flags. If the flag is to enable, do the
enable. But do not honor disable flags, as these could override the
new settings and cause hard to debug issues.

Ticket: #6175

2 years agodetect/http2: warning that http2.header is removed
Philippe Antoine [Mon, 12 Jun 2023 19:55:25 +0000 (21:55 +0200)] 
detect/http2: warning that http2.header is removed

in Suricata 7

Ticket: #5780

2 years agodcerpc: maximum number of live transactions also for UDP
Philippe Antoine [Thu, 8 Jun 2023 12:25:01 +0000 (14:25 +0200)] 
dcerpc: maximum number of live transactions also for UDP

Ticket: #6129

Avoids that quadratic complexity gets too bad

(cherry picked from commit d40dca5e55286c57e9a83018975022c4f08bf6d1)

2 years agobpf: remove OpenBSD guards
Victor Julien [Fri, 16 Jun 2023 09:41:57 +0000 (11:41 +0200)] 
bpf: remove OpenBSD guards

libpcap bpf functions are supported now.

(cherry picked from commit 643e674cb216b3824fd5a3f4dd2d9f69847fc431)

2 years agopcap: fix reopen logic
Victor Julien [Thu, 18 May 2023 21:18:18 +0000 (23:18 +0200)] 
pcap: fix reopen logic

Bug: #6081.
(cherry picked from commit ab667d4d192a8b78dc436e65dd34ddfb028312f1)

2 years agopcap: free per thread resources
Victor Julien [Thu, 18 May 2023 06:03:31 +0000 (08:03 +0200)] 
pcap: free per thread resources

Bug: #4750.
(cherry picked from commit 3049151bc2ec593b8d028a6aae675019b3bf4032)

2 years agopcap/file: minor code cleanup
Victor Julien [Sat, 13 May 2023 05:58:43 +0000 (07:58 +0200)] 
pcap/file: minor code cleanup

(cherry picked from commit 6c1408c3c2bac7d76300a5a5f91b5c2cee5586df)

2 years agoversion: start development towards 6.0.14
Victor Julien [Tue, 27 Jun 2023 14:21:47 +0000 (16:21 +0200)] 
version: start development towards 6.0.14

2 years agorelease: 6.0.13; update changelog suricata-6.0.13
Shivani Bhardwaj [Thu, 15 Jun 2023 05:47:01 +0000 (11:17 +0530)] 
release: 6.0.13; update changelog

2 years agodoc/userguide: start on a security chapter
Jason Ish [Wed, 14 Jun 2023 14:58:56 +0000 (08:58 -0600)] 
doc/userguide: start on a security chapter

This is the start of a security consideration chapter, starting with
directions on how to run Suricata as a non-root user.

2 years agodoc/userguide: dataset upgrade notes
Jason Ish [Tue, 6 Jun 2023 23:13:57 +0000 (17:13 -0600)] 
doc/userguide: dataset upgrade notes

2 years agoconfig: uncomment datasets configuration
Jason Ish [Tue, 6 Jun 2023 22:23:57 +0000 (16:23 -0600)] 
config: uncomment datasets configuration

Uncomment the datasets configuration for easier editing by users.  The
values are left commented out as their defaults.

2 years agodatasets: flag to disable "write" actions
Jason Ish [Tue, 6 Jun 2023 22:04:56 +0000 (16:04 -0600)] 
datasets: flag to disable "write" actions

Add a new configuration flag, "datasets.rules.allow-write" to control
if rules can contain "save" or "state" rules which allow write access
to the file system.

Ticket: #6123

2 years agoinstall: create runtime data directory
Jason Ish [Tue, 6 Jun 2023 21:32:18 +0000 (15:32 -0600)] 
install: create runtime data directory

On installation, make sure the data directory is created. This will
usually be /var/lib/suricata/data, but otherwise follows the
autoconf/automake instructions.

This directory is for runtime state information, which for now is
datasets but may be expanded in the future.  Suricata already expects
this directory to exist for "state" and "save" datasets, but it has
been up to the user to create it.

2 years agodatasets: don't allow absolute or paths with directory traversal
Jason Ish [Tue, 23 May 2023 21:17:59 +0000 (15:17 -0600)] 
datasets: don't allow absolute or paths with directory traversal

For dataset filenames coming from rules, do not allow filenames that
are absolute or contain a directory traversal with "..". This prevents
datasets from escaping the define data-directory which may allow a bad
rule to overwrite any file that Suricata has permission to write to.

Add a new configuration option,
"datasets.rules.allow-absolute-filenames" to allow absolute filenames
in dataset rules. This will be a way to revert back to the pre 6.0.13
behavior where save/state rules could use any filename.

Ticket: #6118

2 years agodoc/userguide: notes about Lua rules being disabled by default
Jason Ish [Mon, 12 Jun 2023 17:42:59 +0000 (11:42 -0600)] 
doc/userguide: notes about Lua rules being disabled by default

2 years agolua: disable lua rules by default
Jason Ish [Wed, 7 Jun 2023 22:35:53 +0000 (16:35 -0600)] 
lua: disable lua rules by default

To protect against possible supply chain attacks, disable Lua rules by
default. They can be enabled under the "security" section of
suricata.yaml.

Ticket: #6122

2 years agosmtp: handle long lines per direction
Shivani Bhardwaj [Tue, 23 May 2023 04:41:38 +0000 (10:11 +0530)] 
smtp: handle long lines per direction

Issue:
Currently, while handling of long lines, if the line exceeded the limit,
we'd set a variable state->discard_till_lf which will be reset in the
later stages based on the data that arrives. However, because there was
one variable per state, this meant that a later stage in the other
direction could also modify it which is incorrect.

Fix:
Use separate variables for each direction.

Bug 6053

2 years agosmtp: handle following cmd if LF was found in long line
Shivani Bhardwaj [Sat, 6 May 2023 11:46:30 +0000 (17:16 +0530)] 
smtp: handle following cmd if LF was found in long line

If a long line had LF post the limit, it should be considered complete
and not wait for the next line to complete it. However, currently, any
following lines were skipped which could sometimes also be important
commands for the entire transaction.

Fix this by setting a flag in case we're truncating a long line but
after having found the LF character.

Bug 5989

2 years agosmtp: add function docs
Shivani Bhardwaj [Tue, 30 May 2023 07:20:57 +0000 (12:50 +0530)] 
smtp: add function docs

2 years agosmtp: handle DATA mode in middle of input parsing
Shivani Bhardwaj [Tue, 4 Apr 2023 06:32:03 +0000 (12:02 +0530)] 
smtp: handle DATA mode in middle of input parsing

Before:
If the input was such that we'd enter DATA mode in the middle, the
entire data would be passed through SMTPGetLine fn and be processed with
line limits etc in place.

After:
Since we don't want any limits to be enforced on DATA, we pass it to
SMTPPreProcessCommands fn to take care of it differently from the
commands.

Bug 5981

2 years agogithub-ci: check for suricata-update example configuration files 9024/head
Jason Ish [Thu, 8 Jun 2023 18:26:53 +0000 (12:26 -0600)] 
github-ci: check for suricata-update example configuration files

Check that the Suricata-Update example configuration files are
installed.

(cherry picked from commit 6d7923c80b4ed68b5c25ceeb9615535313cf0b71)

2 years agosuricata-update: install sample configuration files
Jason Ish [Thu, 8 Jun 2023 18:23:05 +0000 (12:23 -0600)] 
suricata-update: install sample configuration files

With the move to installing Suricata-Update files from Suricata
Makefile's, the sample configuration files were forgotten.

Ticket: #6132
(cherry picked from commit b8071a9eb0b1882178f7280936d6df577945232d)

2 years agodecode-ipv6: Set IPv6 proto incase of ext header parsing error 9023/head
Cole Dishington [Wed, 24 May 2023 00:39:33 +0000 (12:39 +1200)] 
decode-ipv6: Set IPv6 proto incase of ext header parsing error

Set the IPv6 packet proto before parsing the ext headers, similar to
decode-ipv4, incase of an ext header parsing error. Otherwise
rule decode-events are not triggered for packets encapsulated in IPv6.

Bug: #6086.
(cherry picked from commit 531d99f4cf3f7929ef5e972641d2f347c966b979)

2 years agodetect/byte-math: Support multiplication operator
Jeff Lucovsky [Thu, 18 May 2023 12:53:59 +0000 (08:53 -0400)] 
detect/byte-math: Support multiplication operator

Issue: 6070

This commit adds support for the multiplication operator to byte-math.
The regex for parsing the keyword options was missing the `*` character.

2 years agodcerpc: convert transaction list to vecdeque for UDP 9007/head
Philippe Antoine [Wed, 24 Aug 2022 08:24:51 +0000 (10:24 +0200)] 
dcerpc: convert transaction list to vecdeque for UDP

As was done for TCP in dfe76bb90 and d745d28d4

Ticket: #5518
(cherry picked from commit bf43011a43a6d542ab2f85aa61986340ed8254c8)

2 years agodcerpc: convert transaction list to vecdeque
Jason Ish [Mon, 2 May 2022 18:19:51 +0000 (12:19 -0600)] 
dcerpc: convert transaction list to vecdeque

Allows for more efficient removal from front of the list.

Ticket: #5271
(cherry picked from commit dfe76bb905409bf91345e972f2ab157bda51f003)

2 years agotemplate(rust): convert transaction list to vecdeque
Jason Ish [Wed, 27 Apr 2022 16:16:02 +0000 (10:16 -0600)] 
template(rust): convert transaction list to vecdeque

Allows for more efficient removal from front of the list.

Ticket: #5298
(cherry picked from commit e319d31c148a349e93bed2a68787684e39364d17)

2 years agohttp2: convert transaction list to vecdeque
Jason Ish [Wed, 27 Apr 2022 15:38:51 +0000 (09:38 -0600)] 
http2: convert transaction list to vecdeque

Allows for more efficient removal from front of the list.

Ticket: #5296
(cherry picked from commit 2db84726ad3445a0b55ca145489103483f61c6b0)

2 years agordp: convert transaction list to vecdeque
Jason Ish [Wed, 27 Apr 2022 15:29:30 +0000 (09:29 -0600)] 
rdp: convert transaction list to vecdeque

Allows for more efficient removal from front of the list.

Ticket: #5295
(cherry picked from commit 4e0ad5e0bd4584d625ad122f0c33908abb17e7a4)

2 years agodns: convert transaction list to vecdeque
Jason Ish [Tue, 26 Apr 2022 19:25:40 +0000 (13:25 -0600)] 
dns: convert transaction list to vecdeque

Allows for more efficient removal from front of the list.

Ticket: #5277
(cherry picked from commit 31894147884af3e7151b4d653e5268a0b0477db8)

2 years agosmb: convert transaction list to vecdeque
Philippe Antoine [Tue, 13 Dec 2022 08:09:44 +0000 (09:09 +0100)] 
smb: convert transaction list to vecdeque

Allows for more efficient removal from front of the list.

Ticket: #5753
(cherry picked from commit 1d9183638f930e8e0f22c421ee0ef9fde043106a)

2 years agohttp2: avoid quadratic complexity in headers 9003/head
Philippe Antoine [Wed, 31 May 2023 12:53:28 +0000 (14:53 +0200)] 
http2: avoid quadratic complexity in headers

When adding an element to the dynamic headers table, the oldest
ones may get evicted. When multiple elements get evicted, they
should get evicted all at once with drain, instead of one by one
as there will be a massive move each time.

Ticket: #6103
(cherry picked from commit 635073688289aa9a4928f78cdfd1777ae21f7d40)

2 years agodns: split header and body parsing 8995/head
Jason Ish [Wed, 21 Dec 2022 15:35:19 +0000 (09:35 -0600)] 
dns: split header and body parsing

As part of extra header validation, split out DNS body parsing to
avoid the overhead of parsing the header twice.

(cherry picked from commit d720ead470bcb5dd5a0c0ae7db302ab170205ee6)

2 years agodns: validate header on every incoming message
Jason Ish [Wed, 21 Dec 2022 01:30:29 +0000 (19:30 -0600)] 
dns: validate header on every incoming message

As UDP streams getting probed, a stream that does not appear to be DNS
at first, may have a single packet that does look close enough to DNS
to be picked up as DNS causing every subsequent packet to result in a
parser error.

To mitigate this, probe every incoming DNS message header for validity
before continuing onto the body.  If the header doesn't validate as
DNS, just ignore the packet so no parse error is registered.

(cherry picked from commit 595700ab7e9dc9d12d46cf4d6833a86840decdf9)

2 years agodns: parse and alert on invalid opcodes
Jason Ish [Wed, 21 Dec 2022 01:17:38 +0000 (19:17 -0600)] 
dns: parse and alert on invalid opcodes

Accept DNS messages with an invalid opcode that are otherwise
valid. Such DNS message will create a parser event.

This is a change of behavior, previously an invalid opcode would cause
the DNS message to not be detected or parsed as DNS.

Issue: #5444
(cherry picked from commit c98c49d4bad413dbbe4e21a48ebf37260ee5cc8e)

2 years agodns: mark test buffers with rustfmt::skip
Jason Ish [Wed, 21 Dec 2022 15:01:15 +0000 (09:01 -0600)] 
dns: mark test buffers with rustfmt::skip

(cherry picked from commit 39d2524bf6d57658b532c73ceb4def34ed9e2c8a)

2 years agocounters: make tcp stats independent of flow, ssn
Victor Julien [Tue, 25 Apr 2023 08:09:27 +0000 (10:09 +0200)] 
counters: make tcp stats independent of flow, ssn

Counters depended on availability of flow and tcp session, meaning
that 2 memcaps could affect the counters.

Bug: #5017.
(cherry picked from commit 36f6e0515592812259fb327d529740a030dba98e)

2 years agostream: update no-flow checks
Victor Julien [Tue, 25 Apr 2023 08:22:11 +0000 (10:22 +0200)] 
stream: update no-flow checks

(cherry picked from commit 0360cb654293c333e3be70204705fa7ec328512e)

2 years agowindows: add -lntdll to Windows builds
Jason Ish [Wed, 7 Jun 2023 15:22:32 +0000 (09:22 -0600)] 
windows: add -lntdll to Windows builds

Rust 1.70 has introduced some possible issues between LLVM and gcc
causing link errors that are fixed by explicitly adding -lntdll.

Thanks to https://github.com/extendr/rextendr/pull/285 for the fix.

2 years agoftp: don't decrement truncated line len 8982/head
Shivani Bhardwaj [Tue, 6 Jun 2023 10:48:12 +0000 (16:18 +0530)] 
ftp: don't decrement truncated line len

In case LF was found for a long line way outside of the limit, we should
not need to update the delimiter len and current line len because the
line is capped at 4k and the LF was not within these 4k bytes.

2 years agoftp: separate truncated line markers
Shivani Bhardwaj [Tue, 6 Jun 2023 10:43:50 +0000 (16:13 +0530)] 
ftp: separate truncated line markers

So far, we store one variable in state to hold whether we want to
discard a long line till LF irrespective of direction. This means that a
long command to the client followed by a regular command w LF can be
considered as one long line which is incorrect.

Bug 6055

2 years agowindivert: fix compile warnings 8958/head
Victor Julien [Mon, 29 May 2023 17:00:36 +0000 (19:00 +0200)] 
windivert: fix compile warnings

(cherry picked from commit fd93f002a0999fbb0a10f620604234d4f76a51dc)

2 years agorust/doc: wrap some code examples in backticks
Jason Ish [Thu, 11 May 2023 21:49:59 +0000 (15:49 -0600)] 
rust/doc: wrap some code examples in backticks

(cherry picked from commit 13fe957b7e81801e72b3c1b42f30aeaa19df8d87)

2 years agodetect: remove flow drop unittest
Victor Julien [Thu, 1 Jun 2023 11:18:33 +0000 (13:18 +0200)] 
detect: remove flow drop unittest

Test broke after recent changes. Functionality is tested in
suricata-verify, so just remove the test.

(cherry picked from commit 8a535a0b89ee1679c5f31fe37d4c570c099cec41)

2 years agodetect: add check to validate drops
Victor Julien [Thu, 1 Jun 2023 08:57:08 +0000 (10:57 +0200)] 
detect: add check to validate drops

(cherry picked from commit 95bf7248e85d1c3179b4102c37f8845bcbc678b0)

2 years agodetect: fix stateful drops for rate_filter
Victor Julien [Thu, 1 Jun 2023 06:00:54 +0000 (08:00 +0200)] 
detect: fix stateful drops for rate_filter

(cherry picked from commit 418cc1fe947dd96a6cadb13fa1fbb5c9d5fb7ce0)

2 years agoflow/timeout: no pseudo packets for dropped flows
Victor Julien [Wed, 31 May 2023 13:56:54 +0000 (15:56 +0200)] 
flow/timeout: no pseudo packets for dropped flows

When a flow is in the drop flow state, don't use pseudo packets
when it is timing out. There should be no work left to do at this
point.

(cherry picked from commit 2a9515471287d2b8fc5aa2e1879aabadaf5f421e)

2 years agostream: simplify drop handling
Victor Julien [Wed, 31 May 2023 13:52:54 +0000 (15:52 +0200)] 
stream: simplify drop handling

Remove logic to apply flow drop, as this is now handled in the
flow engine.

However, keep the logic that frees/cleans the session state.

(cherry picked from commit d91a1e8bc6b886bdd383f3f7105ef9b2bf3a33fe)

2 years agoapp-layer: don't update UDP applayer for dropped packets
Victor Julien [Wed, 31 May 2023 13:52:14 +0000 (15:52 +0200)] 
app-layer: don't update UDP applayer for dropped packets

(cherry picked from commit 77f49661fd78df420c4542e230def0682a886c60)

2 years agodetect: update/document drop flow logic
Victor Julien [Wed, 31 May 2023 13:49:57 +0000 (15:49 +0200)] 
detect: update/document drop flow logic

Now that flow drop is applied to packets before other processing,
no drop has to be issued on a packet.

(cherry picked from commit 85ddba63f64e95f4c202f8ef05e8886a0cbac725)

2 years agoflow: apply flow to packet on flow lookup
Victor Julien [Wed, 31 May 2023 13:45:40 +0000 (15:45 +0200)] 
flow: apply flow to packet on flow lookup

Issue drop to packet as early as possible.

(cherry picked from commit 71a033ac62e0b71953f1884ecba7e6461c744197)

2 years agoversion: start development towards 6.0.13
Victor Julien [Tue, 9 May 2023 09:33:48 +0000 (11:33 +0200)] 
version: start development towards 6.0.13

2 years agorelease: 6.0.12; update changelog suricata-6.0.12
Shivani Bhardwaj [Mon, 8 May 2023 09:23:51 +0000 (14:53 +0530)] 
release: 6.0.12; update changelog

2 years agogithub-ci: add windivert build 8837/head
Victor Julien [Sun, 7 May 2023 05:42:13 +0000 (07:42 +0200)] 
github-ci: add windivert build

(cherry picked from commit 74326a43e7cff0665c6973abad9b4accfcfb952d)

2 years agogithub-ci: add windows build for libpcap
Jason Ish [Fri, 21 Jan 2022 17:55:54 +0000 (11:55 -0600)] 
github-ci: add windows build for libpcap

(cherry picked from commit 5037c86b49707f39f95e4b5b0994cc45de02cf9a)

2 years agoconfigure: fallback to libpcap on Windows
Jason Ish [Tue, 25 Jan 2022 20:53:24 +0000 (14:53 -0600)] 
configure: fallback to libpcap on Windows

If npcap/wpcap is not found on Windows, try libpcap. This allows
Suricata to build without NPCap on Windows, however live capture won't
be available.

(cherry picked from commit 31ba4fd1522dd0d7f933767b9205c67a4e726fe5)

2 years agorespond/reject: fix IPv6 TCP resets 8830/head
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.
(cherry picked from commit 235ee362119b4351e2e0cc3be9bbb5cf90bd20d9)

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

(cherry picked from commit 1f0aed07755c89ddcd1cf6c808d8257ddf4efb46)

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

(cherry picked from commit adf0bef7f012bd08bf614cb7c3ed7ee1b7c8e0f5)

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

(cherry picked from commit b9aac6dd18ef66930c6ab81bf45402db2c442053)

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

(cherry picked from commit a006aef4d04e5ef90d71a3f455c254b63467f4e3)

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

(cherry picked from commit 3045e75ee1d8196e8bcdb346bfad3b84b851d51a)

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

(cherry picked from commit 4dbdaf8a8ecf66ce8a5e880ad179e8a4b0b313fc)

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

(cherry picked from commit 19cabc9a021293f67037b298447105615be23d41)

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

(cherry picked from commit 01f43604b95e770333693c88b5ba2a1459a8454b)

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

(cherry picked from commit 9520aac79ca667cb102c4579e3ac29673da6491d)

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

(cherry picked from commit aee41957e10c68c6fb4bac3edf42ae631424b22d)

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

(cherry picked from commit c0067a5fffeb8b014b6756a572afe437d2bb561d)