Commit Graph

13431 Commits (1bff888947345505c773ab07337546aa72e95d16)
 

Author SHA1 Message Date
Victor Julien 1bff888947 detect: fix duplicate detect state issue
For protocols with multi buffer inspection there could be multiple times
the same sid would be queued into the candidates queue. This triggered
a debug validation check.

W/o debug validation this would lead to duplicate work and possibly multiple
alerts where a single one would be appropriate.

Bug: 5419.
3 years ago
Victor Julien d31beba8d4 detect/frames: fix too strict debug check
Frame::len is -1 if it is still unknown. Handle that in the debug
check.
3 years ago
Victor Julien f04b7a1827 stream/ids: make sure we don't slide past last_ack
Bug: #5401.
3 years ago
Victor Julien 55b2077fcd stream: minor code cleanup 3 years ago
Shivani Bhardwaj 78045d3bbf tls/sni: remove unused fn declaration 3 years ago
Shivani Bhardwaj a77977ec62 doc: add description for tls.random 3 years ago
Shivani Bhardwaj 42c3f418c6 tls: add tls.random* keywords
Add tls.random keyword that matches on the 32 bytes of the TLS
random field for client as well as server.
Add tls.random_time keyword that matches on the first 4 bytes of the TLS
random field for client as well as server.
Add tls.random_bytes keyword that matches on the last 28 bytes of the TLS
random field for client as well as server.

All these are sticky buffers.

Feature 5190
3 years ago
Philippe Antoine e587f6792a detect: support file.data for HTTP1 to server
That is file sent with POST or PUT

Ticket: #4144
3 years ago
Victor Julien 50f8779128 flow-manager: reduce burstiness in adaptive timing
Previous adaptive model would have a large time range when scanning the
hash when not so busy. In the default case it would take up to 4 minutes
for a full hash scan. In case of sudden increase in business, where the
hash would fill up rapidily during a few seconds, the flow manager would
be forced to suddenly consider a much larger slice of the hash leading
to a burst of work. This burst would increase pressure on the rest of the
system leading to packet loss as the worker threads would be overloaded
with flow housekeeping tasks.

This patch reduces the max scan time to 10 seconds, and ramps up quickly
to increase the slice of the hash scanned.
3 years ago
Juliana Fajardini 58ef3cde7a exceptions: error out when invalid policy is used
Before, if an invalid value was passed as exception policy, Suricata
would log a warning and set the exception policy to "ignore". This is a
very different result, than, say, dropping or bypassing a midstream flow.

Task #5504
3 years ago
Philippe Antoine 61b73416e2 detect: transforms check for 0-sized buffer
So as to avoid undefined behavior with a 0-sized variable length
array

Ticket: #5521
3 years ago
Eric Leblond 2cc9152fc9 rust/smb: log uuid of interface in dcerpc
When doing a DCERPC request, we can use the context id to log the
interface that is used. Doing that we can see in one single event
what is the DCERPC interface and opnum that are used. This allows
to have all the information needed to resolve the request to a
function call.

Feature #5413.
3 years ago
Eric Leblond b6f1cf255c rust/smb/dcerpc: parse context id
As context id is used to know to which variant of the endpoint the
request is done, it is interesting to parse it.

Feature #5413.
3 years ago
Philippe Antoine d1ebf320f7 fuzz: disable enip detection based on source port
So as to avoid fuzzing detecting protocol polyglots with enip
3 years ago
Philippe Antoine 617c9fb7e5 fuzz: remove check about max transactions
Suricata can indeed pipeline many HTTP1 transactions
3 years ago
Victor Julien b01c311c1d profiling: fix implicit-int-float-conversion warnings 3 years ago
Victor Julien aa09d5f556 packetpool: ifdef debug check 3 years ago
Juliana Fajardini e7727c3744 decode: remove unused macros, replace w/ functions
With the recent changes, these macros weren't being used anymore.

Related to
Bug #5458
3 years ago
Juliana Fajardini d07a6c6174 stream/tcp: remove repeated header declaration
StreamTcpRegisterTests was being declared twice.
3 years ago
Juliana Fajardini f897761ecb detect/alert: add unittests to check packet action
Add unittests to check that packet flags are correctly updated after
detection finds drop or reject rules that match.

Related to
Bug #5458
3 years ago
Juliana Fajardini abd595d695 decode: validate if dropped packet has drop reason
Related to
Bug #5458
3 years ago
Juliana Fajardini 1f54e8611a detect/alert: ensure reject action is applied
Bug 5458 states that the reject action is no longer working. While SV
tests that use the reject action still pass, it indeed seems that a
regression has happened with commit aa93984, because while the
function that applies rule actions to the flow (RuleActionToFlow) does
check for the reject action, the newly added function PacketApply
SignatureActions only checks for ACTION_DROP or ACTION_PASS when
deciding to call RuleActionToFlow.

Bug #5458
3 years ago
Juliana Fajardini 1774ff18a6 decode: make PacketDrop use action as parameter
A Packet may be dropped due to several different reasons. This change
adds action as a parameter, so we can update the packet action when we
drop it, instead of setting it to drop.

Related to
Bug #5458
3 years ago
Eric Leblond 01bf0ad43d luajit: fix unittests build
When building with the following options:

 ./configure CC=clang --enable-luajit --enable-geoip --enable-unittests

