]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agodetect/iponly: fix minor warning with unittest but no debug 9200/head
Victor Julien [Tue, 11 Jul 2023 04:46:07 +0000 (06:46 +0200)] 
detect/iponly: fix minor warning with unittest but no debug

2 years agogithub-ci: run cocci in fedora 38
Victor Julien [Mon, 10 Jul 2023 12:50:44 +0000 (14:50 +0200)] 
github-ci: run cocci in fedora 38

2 years agodetect/byte_math: Permit var name for bytes value 9198/head
Jeff Lucovsky [Sun, 9 Jul 2023 14:44:26 +0000 (10:44 -0400)] 
detect/byte_math: Permit var name for bytes value

Issue: 6145

Modifications to permit a variable name to be used for the byte_math
bytes value.

2 years agodetect/byte_math: Use proper index for rvalue var
Jeff Lucovsky [Sun, 9 Jul 2023 14:43:11 +0000 (10:43 -0400)] 
detect/byte_math: Use proper index for rvalue var

Use the proper index for extracting the rvalue variable value.

2 years agodetect/byte_math: Document bytes variable name
Jeff Lucovsky [Sun, 9 Jul 2023 14:42:06 +0000 (10:42 -0400)] 
detect/byte_math: Document bytes variable name

Issue: 6145

Document that byte_math accepts a variable name for bytes (optional)

2 years agodetect/byte-jump: Document var usage for nbytes
Jeff Lucovsky [Fri, 9 Jun 2023 14:43:33 +0000 (10:43 -0400)] 
detect/byte-jump: Document var usage for nbytes

Issue: 6105

2 years agodetect/bytejump: Allow nbytes to be a variable
Jeff Lucovsky [Fri, 9 Jun 2023 14:32:18 +0000 (10:32 -0400)] 
detect/bytejump: Allow nbytes to be a variable

Issue: 6105

This commit adds the ability for nbytes to be a variable when used with
the byte_jump keyword.

2 years agodoc/byte_test: Document byte_test variable usage
Jeff Lucovsky [Fri, 7 Jul 2023 14:34:08 +0000 (10:34 -0400)] 
doc/byte_test: Document byte_test variable usage

Issue: 6144

This commit updates the byte_test documentation now that a variable name
can be used for the nbytes value.

2 years agodetect/byte_test: Allow nbytes value to be a variable
Jeff Lucovsky [Fri, 7 Jul 2023 14:31:59 +0000 (10:31 -0400)] 
detect/byte_test: Allow nbytes value to be a variable

Issue: 6144

This commit allows the byte_test keyword to accept an existing
variable name for a value (the value may still be specified directly as
an integer).

All nbytes values are subject to the same value constraints as before
- 23 if included with string
- 8 otherwise

2 years agodpdk: improve handling of SOCKET_ID_ANY in DPDK 22.11+
Lukas Sismis [Thu, 22 Jun 2023 13:43:39 +0000 (15:43 +0200)] 
dpdk: improve handling of SOCKET_ID_ANY in DPDK 22.11+

Suricata complained that NIC is on different NUMA node than the CPU
thread. However, sometimes DPDK might be unable to resolve NUMA
location and as a result operate with any NUMA node that is available.
Current implementation reported NUMA ID as -1 which could have been
confusing to users.

Ticket: #6115

2 years agodpdk: refactor log messages
Lukas Sismis [Thu, 22 Jun 2023 12:09:36 +0000 (14:09 +0200)] 
dpdk: refactor log messages

Be more consistent with the log message format,
remove some unnecessary device name queries.

Ticket: #6116

2 years agodpdk: improve DPDK thread handling
Lukas Sismis [Mon, 19 Jun 2023 15:23:36 +0000 (17:23 +0200)] 
dpdk: improve DPDK thread handling

Ticket: #6106

2 years agodoc: update install instructions
Lukas Sismis [Wed, 7 Jun 2023 08:12:49 +0000 (10:12 +0200)] 
doc: update install instructions

Ticket: #5987

2 years agorequirements: suricata-update 1.3.0
Jason Ish [Fri, 7 Jul 2023 18:07:18 +0000 (12:07 -0600)] 
requirements: suricata-update 1.3.0

2 years agoutil/base64: fix tests for RFC2045
Shivani Bhardwaj [Thu, 30 Mar 2023 08:11:08 +0000 (13:41 +0530)] 
util/base64: fix tests for RFC2045

2 years agoutil/base64: update test macro to use user data
Shivani Bhardwaj [Thu, 30 Mar 2023 07:49:31 +0000 (13:19 +0530)] 
util/base64: update test macro to use user data

