]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agolog-pcap: one time errors on file open 9088/head
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.

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

2 years agodoc/multi-tenant: Clarify live traffic support 9083/head
Jeff Lucovsky [Mon, 19 Jun 2023 13:49:59 +0000 (09:49 -0400)] 
doc/multi-tenant: Clarify live traffic support

Issue: 5930

This commit clarifies the live traffic support for multi-tenancy.

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: #5912.

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

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

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

Log a warning but otherwise ignore obsolete flags under
eve-log.alert. This also prevents accidentially turning off app-layer
logging by attempting to disable a single protocol.

These flags have been deprecated since 5.0, time to stop respecting
them.

Ticket: #6175

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

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

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

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

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

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

2 years agouserguide/security: grammar fixes
Jason Ish [Tue, 20 Jun 2023 16:22:26 +0000 (10:22 -0600)] 
userguide/security: grammar fixes

Apply grammer fixes brought up in GitHub review comments by Juliana.

2 years agodetect/http: request/response header support multi buffer
Philippe Antoine [Tue, 20 Jun 2023 12:12:42 +0000 (14:12 +0200)] 
detect/http: request/response header support multi buffer

Ticket: #6163

That means that we can have rules matching different contents
on different headers.

2 years agohttp: event on chunk extension 9045/head
Philippe Antoine [Mon, 12 Jun 2023 20:28:16 +0000 (22:28 +0200)] 
http: event on chunk extension

Chunks extension are defined in rfc2616 section-3.6.1

Ticket: #6159

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

libpcap bpf functions are supported now.

2 years agodpdk: support multiple same EAL arguments
liaozhiyuan [Thu, 1 Jun 2023 02:38:04 +0000 (10:38 +0800)] 
dpdk: support multiple same EAL arguments

DPDK apps can specify multiple arguments of the same
type. YAML format only allows unique keys within a single
node. This commit adds support for multiple EAL arguments
of the same type to be used within suricata.yaml.

Ticket: #5964

2 years agodetect/files: centralize definition of protocols
Philippe Antoine [Mon, 5 Jun 2023 12:01:07 +0000 (14:01 +0200)] 
detect/files: centralize definition of protocols

Protocols supporting files are only defined in one place, which
gets used by all keywords, which can handle some exceptions
(like HTTP2 not having file names)

2 years agodetect/files: reuse AppLayerParserSupportsFiles
Philippe Antoine [Mon, 5 Jun 2023 09:26:37 +0000 (11:26 +0200)] 
detect/files: reuse AppLayerParserSupportsFiles

rather than relisting the protocols

2 years agogithub-ci: update action: setup-msys2
Jason Ish [Mon, 12 Jun 2023 21:11:46 +0000 (15:11 -0600)] 
github-ci: update action: setup-msys2

Use @v2, hopefully the dependency bot will keep it up to date now.

2 years agogithub-ci: use latest version of actions/upload-artifact
Jason Ish [Sat, 10 Jun 2023 16:45:51 +0000 (10:45 -0600)] 
github-ci: use latest version of actions/upload-artifact

2 years agogithub-ci: update actions/cache to v3.3.1
Jason Ish [Sat, 10 Jun 2023 16:37:57 +0000 (10:37 -0600)] 
github-ci: update actions/cache to v3.3.1

2 years agogithub-ci: use same version (3.0.2) for actions/download-artifact
Jason Ish [Sat, 10 Jun 2023 16:32:57 +0000 (10:32 -0600)] 
github-ci: use same version (3.0.2) for actions/download-artifact

2 years agogithub-ci: update actions/checkout to v3.5.3
Jason Ish [Sat, 10 Jun 2023 16:20:37 +0000 (10:20 -0600)] 
github-ci: update actions/checkout to v3.5.3

2 years agoexceptions: fix 'auto' for master switch in IDS
Juliana Fajardini [Wed, 14 Jun 2023 23:58:44 +0000 (20:58 -0300)] 
exceptions: fix 'auto' for master switch in IDS

If the master exception policy was set to 'auto' in IDS mode, instead of
just setting the master switch to the default in this case, which is
'ignore', the engine would switch a warning saying that auto wasn't a
valid config and then set the policy to ignore.

