Commit Graph

13451 Commits (1b24f4d357fd922a5c3202fce2904da29a04ed12)
 

Author SHA1 Message Date
Eric Leblond 1b24f4d357 doc: document landlock feature 2 years ago
Eric Leblond 485d5a4ea4 landlock: basic implementation
This patch is adding support for Landlock, a Linux
Security Module available since Linux 5.13.

The concept is to prevent any file operation on directories where
Suricata is not supposed to access.

Landlock support is built by default if the header is present. The
feature is disabled by default and need to be activated in the YAML
to be active.

Landlock documentation: https://docs.kernel.org/userspace-api/landlock.html

Feature: #5479
2 years ago
Philippe Antoine fe91506320 doc/http2: suricata.yaml max-streams parameter
Ticket: #4949
2 years ago
Juliana Fajardini bbd968c738 exceptions: add reject support to exception policy
This enables the usage of 'reject' as an exception policy. As for both
IPS and IDS modes the intended result of sending a reject packet is to
reject the related flow, this will effectively mean setting the reject
action to the packet that triggered the exception condition, and then
dropping the associated flow.

Task #5503
2 years ago
Victor Julien f5bd55dac8 decode/tcp: allow 4 byte TFO with 2 byte cookie 2 years ago
Philippe Antoine 5ef259722b dhcp: adds renewal-time keyword
Ticket: #5507
2 years ago
Philippe Antoine dc59389087 dhcp: fix license in detect-dhcp-leasetime.c
from search and replace overkill
2 years ago
Philippe Antoine 6faf6299e0 dhcp: adds rebinding-time keyword
Ticket: #5506
2 years ago
Philippe Antoine 95f0424423 nfs4: fix write record handling
Ticket: #5280
2 years ago
Josh Soref c23560ec41 detect: function header return value clarification
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2 years ago
Philippe Antoine bf43011a43 dcerpc: convert transaction list to vecdeque for UDP
As was done for TCP in dfe76bb90 and d745d28d4

Ticket: #5518
2 years ago
Gleb Smirnoff 5dbbc52b06 ipfw: use PF_DIVERT on modern FreeBSD 2 years ago
Victor Julien bb2e11108b packetpool: fix uaf in debug validation check
Location of the check meant access to freed packet was possible.

Move check and simplify it to just look at the packet at hand.
2 years ago
Philippe Antoine b0ce55c9df flow: finish to remove obsolete counters
As was begun in b3599507f4

Ticket: #5317
2 years ago
Juliana Fajardini ef54f36e34 userguide: briefly introduce exception policy opts
Added them in the configuration section so folks can be more aware of
them, while a more complete documentation isn't around.

Related to
Task #5475
2 years ago
Juliana Fajardini 3c74e443bd userguide: update defrag settings options
We were still mentioning that there were only three options.
2 years ago
Juliana Fajardini 0cc040cf61 userguide: merge sections about AppLayer Parsers
We had two sections under the suricata.yaml configuration section
describing settings for application layer parsers. This merges them into
one and also fixes a few subsection title levels.

Task #5364
2 years ago
Juliana Fajardini aa5bb2c329 stream: add exception policy for midstream flows
This allows to set a midstream-policy that can:
- fail closed (stream.midstream-policy=drop-flow)
- fail open (stream.midstream-policy=pass-flow)
- bypass stream (stream.midstream-policy=bypass)
- do nothing (default behavior)

Usage and behavior:

If stream.midstream-policy is set then if Suricata identifies a midstream flow
it will apply the corresponding action associated with the policy.

No setting means Suricata will not apply such policies, either inspecting the
flow (if stream.midstream=true) or ignoring it stream.midstream=false.

Task #5468
2 years ago
Juliana Fajardini 242b8f7d65 exceptions: add callbacks for drop-flow policy
Make sure that when the policy is to drop the flow, we set no inspection
for payload and packet and disable applayer inspection as well.

Task #5468
2 years ago
Juliana Fajardini fc81c80c04 suricata.yaml: add exception policy config options
Related to
Task #5468
2 years ago
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.
2 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.
2 years ago
Victor Julien f04b7a1827 stream/ids: make sure we don't slide past last_ack
Bug: #5401.
2 years ago
Victor Julien 55b2077fcd stream: minor code cleanup 2 years ago
Shivani Bhardwaj 78045d3bbf tls/sni: remove unused fn declaration 2 years ago
Shivani Bhardwaj a77977ec62 doc: add description for tls.random 2 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
2 years ago
Philippe Antoine e587f6792a detect: support file.data for HTTP1 to server
That is file sent with POST or PUT

Ticket: #4144
2 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.
2 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
2 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
2 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.
2 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.
2 years ago
Philippe Antoine d1ebf320f7 fuzz: disable enip detection based on source port
So as to avoid fuzzing detecting protocol polyglots with enip
2 years ago
Philippe Antoine 617c9fb7e5 fuzz: remove check about max transactions
Suricata can indeed pipeline many HTTP1 transactions
2 years ago
Victor Julien b01c311c1d profiling: fix implicit-int-float-conversion warnings 2 years ago
Victor Julien aa09d5f556 packetpool: ifdef debug check 2 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
2 years ago
Juliana Fajardini d07a6c6174 stream/tcp: remove repeated header declaration
StreamTcpRegisterTests was being declared twice.
2 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
2 years ago
Juliana Fajardini abd595d695 decode: validate if dropped packet has drop reason
Related to
Bug #5458
2 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
2 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
2 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) {
2 years ago
jason taylor c29942c029 userguide: update dsize documentation/examples
Signed-off-by: jason taylor <jtfas90@gmail.com>
2 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>
2 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
2 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
2 years ago
Victor Julien 9353b07292 github: update Rust versions 2 years ago
Victor Julien 3dea69ec83 github: bump ubuntu-18.04 runners to 22.04 2 years ago