2 years agoutil/base64: check dest buf size to hold 3Bytes
Shivani Bhardwaj [Thu, 30 Mar 2023 07:43:08 +0000 (13:13 +0530)] 
util/base64: check dest buf size to hold 3Bytes

The destination buffer should be able to hold at least 3 Bytes during
the processing of the last block of data. If it cannot hold at least 3
Bytes, then that may lead to dynamic buffer overflow while decoding.

2 years agoutil/base64: check for dest buf size in last block
Shivani Bhardwaj [Thu, 30 Mar 2023 07:41:12 +0000 (13:11 +0530)] 
util/base64: check for dest buf size in last block

Just like the check for destination buffer size done previously for
complete data, it should also be done for the trailing data to avoid
goind out of bounds.

2 years agoutil/base64: fix padding bytes for trailing data
Shivani Bhardwaj [Thu, 30 Mar 2023 07:24:29 +0000 (12:54 +0530)] 
util/base64: fix padding bytes for trailing data

Padding bytes for the last remainder data should be as follows:

Case   |    Remainder bytes     |    Padding
----------------------------------------------
  I    |              1         |      3
  II   |              2         |      2
  III  |              3         |      1

However, we calculate the decoded_bytes with the formula:
decoded_bytes = ASCII_BLOCK - padding

this means for Case I when padding is 3 bytes, the decoded_bytes would
be 0. This is incorrect for any trailing data. In any of the above
cases, if the parsing was successful, there should at least be 1 decoded
byte.

2 years agoutil/base64: skip any invalid char for RFC2045
Shivani Bhardwaj [Fri, 17 Mar 2023 12:18:35 +0000 (17:48 +0530)] 
util/base64: skip any invalid char for RFC2045

RFC 2045 states that any invalid character should be skipped over, this
is the RFC used by mime handler in Suricata code to deal with base64
encoded data.
So far, only spaces were skipped as a part of implementation of this
RFC, extend it to also skip over any other invalid character. Add
corresponding test.

2 years agoutil/base64: add test for long string w RFC4648
Shivani Bhardwaj [Fri, 17 Mar 2023 12:15:32 +0000 (17:45 +0530)] 
util/base64: add test for long string w RFC4648

2 years agohttp: remove obsolete checks for files
Philippe Antoine [Fri, 7 Jul 2023 08:39:11 +0000 (10:39 +0200)] 
http: remove obsolete checks for files

With libhtp having been improved, Suricata does not need to check
that there is either a response line or HTTP/0.9 as libhtp
will trigger the callbacks only in those cases

2 years agohttp2: file tracker is initialized when file is closed
Philippe Antoine [Thu, 8 Jun 2023 13:08:02 +0000 (15:08 +0200)] 
http2: file tracker is initialized when file is closed

Ticket: #6130

This avoids quadratic complexity by having http2_range_key_get
looking in a growing number of frames

2 years agofile-data: better error for conflicting keywords
Jason Ish [Tue, 4 Jul 2023 13:21:18 +0000 (07:21 -0600)] 
file-data: better error for conflicting keywords

Instead of just erroring out with "rule contains conflicting
keywords", give an error that says what is actually wrong.

2 years agogithub-ci: remove fedora 36 builds 9168/head
Jason Ish [Thu, 6 Jul 2023 16:23:58 +0000 (10:23 -0600)] 
github-ci: remove fedora 36 builds

Fedora 36 is now EOL.

2 years agogithub-ci: update rust versions
Jason Ish [Thu, 6 Jul 2023 15:57:00 +0000 (09:57 -0600)] 
github-ci: update rust versions

New minimum Rust version: 1.63.0.
Current latest known good version: 1.70.0.

Add test specifically for MSRV as we didn't have one.

Ticket: #4163

2 years agoconfigure: set minimum rust version to 1.63.0
Jason Ish [Thu, 6 Jul 2023 15:42:37 +0000 (09:42 -0600)] 
configure: set minimum rust version to 1.63.0

Ticket: #4163

2 years agodoc/http: use "sticky buffer" where applicable
Shivani Bhardwaj [Fri, 30 Jun 2023 06:28:02 +0000 (11:58 +0530)] 
doc/http: use "sticky buffer" where applicable

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

2 years agodetect/fileext: reimplement based on file.name 9149/head
Victor Julien [Thu, 29 Jun 2023 19:05:36 +0000 (21:05 +0200)] 
detect/fileext: reimplement based on file.name

Ticket: #6194.

2 years agodetect/filename: switch to file.name implementation
Victor Julien [Thu, 29 Jun 2023 18:09:12 +0000 (20:09 +0200)] 
detect/filename: switch to file.name implementation

Ticket: #6194.

2 years agodetect/filemagic: switch to file.magic implementation
Victor Julien [Fri, 16 Jun 2023 13:07:13 +0000 (15:07 +0200)] 
detect/filemagic: switch to file.magic implementation