This makes 'auto' work for the master switch in IDS, removes function
for setting IPS option and handles the valid IDS options directly from
the function that parses the master policy, as this was the only place
where the function was still called.

Bug #6149

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 agopcap: fix reopen logic 9033/head
Victor Julien [Thu, 18 May 2023 21:18:18 +0000 (23:18 +0200)] 
pcap: fix reopen logic

Bug: #6081.

2 years agopcap/runmodes: silence some info messages
Victor Julien [Thu, 18 May 2023 08:12:21 +0000 (10:12 +0200)] 
pcap/runmodes: silence some info messages

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.

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

2 years agothreads: cleanup decode_pq handling
Victor Julien [Tue, 16 May 2023 20:24:02 +0000 (22:24 +0200)] 
threads: cleanup decode_pq handling

2 years agoversion: start development towards 7.0.0-rc3
Victor Julien [Fri, 16 Jun 2023 07:33:47 +0000 (09:33 +0200)] 
version: start development towards 7.0.0-rc3

2 years agorelease: 7.0.0-rc2; update changelog suricata-7.0.0-rc2
Shivani Bhardwaj [Wed, 14 Jun 2023 17:36:06 +0000 (23:06 +0530)] 
release: 7.0.0-rc2; update changelog

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 agofuzz: fuzz HTTP1 target
Philippe Antoine [Thu, 8 Jun 2023 12:36:50 +0000 (14:36 +0200)] 
fuzz: fuzz HTTP1 target

As we use the name taken from list-app-layer-protos output,
we want http to translate to HTTP1

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

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 agostreaming/buffer: set errno in allocators 9021/head
Victor Julien [Tue, 13 Jun 2023 09:56:17 +0000 (11:56 +0200)] 
streaming/buffer: set errno in allocators

Add wrappers for the default allocators to set SC_ENOMEM.

The stream reassembly wrappers can set both SC_ENOMEM (alloc failed)
and SC_ELIMIT (memcap reached).

2 years agostreaming/buffer: turn BUG_ON's into validate checks
Victor Julien [Tue, 13 Jun 2023 09:25:20 +0000 (11:25 +0200)] 
streaming/buffer: turn BUG_ON's into validate checks

2 years agostream: update insert error checking
Victor Julien [Thu, 4 May 2023 13:27:03 +0000 (15:27 +0200)] 
stream: update insert error checking

2 years agostreaming: use error codes to indicate error reason
Victor Julien [Thu, 4 May 2023 13:04:24 +0000 (15:04 +0200)] 
streaming: use error codes to indicate error reason

2 years agoerror: SC_ELIMIT for when a limit is reached
Victor Julien [Thu, 4 May 2023 13:02:28 +0000 (15:02 +0200)] 
error: SC_ELIMIT for when a limit is reached

2 years agoexception/policy: fix midstream default handling
Victor Julien [Tue, 13 Jun 2023 07:52:30 +0000 (09:52 +0200)] 
exception/policy: fix midstream default handling

2 years agoexception/policy: minor code cleanup
Victor Julien [Tue, 13 Jun 2023 07:51:48 +0000 (09:51 +0200)] 
exception/policy: minor code cleanup

2 years agostream/tcp: don't accept pass-packet policy
Juliana Fajardini [Tue, 30 May 2023 13:43:49 +0000 (10:43 -0300)] 
stream/tcp: don't accept pass-packet policy

This is no longer valid for midstream exception policies.

Part of
Bug #5825

2 years agostream/tcp: re-enable midstream-policy usage
Juliana Fajardini [Tue, 30 May 2023 13:41:49 +0000 (10:41 -0300)] 
stream/tcp: re-enable midstream-policy usage

We were always setting it to ignore, due to bug 5825.

The engine will now issue an initialization error if an invalid value
is passed in the configuration file for midstream exception policy.

'pass-packet' or 'drop-packet' are never valid, as the midstream policy
concerns the whole flow, not making sense for just a packet.

If midstream is enabled, only two actual config values are allowed:
'ignore' and 'pass-flow', both in IDS and in IPS mode. In default mode
('auto' or if no policy is defined), midstream-policy is set to
'ignore'. All other values will lead to initialization error.

