Commit Graph

17519 Commits (ba7a42b4eba109c8055126918242eaf7c9f6dc6f)
 

Author SHA1 Message Date
Lukas Sismis ba7a42b4eb threading: let cpu set building callback return a value 1 year ago
Lukas Sismis 8817a959e8 threading: support thread autopinning and interface-specific affinity
Using the new configuration format, it is now possible to set CPU affinity
settings per interface.

The threading.autopin option has been added to automatically use CPUs from the
same NUMA node as the interface. The autopin option requires
hwloc-devel / hwloc-dev to be installed and --enable-hwloc flag in configure
script.

Ticket: 7036
1 year ago
Lukas Sismis 1a1789eb29 doc: remove title in threading section with no content 1 year ago
Lukas Sismis 6c654e30ac threading: support previous threading configuration format
Provide backward compatibility with the previous configuration
format to allow smooth transition to the new format.
The commit adds docs about the new format and the introduced changes.
1 year ago
Lukas Sismis 733cf34ad7 threading: transform *-cpu-set nodes from list items to nodes
Part of Ticket 2321 work to remove unnecessary lists from
the config file.

Ticket: 2321
1 year ago
Lukas Sismis 390baad7dc util-affinity: move properties of *-cpu-set node one layer up in YAML 1 year ago
Lukas Sismis fbfced12f2 threading: refactor CPU affinity code
Split the code into multiple functions for easier readability.
1 year ago
Lukas Sismis 35c86ce800 actions: test hwloc build 1 year ago
Lukas Sismis 49cd1206e8 github-ci: install hwloc as a mandatory dependency 1 year ago
Lukas Sismis e471972a5b dpdk: move DPDK socket retrieval to utils 1 year ago
Lukas Sismis 44948b9e28 runmodes: query the active runmode with a function call 1 year ago
Jason Ish f0411c079d rust: fix compiler warning for confusing lifetimes
For example:

error: lifetime flowing from input to output with different syntax can be confusing
   --> htp/src/headers.rs:475:16
    |