Replace implementation of the legacy `filemagic` keyword by the
implementation for the `file.magic` variant. This leads to better
performance and hooks the rules into the detection engine better.

Remove unittests that depended on the old logic.

Ticket: #6194.

2 years agodetect/tls: minor fingerprint cleanup
Victor Julien [Fri, 16 Jun 2023 12:59:40 +0000 (14:59 +0200)] 
detect/tls: minor fingerprint cleanup

2 years agodetect/content: minor cleanup
Victor Julien [Fri, 16 Jun 2023 12:59:03 +0000 (14:59 +0200)] 
detect/content: minor cleanup

2 years agoconfig/af-packet: Warn/replace rollover usage 9148/head
Jeff Lucovsky [Fri, 23 Jun 2023 13:37:22 +0000 (09:37 -0400)] 
config/af-packet: Warn/replace rollover usage

Issue: 6128

No longer permit rollover/cluster_rollover to be used. Usage will
generate a warning message and cluster_flow will be used instead.

2 years agoconfig: Document cluster_rollover deprecation
Jeff Lucovsky [Fri, 23 Jun 2023 13:36:11 +0000 (09:36 -0400)] 
config: Document cluster_rollover deprecation

Issue: 6128

cluster_rollover is no longer permitted; using it will generate a
warning message and it'll be replaced with cluster_flow

2 years agodoc/afpacket: Document rollover deprecation
Jeff Lucovsky [Fri, 23 Jun 2023 13:22:50 +0000 (09:22 -0400)] 
doc/afpacket: Document rollover deprecation

2 years agodetect/stat: Display 0 instead of nan
Jeff Lucovsky [Fri, 23 Jun 2023 13:00:33 +0000 (09:00 -0400)] 
detect/stat: Display 0 instead of nan

This commit updates the summary message when Suricata terminates.
Without this commit, "nan" was displayed if there were no drops/packets

2 years agogithub-ci: add CentOS Stream builders 9143/head
Jason Ish [Mon, 3 Jul 2023 18:13:13 +0000 (12:13 -0600)] 
github-ci: add CentOS Stream builders

Builders for CentOS Stream 8 and 9.

2 years agogithub-ci: replace dist builder with Debian 12
Jason Ish [Mon, 3 Jul 2023 18:04:16 +0000 (12:04 -0600)] 
github-ci: replace dist builder with Debian 12

Add new dist builder job based on Debian 12. Debian 12 gives us news
Sphinx that AlmaLinux 8, plus avoids any potential disruption in the
RHEL rebuild ecosystem.

Also make dist building its own job so it finishes quicker, allowing
other jobs to proceed.  The new non-dist building Debian 12 job will
still do a complete distcheck, as do other jobs.

2 years agogithub-ci: add Debian 12 builder
Jason Ish [Mon, 3 Jul 2023 18:02:02 +0000 (12:02 -0600)] 
github-ci: add Debian 12 builder

2 years agoexception: fix use of master switch with default
Juliana Fajardini [Wed, 21 Jun 2023 20:54:41 +0000 (17:54 -0300)] 
exception: fix use of master switch with default

If an exception policy wasn't set up individually, use the GetDefault
function to pick one. This will check for the master switch option and
handle 'auto' cases.

Instead of deciding what the auto value should be when we are parsing
the master switch, leave that for when some of the other policies is to
be set via the master switch, when since this can change for specific
exception policies - like for midstream, for instance.

Update exceptions policies documentation to clarify that the default
configuration in IPS when midstream is enabled is `ignore`, not
`drop-flow`.

Bug #6169

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

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

2 years agomime: compute full body md5 9111/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

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

2 years agopython: remove futile exec perm from files
Shivani Bhardwaj [Wed, 28 Jun 2023 06:18:27 +0000 (11:48 +0530)] 
python: remove futile exec perm from files

2 years agosuricatasc: update running instructions
Shivani Bhardwaj [Tue, 27 Jun 2023 07:04:48 +0000 (12:34 +0530)] 
suricatasc: update running instructions

2 years agopython: remove unneeded setup.py
Shivani Bhardwaj [Tue, 27 Jun 2023 05:21:38 +0000 (10:51 +0530)] 
python: remove unneeded setup.py

We no longer use this script or upload packages to PyPi.

2 years agosuricatasc: remove unneeded shebang
Shivani Bhardwaj [Tue, 27 Jun 2023 05:16:44 +0000 (10:46 +0530)] 
suricatasc: remove unneeded shebang

The caller for suricatasc is in python/bin. The script is never executed
directly and doesn't need the shebang.

2 years agogithub-ci: allow pull request URL in SV_BRANCH 9093/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.

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.

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).