In IDS mode, 'drop-flow' will also lead to initialization error.

Part of
Bug #5825

2 years agoexceptions: extract 'auto' check to function
Juliana Fajardini [Thu, 1 Jun 2023 01:52:48 +0000 (22:52 -0300)] 
exceptions: extract 'auto' check to function

Part of
Bug #5825

2 years agoexceptions: use mix of logconfig/info/warning
Juliana Fajardini [Thu, 1 Jun 2023 23:33:18 +0000 (20:33 -0300)] 
exceptions: use mix of logconfig/info/warning

Use a mix of SCLogConfig, Warning and Info.
This mix works as follows: when something unnexpected for the user
happens - for instance, the engine ignoring an invalid config value, we
use warning. For indicating the value for the master switch, which
happens only once, we use Info. For all the other cases, we use
SCLogConfig.

It is possible that SCLogConfig isn't showing at the moment, this is a
possible bug to investigate further.

Related to
Bug #5825

2 years agoexceptions: parse config values, don't post process
Juliana Fajardini [Wed, 31 May 2023 14:56:43 +0000 (11:56 -0300)] 
exceptions: parse config values, don't post process

Get the enum values from the config file. Update the new extracted
functions. Post-process the config values based on runmode and policy.
Also handle 'auto' enum value in these.

Related to
Bug #5825

2 years agoexceptions/midstream: parse midstream policy alone
Juliana Fajardini [Mon, 29 May 2023 19:55:00 +0000 (16:55 -0300)] 
exceptions/midstream: parse midstream policy alone

As the midstream exception policy has its own specific scenarios, have a
dedicated function to parse and process its config values, and check for
midstream enabled when needed.

Related to
Bug #5825

2 years agoexceptions: refactor exception policy parse fn
Juliana Fajardini [Mon, 29 May 2023 18:26:22 +0000 (15:26 -0300)] 
exceptions: refactor exception policy parse fn

Split up ExceptionPolicyParse to try to improve readability.

Related to
Bug #5825

2 years agouserguide: update exception policy behaviors table
Juliana Fajardini [Mon, 24 Apr 2023 19:42:34 +0000 (16:42 -0300)] 
userguide: update exception policy behaviors table

Some exception policies can only be applied to the triggering packet or
only make sense considering the whole flow. Highlight such cases in the
table showing each exception policy.

Related to
Bug #5825

2 years agodoc: add midstream scenarios for exception policy
Juliana Fajardini [Tue, 18 Apr 2023 23:09:16 +0000 (20:09 -0300)] 
doc: add midstream scenarios for exception policy

The different interactions between midstream pick-up sessions and the
exception policy can be quite difficult to visualize. Add a section for
that in the userguide.

Related to
Bug #5825

2 years agomisc: fix typos, doc, update copyright years
Juliana Fajardini [Fri, 17 Feb 2023 20:34:09 +0000 (17:34 -0300)] 
misc: fix typos, doc, update copyright years

Updated FlowGetNew documentation, where it said NULL was only returned
in case of error.

2 years agodefrag: clean up existing stats counters
Juliana Fajardini [Thu, 30 Mar 2023 13:40:46 +0000 (10:40 -0300)] 
defrag: clean up existing stats counters

7a044a99ee14101fbc removed the lines that incremented these defrag
counters, but kept the entities themselves. This commit removes counters
that we judge too complex to maintain, given the current state of the
code, and re-adds incrementing max_hit (memcap related).

Related to
Task #5816

2 years agoschema: add missing flow event property: emergency
Juliana Fajardini [Mon, 20 Mar 2023 19:04:01 +0000 (16:04 -0300)] 
schema: add missing flow event property: emergency

2 years agorust: fix unit test link error on Rust 1.70 9009/head
Jason Ish [Mon, 12 Jun 2023 16:29:00 +0000 (10:29 -0600)] 
rust: fix unit test link error on Rust 1.70

Rust 1.70 appears to now link code on both branches of `if cfg!(test)`
now causing Rust unit tests to fail as that pattern was used to
disable functions only available when linked with the Suricata C code.

To work-around this issue, provide two versions of the `new` function,
one for unit tests and one when running as an application.