There is a build failure:

runmode-unittests.c:234:9: error: implicit declaration of function 'LuajitSetupStatesPool' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if (LuajitSetupStatesPool() != 0) {
3 years ago
jason taylor c29942c029 userguide: update dsize documentation/examples
Signed-off-by: jason taylor <jtfas90@gmail.com>
3 years ago
dependabot[bot] 7be28aebc6 github-actions: bump actions/cache from 3.0.7 to 3.0.8
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](a7c34adf76...fd5de65bc8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Philippe Antoine 11f849c3ee protocol-change: sets event in case of failure
Protocol change can fail if one protocol change is already
occuring.

Ticket: #5509
3 years ago
Philippe Antoine e94920b49f smb: do not use tree id to match create request and response
As an SMB2 async response does not have a tree id, even if
the request has it.

Per spec, MessageId should be enough to identifiy a message request
and response uniquely across all messages that are sent on the same
SMB2 Protocol transport connection.
So, the tree id is redundant anyways.

Ticket: #5508
3 years ago
Victor Julien 9353b07292 github: update Rust versions 3 years ago
Victor Julien 3dea69ec83 github: bump ubuntu-18.04 runners to 22.04 3 years ago
Philippe Antoine 461725a9bf dhcp: adds leasetime keyword
As it is logged

Ticket: #5435
3 years ago
Jason Ish f1f43cba5e app-layer: don't wrap around on port 65535
A port value of 65535 caused the port value to wrap-around to 0
resulting in an infinite loop.

Fixes: 53fc70a9a7 ("protodetect: fix int warnings")
3 years ago
dependabot[bot] c8cf25a21a github-actions: bump actions/cache from 3.0.6 to 3.0.7
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.6...a7c34adf76222e77931dedbf4a45b2e4648ced19)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Victor Julien 3eb4fee040 rust: set MSRV to 1.58.1
Ticket: #4163.
3 years ago
Juliana Fajardini c81b78fd1c detect/parse: test sig parsing for more actions
Our unittests were only covering sig parsing for alert actions. As in
environments without LibNet the reject action will not work, we must
ensure that our parser properly fails in such cases, instead of silently
accepting an unsupported action.

Added tests for the reject and drop action.

Task #5496
3 years ago
Shivani Bhardwaj 2c4d6b33ae doc/conf: fix sphinx language setting
sphinx-build 5.1.1 and above throws a warning which is treated as an
error while building.

Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).
3 years ago
Philippe Antoine 9b4a133777 http2: remove to_vec for comparisons
Ticket: #5454
3 years ago
Philippe Antoine d011b468da http2: fix clippy warning about &Vec<u8>
Using &[u8] instead in function prototype
3 years ago
Shivani Bhardwaj 14561ffe72 eve/schema: add smtp url bool fields 3 years ago
Eric Leblond 954e3e1f3f smtp/mime: fix url extraction when no config is set 3 years ago
Eric Leblond ad6c2f1411 eve/email: log existing url type
MIME parsing was setting flag on URL to indicate their
estimated type. This patch attach the information to
the email object so the user can extract interesting
email directly:

```
  "email": {
    "status": "PARSE_DONE",
    "from": "Eric Leblond <regit@regit.org>",
    "to": [
      "eric@regit.org"
    ],
    "has_ipv6_url": false,
    "has_ipv4_url": false,
    "has_exe_url": true,
    "url": [
      "http://www.toto.com",
      "http://perdu.com.",
      "https://hacke.me/pown.exe"
    ]
  }
```
3 years ago
Eric Leblond 767d2cc9ba util/mime: add some extensions to exe list 3 years ago
Benjamin Wilkins 3b1b9a32fb doc: Document SCByteVarGet lua function
Add documentation for accessing results from byte_extract and byte_math
in lua match functions

Issue: 2871
3 years ago
Benjamin Wilkins 57ef80f5ec lua: Expose byte extract to lua match scripts
Allow lua match scripts to access variables defined in rule by
byte_extract or byte_math

Issue: 2871
3 years ago
Philippe Antoine 3de735ae70 ike: log ikev1 tx fields instead of state ones
As state fields can grow abitrarily, and this can lead to DOS
by quadratic complexity (CPU time and disk space)

Adds a direction field to retain all the information in the
transaction.

Also checks array vendor_ids had at least one element before
logging it.

Ticket: #5455
3 years ago
Philippe Antoine d0171d7418 ike: rustfmt 3 years ago
Jason Ish 2b83cc799d github-ci: add AlmaLinux 9 build 3 years ago
Jason Ish d9b6e1d967 github-ci: test execution of suricatasc and suricata-update 3 years ago
Jason Ish 9a1d6af858 python: install without distutils
Instead of using distutils/setuptools for installing the Python code,
just install it into our own Python directory.

Distutils is being removed from Python, and setuptools doesn't work well
when trying to install into your own location. For our usage its just
simpler to install with make.

In addition to removing the configure check for distutils, also remove
the check for pyyaml. This lets the user install pyyaml after Suricata
is installed, and Suricata-Update does handle this case gracefully.

Issue: #5313
3 years ago
Eric Leblond debdff0375 detect/tls: fix descriptions
Most keywords were presented as content modifiers when they
were in fact sticky buffers.
3 years ago