]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agodpdk: treat unknown socket ID as a valid socket ID 9288/head
Lukas Sismis [Mon, 17 Jul 2023 09:33:18 +0000 (11:33 +0200)] 
dpdk: treat unknown socket ID as a valid socket ID

Ticket: #6232

2 years agodpdk: fix DPDK thread check for IPS mode
Lukas Sismis [Tue, 25 Jul 2023 11:07:39 +0000 (13:07 +0200)] 
dpdk: fix DPDK thread check for IPS mode

Ticket: #6233

2 years agouserguide/upgrade: link to exception policy FAQ
Juliana Fajardini [Mon, 24 Jul 2023 15:45:41 +0000 (12:45 -0300)] 
userguide/upgrade: link to exception policy FAQ

With the release of 7, people are starting to have issues with traffic
being blocked. While we don't add a more expansive documentation for
this, add a link to the FAQ covering possible fixes for drops caused by
the fail closed default behavior of the exception policies.

2 years agooutput: add storing boolean for files
Philippe Antoine [Mon, 26 Dec 2022 11:24:11 +0000 (12:24 +0100)] 
output: add storing boolean for files

When filestore keyword is triggered, the file is not yet stored,
when the alert is generated, but only marked for storing.

Ticket: 4881

2 years agojsonschema: add missing field .files[].file_id
Philippe Antoine [Mon, 26 Dec 2022 11:26:15 +0000 (12:26 +0100)] 
jsonschema: add missing field .files[].file_id

2 years agosrc: checks to avoid divisions by zero
Philippe Antoine [Fri, 30 Jun 2023 08:21:57 +0000 (10:21 +0200)] 
src: checks to avoid divisions by zero

Ticket: #5920

2 years agoprofiling: fix check to compute average bytes
Philippe Antoine [Wed, 5 Jul 2023 13:32:57 +0000 (15:32 +0200)] 
profiling: fix check to compute average bytes

2 years agostats: add drop reason counters
Victor Julien [Tue, 25 Jul 2023 05:51:02 +0000 (07:51 +0200)] 
stats: add drop reason counters

{
  "accepted": 296185,
  "blocked": 162,
  "rejected": 0,
  "replaced": 0,
  "drop_reason": {
    "decode_error": 0,
    "defrag_error": 0,
    "defrag_memcap": 0,
    "flow_memcap": 0,
    "flow_drop": 94,
    "applayer_error": 0,
    "applayer_memcap": 0,
    "rules": 3,
    "threshold_detection_filter": 0,
    "stream_error": 63,
    "stream_memcap": 0,
    "stream_midstream": 2,
    "nfq_error": 0,
    "tunnel_packet_drop": 0
  }
}

Ticket: #6230.

2 years agostats: update ips capture counters centrally
Victor Julien [Mon, 24 Jul 2023 20:13:52 +0000 (22:13 +0200)] 
stats: update ips capture counters centrally

This adds support to all capture methods for these counters.

The updates happen only on "real" packets, not on encapsulated
packets.

Ticket: #4756.

2 years agostats: register ips capture stats for each packet thread
Victor Julien [Mon, 24 Jul 2023 19:09:10 +0000 (21:09 +0200)] 
stats: register ips capture stats for each packet thread

ReleasePacket based verdicts can happen in several threads,
depending on the runmode details.

Only register and update if in IPS mode.

2 years agoeve/schema: add ips capture stats
Victor Julien [Mon, 24 Jul 2023 19:08:00 +0000 (21:08 +0200)] 
eve/schema: add ips capture stats

2 years agostats: simplify ips capture stats logic
Victor Julien [Mon, 24 Jul 2023 18:33:35 +0000 (20:33 +0200)] 
stats: simplify ips capture stats logic

Since many implementations use the ReleasePacket callback to issue
their verdict, no thread ctx is available. To work around this
just register the stats in a `thread_local` variable instead.

2 years agomime: replace small memcpy with loop
Victor Julien [Fri, 21 Jul 2023 08:05:41 +0000 (10:05 +0200)] 
mime: replace small memcpy with loop

To address:

      In file included from /usr/include/string.h:535,
                 from suricata-common.h:108,
                 from util-decode-mime.c:26:
In function ‘memcpy’,
    inlined from ‘ProcessBase64Remainder’ at util-decode-mime.c:1201:13:
/usr/include/mipsel-linux-gnu/bits/string_fortified.h:29:10: warning: ‘__builtin_memcpy’ forming offset 4 is out of the bounds [0, 4] of object ‘block’ with type ‘uint8_t[4]’ {aka ‘unsigned char[4]’} [-Warray-bounds=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
util-decode-mime.c: In function ‘ProcessBase64Remainder’:
util-decode-mime.c:1174:13: note: ‘block’ declared here
 1174 |     uint8_t block[B64_BLOCK];
      |             ^~~~~

Copy data should be <= 4 bytes.

2 years agodetect: fix minor compile warning
Victor Julien [Fri, 21 Jul 2023 08:32:07 +0000 (10:32 +0200)] 
detect: fix minor compile warning

      detect-engine.c: In function ‘DetectKeywordCtxHashFunc’:
detect-engine.c:3550:75: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 3550 |     uint64_t hash = StringHashDjb2((const uint8_t *)name, strlen(name)) + (uint64_t)ctx->data;
      |

2 years agosysfs: fix minor compile warning
Victor Julien [Fri, 21 Jul 2023 08:03:44 +0000 (10:03 +0200)] 
sysfs: fix minor compile warning

Seen in Debian QA on mipsel.

util-sysfs.c: In function ‘SysFsWriteValue’:
util-sysfs.c:50:45: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int64_t’ {aka ‘long long int’} [-Wformat=]
   50 |     snprintf(sentence, sizeof(sentence), "%ld", value);
      |                                           ~~^   ~~~~~
      |                                             |   |
      |                                             |   int64_t {aka long long int}
      |                                             long int
      |                                           %lld

2 years agodecode-ipv6: Set L4 proto on ipv6 incase of GRE decode error 9267/head
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

2 years agodecode: fix offset for DCE layer 9261/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

2 years agodetect/include: Remove unnecessary includes 9248/head
Jeff Lucovsky [Tue, 18 Jul 2023 12:31:32 +0000 (08:31 -0400)] 
detect/include: Remove unnecessary includes

2 years agoversion: start development towards 7.0.1
Victor Julien [Tue, 18 Jul 2023 15:15:53 +0000 (17:15 +0200)] 
version: start development towards 7.0.1

2 years agorelease: 7.0.0; update changelog suricata-7.0.0
Shivani Bhardwaj [Tue, 18 Jul 2023 04:35:41 +0000 (10:05 +0530)] 
release: 7.0.0; update changelog

2 years agodetect/multi-tenant: Make tenant_id 32 bits everywhere 9244/head
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.

2 years agodetect/pcre: Use local match variables 9243/head
Jeff Lucovsky [Sun, 16 Jul 2023 15:57:14 +0000 (11:57 -0400)] 
detect/pcre: Use local match variables

pcre2 is not thread-safe wrt match objects so use locally scoped
objects.

Issue: 4797

2 years agodetect/base64_decode: use local pcre2_match_data 9240/head
Victor Julien [Sun, 16 Jul 2023 10:49:12 +0000 (12:49 +0200)] 
detect/base64_decode: use local pcre2_match_data

2 years agoreference: fix multi-tenant loading issues
Victor Julien [Sun, 16 Jul 2023 08:44:18 +0000 (10:44 +0200)] 
reference: fix multi-tenant loading issues

Bug: #4797.

2 years agoclassification: fix multi-tenant loading issues
Victor Julien [Sun, 16 Jul 2023 08:33:11 +0000 (10:33 +0200)] 
classification: fix multi-tenant loading issues

Move pcre2 data structures used for parsing into the detect engine
context, so that multiple tenant loading threads don't use the same
data structures.

Bug: #4797.

2 years agodoc/userguide: update ref to installation from git 9239/head
Juliana Fajardini [Tue, 11 Jul 2023 14:17:41 +0000 (11:17 -0300)] 
doc/userguide: update ref to installation from git

It was still pointing to the redmine wiki and the documentation to be
truthful to the new documentation.

2 years agometa-docs: update links
Juliana Fajardini [Tue, 4 Apr 2023 16:02:57 +0000 (13:02 -0300)] 
meta-docs: update links

Readme and PR template was still pointing to the redmine wiki and
readthedocs, replace with docs.suricata links.

2 years agodoc: security policy
Victor Julien [Wed, 16 Jun 2021 12:36:25 +0000 (14:36 +0200)] 
doc: security policy

2 years agogithub-ci: don't build docs in almalinux:8, centos:8
Jason Ish [Fri, 7 Jul 2023 17:11:48 +0000 (11:11 -0600)] 
github-ci: don't build docs in almalinux:8, centos:8

Our docs require a newer version of Sphinx.

2 years agodoc/support-status: add support status page
Jason Ish [Tue, 30 May 2023 18:50:34 +0000 (12:50 -0600)] 
doc/support-status: add support status page

Convert the wiki page,
https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Support_Status
into a page that is versioned along with the user guide.

Includes many updates to reflect our current support status.

2 years agodoc/userguide: avoid horizontal scroll on rtd
Jason Ish [Tue, 30 May 2023 20:51:17 +0000 (14:51 -0600)] 
doc/userguide: avoid horizontal scroll on rtd

Add CSS to avoid horizontal scroll in tables on ReadTheDocs. This will
wrap the text instead.

Also, vertically align to top so if a cell does wrap, other cells that
do not wrap don't place the text in the middle of the cell.

2 years agofile: remove FILE_USE_DETECT flag 9237/head
Victor Julien [Tue, 11 Jul 2023 08:04:45 +0000 (10:04 +0200)] 
file: remove FILE_USE_DETECT flag

All implementations were converted to use the logic, so the flag itself
can be removed.

2 years agodetect/file: Remove centralized proto definition
Jeff Lucovsky [Mon, 10 Jul 2023 14:41:08 +0000 (10:41 -0400)] 
detect/file: Remove centralized proto definition

Issue: 4145

Remove centralized protocol definitions for file handling in favor of
consolidated file access handling.

2 years agodetect/file_data: Consolidate file handling
Jeff Lucovsky [Mon, 10 Jul 2023 14:40:24 +0000 (10:40 -0400)] 
detect/file_data: Consolidate file handling

Issue: 4145

Consolidate file handling for all protocols that use file objects for
file_data.

Make sure http_server_body / http.response_body for HTTP1 continue
to inspect the actual body. For HTTP2, http.response_body acts as
an internal alias for `file_data`.

2 years agodetect/file: Filehandler registration logic
Jeff Lucovsky [Mon, 10 Jul 2023 14:39:02 +0000 (10:39 -0400)] 
detect/file: Filehandler registration logic

Add file handler registration functions for consolidated file handling.

Issue: 4145

2 years agofile/htp: Add logic for file access
Jeff Lucovsky [Mon, 10 Jul 2023 14:33:15 +0000 (10:33 -0400)] 
file/htp: Add logic for file access

Set file inspection sizes and marker for use with detect logic when
opening files by name or as part of a range.

Issue: 4145

2 years agofile: Window and edge adjustments
Jeff Lucovsky [Mon, 10 Jul 2023 14:31:45 +0000 (10:31 -0400)] 
file: Window and edge adjustments

Issue: 4145

Adjust edge and window values after considering file size/inspected
values.

2 years agodetect/engine: minor debug cleaup
Victor Julien [Fri, 14 Jul 2023 15:24:33 +0000 (17:24 +0200)] 
detect/engine: minor debug cleaup

2 years agodetect/mpm: remove useless checks
Victor Julien [Fri, 14 Jul 2023 15:10:20 +0000 (17:10 +0200)] 
detect/mpm: remove useless checks

The pattern store has already done these checks before.

2 years agompm: Use typedef for mpm registration
Jeff Lucovsky [Mon, 10 Jul 2023 14:12:09 +0000 (10:12 -0400)] 
mpm: Use typedef for mpm registration

Issue: 4145

2 years agorust: fix clippy warnings 9233/head
Shivani Bhardwaj [Thu, 13 Jul 2023 16:09:47 +0000 (21:39 +0530)] 
rust: fix clippy warnings

2 years agorust: update cargo.lock
Victor Julien [Thu, 13 Jul 2023 13:18:54 +0000 (15:18 +0200)] 
rust: update cargo.lock

2 years agouserguide/eve: format and reorganize alert section
Juliana Fajardini [Thu, 22 Dec 2022 23:47:24 +0000 (20:47 -0300)] 
userguide/eve: format and reorganize alert section

The `field action` portion seemed to be comprised of a more generic
section that followed it. Also formatted the section for lines to be
within the character limit.

2 years agooutput/drop: add verdict field
Juliana Fajardini [Wed, 5 Jul 2023 00:37:27 +0000 (21:37 -0300)] 
output/drop: add verdict field

Related to
Bug #5464

2 years agooutput/alert: add verdict field
Juliana Fajardini [Wed, 5 Jul 2023 15:52:53 +0000 (12:52 -0300)] 
output/alert: add verdict field

Related to
Bug #5464

2 years agomisc: fix typos & update copyright years
Juliana Fajardini [Thu, 5 Jan 2023 21:24:40 +0000 (18:24 -0300)] 
misc: fix typos & update copyright years

2 years agoutil/mime: skip over any invalid char
Shivani Bhardwaj [Tue, 11 Jul 2023 09:12:05 +0000 (14:42 +0530)] 
util/mime: skip over any invalid char

For certain edge case handling for spaces, spaces were handled
particularly in the remainder processing functions. Make sure that now
that as per RFC 2045, util-base64 would skip over any invalid char, the
edge cases in MIME processor also be handled the same way.

This completes the work done in e46b033.

Ticket 6135
Ticket 6207

2 years agohttp2: do not append data after closing file 9224/head
Philippe Antoine [Wed, 12 Jul 2023 07:42:47 +0000 (09:42 +0200)] 
http2: do not append data after closing file

Ticket: #6211

Completes commit 02dece5db5170ae9bd946d0b8805e45ac071a97c

Once a http2 stream has end of stream flag, we close the file.
If we see new data frames with this stream id, the new_chunk
function should ignore them as the file was already closed.

2 years agodoc/upgrade: add more 6 to 7 changes and minor improvements
Andreas Herz [Tue, 11 Jul 2023 14:28:12 +0000 (16:28 +0200)] 
doc/upgrade: add more 6 to 7 changes and minor improvements

Issue: #5473

2 years agoconfig/swf: SWF deprecation warning message
Jeff Lucovsky [Tue, 11 Jul 2023 13:04:58 +0000 (09:04 -0400)] 
config/swf: SWF deprecation warning message

Issue: 6183

Issue a deprecation warning if SWF decompression is enabled.

2 years agoflow/hash: fix and cleanup key/flow_id getters
Victor Julien [Mon, 10 Jul 2023 13:25:04 +0000 (15:25 +0200)] 
flow/hash: fix and cleanup key/flow_id getters

Bug: #6205.

2 years agodoc: hyperscan information updated
jason taylor [Tue, 28 Feb 2023 22:46:32 +0000 (22:46 +0000)] 
doc: hyperscan information updated

Signed-off-by: jason taylor <jtfas90@gmail.com>
2 years agodoc: add multi buffer support note to keyword docs
jason taylor [Wed, 5 Jul 2023 23:58:16 +0000 (23:58 +0000)] 
doc: add multi buffer support note to keyword docs

Signed-off-by: jason taylor <jtfas90@gmail.com>
2 years agodoc: add multiple buffer matching documentation
jason taylor [Wed, 5 Jul 2023 23:32:45 +0000 (23:32 +0000)] 
doc: add multiple buffer matching documentation

Signed-off-by: jason taylor <jtfas90@gmail.com>
2 years agodoc/userguide: more eve http upgrade notes
Jason Ish [Thu, 6 Jul 2023 22:56:50 +0000 (16:56 -0600)] 
doc/userguide: more eve http upgrade notes

Add more information with a examples of how the changes to EVE HTTP
logging may affect users.

2 years agouserguide: add details about tcp flow pass
jason taylor [Thu, 15 Jun 2023 18:17:24 +0000 (18:17 +0000)] 
userguide: add details about tcp flow pass

Signed-off-by: jason taylor <jtfas90@gmail.com>
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

2 years agodetect/filemagic: fix thread ctx registration; reloads
Victor Julien [Wed, 12 Jul 2023 06:25:28 +0000 (08:25 +0200)] 
detect/filemagic: fix thread ctx registration; reloads

Make sure thread ctx registration happens and id remains correct
in case of reloads.

To do so, move id var into the detect ctx.

2 years agodetect: more compact layout of DetectEngineCtx
Victor Julien [Wed, 12 Jul 2023 06:08:37 +0000 (08:08 +0200)] 
detect: more compact layout of DetectEngineCtx

2 years agodetect: reduce failure_fatal to bool to save space
Victor Julien [Wed, 12 Jul 2023 06:05:29 +0000 (08:05 +0200)] 
detect: reduce failure_fatal to bool to save space

2 years agospm: reduce spm_matcher size to uint8_t
Victor Julien [Wed, 12 Jul 2023 06:00:47 +0000 (08:00 +0200)] 
spm: reduce spm_matcher size to uint8_t

No more space is needed.

2 years agodetect: create more strict rule validation
Victor Julien [Tue, 4 Jul 2023 18:42:23 +0000 (20:42 +0200)] 
detect: create more strict rule validation

Don't allow control characters other than LF, CR, TAB.

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