2 years agoapp-layer: improve/fix updates logic
Victor Julien [Thu, 8 Jun 2023 16:37:44 +0000 (18:37 +0200)] 
app-layer: improve/fix updates logic

In 23323a961fac ("app-layer: reduce app cleanup and output-tx calls"), flag
was set per packet updating the app-layer state. However this was missing a
common pattern: in IDS mode most updates are done in the opposite direction
of the traffic due to updates getting triggered by ACK's. This meant that
file store processing might not happen for a long time, or at all. Also,
app layer cleanup might not be called, which includes file pruning.

This patch sets per flow set of flags to indicate app layer is (potentially)
updated. It sets this per direction, based on how the parsers were invoked.
If an ACK triggers an app update, the flow is tagged for the opposite
direction and the next packet in that direction triggers output and cleanup.

Fixes: 23323a961fac ("app-layer: reduce app cleanup and output-tx calls")
Bug: #6120.

2 years agooutput/tx: minor code cleanup
Victor Julien [Thu, 8 Jun 2023 16:41:57 +0000 (18:41 +0200)] 
output/tx: minor code cleanup

2 years agohttp: htp_table_get_index does not return NULL 9001/head
Philippe Antoine [Wed, 7 Jun 2023 14:08:14 +0000 (16:08 +0200)] 
http: htp_table_get_index does not return NULL

if the index is correct

2 years agohttp1: implement http.request_header
Philippe Antoine [Thu, 23 Mar 2023 09:43:07 +0000 (10:43 +0100)] 
http1: implement http.request_header

So that it is generic for HTTP1 and HTTP2

Ticket: #5780

2 years agodetect/http2: do not escape ':' in header name or value
Philippe Antoine [Wed, 7 Jun 2023 14:17:17 +0000 (16:17 +0200)] 
detect/http2: do not escape ':' in header name or value

for keywords http.request_header and http.response_header

Ticket: #5780

2 years agohttp2: rename http2.header to http.request_header
Philippe Antoine [Thu, 12 Jan 2023 16:03:44 +0000 (17:03 +0100)] 
http2: rename http2.header to http.request_header

Or http.response_header based on the direction

http2.header had a different behavior than http.header and this was
confusing.

Ticket: #5780

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

2 years agorust/pgsql: remove unused/unconstructed enum variants
Philippe Antoine [Sun, 14 May 2023 15:05:18 +0000 (17:05 +0200)] 
rust/pgsql: remove unused/unconstructed enum variants

2 years agorust: remove duplicate constants definitions in C
Philippe Antoine [Sat, 29 Apr 2023 14:59:55 +0000 (16:59 +0200)] 
rust: remove duplicate constants definitions in C

2 years agorust: define AppLayerEventType only in rust
Philippe Antoine [Thu, 27 Apr 2023 13:04:38 +0000 (15:04 +0200)] 
rust: define AppLayerEventType only in rust

And detect.h does no longer depend on app-layer-events.h

2 years agorust: remove unused
Philippe Antoine [Thu, 20 Apr 2023 06:49:48 +0000 (08:49 +0200)] 
rust: remove unused

2 years agostream/reassemble: Include pool item count msg
Jeff Lucovsky [Thu, 8 Jun 2023 14:27:02 +0000 (10:27 -0400)] 
stream/reassemble: Include pool item count msg

Issue: 5563

This commit adds the segment pool item count in the summary DEBUG
message.

2 years agostream/cache: Return sessions to correct pool
Jeff Lucovsky [Thu, 8 Jun 2023 14:25:30 +0000 (10:25 -0400)] 
stream/cache: Return sessions to correct pool

Issue: 5563

This commit fixes the release of TCP resources. The sessions were being
returned to the segment thread pool instead of the sessions pool.

2 years agopool: Use bool return type
Jeff Lucovsky [Sat, 3 Jun 2023 14:04:33 +0000 (10:04 -0400)] 
pool: Use bool return type

Issue: 5563

This commit changes PoolDataPreAllocated to return a bool instead of an
int.

2 years agogithub-ci: check for suricata-update example configuration files
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.

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

2 years agodoc: GitHub PRs workflow 8994/head
Philippe Antoine [Thu, 18 May 2023 17:53:27 +0000 (19:53 +0200)] 
doc: GitHub PRs workflow