475 | fn null(input: &[u8]) -> IResult<&[u8], ParsedBytes> {
    |                ^^^^^             -----  ----------- the lifetimes get resolved as `'_`
    |                |                 |
    |                |                 the lifetimes get resolved as `'_`
    |                this lifetime flows to the output
    |
note: the lint level is defined here
   --> htp/src/lib.rs:3:9

This currently only happens when using the Rust nightly compiler, which
we use for our fuzz builds.
1 year ago
Lukas Sismis f865b7cc97 hs-cache: adjust printing directive to match uint64_t 1 year ago
Jason Ish b83c2dacd4 lua: update to Lua 5.4.8
Also uses a proper Lua tagged version that is not a pre-release.

Ticket: #7632
1 year ago
Jason Ish e7366e43b5 rust: update deps
Update all deps with cargo update. Additionally, apply the updated
versions to the Cargo.toml, which while not stricly required, does
make it more clear what the version in use is.
1 year ago
Jason Ish 332bc6a05b rust: fix new clippy issues with MSRV update 1 year ago
Jason Ish 7de03a5ef3 rust: update clap and rustyline
With a MSRV of 1.75.0 we can now use current Clap. Rustlyline is
updated, but still needs to be held back from the most current
release.
1 year ago
Jason Ish 55a0d403cb rust: unpin once_cell from old version
We can now update to the current version of once_cell with Rust 1.75.
1 year ago
Jason Ish f0eaebe3a6 rust: set MSRV to 1.75.0
This is the Rust version found on Ubuntu LTS releases as of today, and
is the oldest we need to support.

Ticket: #6573
1 year ago
Jeff Lucovsky a8a3780276 doc/entropy: Document the entropy log output 1 year ago
Jeff Lucovsky a292670443 detect/entropy: Add calculated entropy value to flowvars
When the entropy keyword is used, record the calculated entropy value to
a flow variable for logging use.
1 year ago
Jeff Lucovsky 62e3c02914 doc: Add missing contributors to ack file
Add missing contributors as identified by
    git shortlog -s -n --no-merges -- .
1 year ago
Juliana Fajardini 9614770483 doc/lua: document request_host lua lib
Seems that we missed bringing this one, when documenting HTTP lua lib
functions.
1 year ago
Philippe Antoine 9054187659 pop3: install rules 1 year ago
Philippe Antoine 966b833113 pop3: fix event rule 1 year ago
Philippe Antoine 79544d0f1e rust: remove some unneeded cbindgen:ignore
Ticket: 7667
1 year ago
Philippe Antoine 7bb0c94ae9 rust: bindgen app-layer-detect-proto.h
Ticket: 7667
1 year ago
Jeff Lucovsky ace0d37636 detect/content: account for distance variables
Under some cases (below), the depth and offset values are used
twice. This commit disregards the distance variable (if any), when
computing the final depth.

These rules are logically equivalent::
1. alert tcp any any -> any 8080 (msg:"distance name"; flow:to_server; content:"Authorization:"; content:"5f71ycy"; distance:0; byte_extract:1,0,option_len,string,relative; content:!"|38|"; distance:option_len; within:1; content:"|37|"; distance:-1; within:1; content:"|49|"; distance:option_len; within:1; sid:1;)
2. alert tcp any any -> any 8080 (msg:"distance number"; flow:to_server; content:"Authorization:"; content:"5f71ycy"; distance:0; byte_extract:1,0,option_len,string,relative; content:!"|38|"; distance:7; within:1; content:"|37|"; distance:-1; within:1; content:"|49|"; distance:option_len; within:1; sid:2;)

The differences:
Rule 1: content:!"|38|"; distance:option_len; within:1; //option_len == 7

Rule 2: content:!"|38|"; distance:7; within:1;

Without this commit, rule 2 triggers an alert but rule 1 doesn't.

Issue: 7390
1 year ago
Lukas Sismis 5dcd0a36f9 flow: convert flow_id to uint64 as no signdess is necessary 1 year ago
Lukas Sismis a90f0c96b5 dpdk: change thread_id field to uint16_t 1 year ago
Lukas Sismis 4dfd44d350 dpdk: update types to avoid type-warnings 1 year ago
Lukas Sismis 21366c5353 detect-engine: remove redundant configuration check 1 year ago
Lukas Sismis 0ef3bff495 detect-engine: check return value of SCGetConf
Ticket: 7634
coverity id: 1645571
1 year ago
Juliana Fajardini e3e24cfb3d decode/ipv4: add missing ip-in-ip case handling
A flow with IPv4 IP in IP traffic won't handle this tunneling case
properly.
This leads to potential malicious traffic not triggering alerts, as well
as other inaccuracies in the logs.

Bug #7725
1 year ago
Juliana Fajardini 72e440551d decode/ipv4: apply-clang formatting changes 1 year ago
Jason Ish 62df7c8e81 doc/lua: remove reference to removed functions
These have all been replaced by libs and already documented in their
lib format.

Ticket: #7728
1 year ago
Jason Ish e1d91497c9 lua/output: access luastate within lock
Fixes Coverity issue:

CID 1648445: (#1 of 1): Data race condition (MISSING_LOCK)
4. missing_lock: Accessing td->lua_ctx->luastate without holding lock
LogLuaCtx_.m. Elsewhere, LogLuaCtx_.luastate is written to with
LogLuaCtx_.m held 41 out of 41 times.
1 year ago
Juliana Fajardini 765041dcdd pgsql: fix clippy warnings 1 year ago
Juliana Fajardini be47de4f6d pgsql: fix typo in comment that changed meaning 1 year ago
Juliana Fajardini 88fdfb9d5a pgsql: debug validation on duplicated request msgs
There shouldn't be duplicated messages in the requests Vec. And thus
the parser shouldn't log duplicated keys nor messages. Add debug
validations to ensure this.

With PGSQL's current state machine, most frontend/ client messages will
lead to the creation of a new transaction - which would prevent
duplicated messages being pushed to the requests array and reaching the
logger.

The current exceptions for that are:

- CopyDataIn
- CopyDone
- CopyFail

Thus, debug statements were added for those cases.

CopyDone and CopyFail, per the documentation, shouldn't be seen
duplicated on the wire for the same transaction. CopyDataIn -- yes, but
we consolidate those, so the expectation is that they won't be
duplicated in the requests array or when reaching the logger either.

Related to
Task #7645
1 year ago
Juliana Fajardini f4439c520c pgsql: separate request completion and state type
Since some of state types could indicate a request completion, don't
process them in if/else statements.

Related to
Task #7645
1 year ago
Juliana Fajardini 68acc0cfcb pgsql: be more strict with pub usage
Review pub visibility to:
Make it pub crate-only wherever possible.
Remove pub altogether where not-needed.
1 year ago
Juliana Fajardini 57f7f93a03 pgsql: reorganize pgsql states for CopyData msgs
To set apart states that are both for frontend and backend.
1 year ago
Juliana Fajardini f3aa0085a0 pgsql: rename copy in/out response field
We used `copy_column_count`, while just `columns` is more accurate with
what PostgreSQL describes, and what Wireshark shows.

Related to
Task #7644
Task #7645
1 year ago
Juliana Fajardini e5a47d7616 pgsql: rename 'dummy' response variables
While this could be considered minor, they were not just bad, but
misleading names, as the variables weren't really `dummy` responses,
but consolidating several messages.
1 year ago
Juliana Fajardini 2086f99d6b pgsql: add initial support to CopyIn mode/subproto
This sub-protocol inspects messages sent mainly from the frontend to
the backend after a 'COPY FROM STDIN' has been processed by the
backend.

Parses new messages:
- CopyInResponse -- initiates copy-in mode/sub-protocol
- CopyData (In) -- data transfer message, from frontend to backend
- CopyDone -- signals that no more CopyData messages will be seen from
  the frontend, for the current transaction
- CopyFail -- used by the frontend to signal some failure to proceed
  with sending CopyData messages

Task #7645
1 year ago
Juliana Fajardini d5c48259de schema/psgql: fix fields order 1 year ago
Juliana Fajardini 3febbcbf1c pgsql: document CopyOut messages
Related to
Task #7644
1 year ago
Juliana Fajardini decbb0ba5f pgsql: allow multi-request transactions
Important for CopyIn mode/ subprotocol, where the frontend is the one
sending 0 or more messages to the backend as part of a transaction.

Related to
Task #7645
1 year ago
Juliana Fajardini b3b0bbd1c3 pgsql: make CopyData struct generic
We have a data structure that can be used both for backend and frontend
messages, but was named as backend only.

Related to
Task #7645
1 year ago