2 years agouserguide/install: add info on arch-based installs
Jeremy MountainJohnson [Mon, 1 May 2023 17:04:26 +0000 (12:04 -0500)] 
userguide/install: add info on arch-based installs

Add Arch AUR information for installation on Arch-based distros.

2 years agodoc: upgrade guide for logging http custom headers
Philippe Antoine [Tue, 6 Jun 2023 19:54:49 +0000 (21:54 +0200)] 
doc: upgrade guide for logging http custom headers

Ticket: #5320

2 years agodoc: add missing rule to engine-analysis section
Juliana Fajardini [Wed, 7 Jun 2023 19:13:24 +0000 (16:13 -0300)] 
doc: add missing rule to engine-analysis section

The first report didn't have an example rule to go with.

2 years agosource-pcap-file: include unlink error in warning message
Long Doan [Tue, 6 Jun 2023 22:08:06 +0000 (00:08 +0200)] 
source-pcap-file: include unlink error in warning message

2 years agooutput/snmp: log version from tx
Philippe Antoine [Mon, 5 Jun 2023 15:04:04 +0000 (17:04 +0200)] 
output/snmp: log version from tx

and not the one from state

If a SNMP flow starts with a V2 version transaction,
then there is a V3i version transaction,
we will now log V3 for the second transaction

2 years agoexception: in ids mode, only REJECT the packet
Juliana Fajardini [Mon, 5 Jun 2023 16:02:26 +0000 (13:02 -0300)] 
exception: in ids mode, only REJECT the packet

In case of 'EXCEPTION_POLICY_REJECT', we were applying the same behavior
regardless of being in IDS or IPS mode.
This meant that (at least) the 'flow.action' was changed to drop when we
hit an exception policy in IDS mode.

Bug #6109

2 years agodecode-ipv6: Set IPv6 proto incase of ext header parsing error
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.

2 years agoftp: remove unnecessary code
Shivani Bhardwaj [Mon, 5 Jun 2023 10:48:15 +0000 (16:18 +0530)] 
ftp: remove unnecessary code

2 years agoftp: mark LF found per line
Shivani Bhardwaj [Mon, 5 Jun 2023 10:47:37 +0000 (16:17 +0530)] 
ftp: mark LF found per line

Currently, there is no way to mark if LF was found and then the line was
truncated. It becomes difficult to spot in the callers whether the line
was truncated despite LF being found or not. So, label it clearly with a
variable.

2 years agoftp: separate truncated line markers
Shivani Bhardwaj [Mon, 5 Jun 2023 10:45:51 +0000 (16:15 +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 6054

2 years agowindows: add -lntdll to Windows builds 8990/head
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 agostreaming/buffer: handle and document slide errors
Victor Julien [Wed, 7 Jun 2023 18:16:00 +0000 (20:16 +0200)] 
streaming/buffer: handle and document slide errors

Slide error may happen if the region we're sliding starts to overlap
with the next region. If we can't temporary grow the current region
to merge with the next region, keep the regions separate.

2 years agostreaming/buffer: minor debug fixup
Victor Julien [Wed, 7 Jun 2023 05:39:26 +0000 (07:39 +0200)] 
streaming/buffer: minor debug fixup

2 years agostreaming/buffer: fix buf_offset getting out of sync
Victor Julien [Wed, 7 Jun 2023 05:38:52 +0000 (07:38 +0200)] 
streaming/buffer: fix buf_offset getting out of sync

During consolidation of regions, buf_offset could get out of sync if
the region was grown on the left side.

To fix, reset it and let "sbb slide" logic correct it.

Bug: #6117.

2 years agostreaming/buffer: fix sliding region into next
Victor Julien [Tue, 6 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
streaming/buffer: fix sliding region into next

When sliding a region it could start to overlap with the next region.
This case wasn't handled, causing validation checks to trigger.

This patch adds support for this, where largest region will be expanded
to fit both region and both regions will be consolidated into it.

Bug: #6066.

2 years agostreaming/buffer: move util code for reusability
Victor Julien [Tue, 6 Jun 2023 10:09:36 +0000 (12:09 +0200)] 
streaming/buffer: move util code for reusability