]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agodoc: GitHub PRs workflow 8994/head
Philippe Antoine [Thu, 18 May 2023 17:53:27 +0000 (19:53 +0200)] 
doc: GitHub PRs workflow

2 years agouserguide/install: add info on arch-based installs
Jeremy MountainJohnson [Mon, 1 May 2023 17:04:26 +0000 (12:04 -0500)] 
userguide/install: add info on arch-based installs

Add Arch AUR information for installation on Arch-based distros.

2 years agodoc: upgrade guide for logging http custom headers
Philippe Antoine [Tue, 6 Jun 2023 19:54:49 +0000 (21:54 +0200)] 
doc: upgrade guide for logging http custom headers

Ticket: #5320

2 years agodoc: add missing rule to engine-analysis section
Juliana Fajardini [Wed, 7 Jun 2023 19:13:24 +0000 (16:13 -0300)] 
doc: add missing rule to engine-analysis section

The first report didn't have an example rule to go with.

2 years agosource-pcap-file: include unlink error in warning message
Long Doan [Tue, 6 Jun 2023 22:08:06 +0000 (00:08 +0200)] 
source-pcap-file: include unlink error in warning message

2 years agooutput/snmp: log version from tx
Philippe Antoine [Mon, 5 Jun 2023 15:04:04 +0000 (17:04 +0200)] 
output/snmp: log version from tx

and not the one from state

If a SNMP flow starts with a V2 version transaction,
then there is a V3i version transaction,
we will now log V3 for the second transaction

2 years agoexception: in ids mode, only REJECT the packet
Juliana Fajardini [Mon, 5 Jun 2023 16:02:26 +0000 (13:02 -0300)] 
exception: in ids mode, only REJECT the packet

In case of 'EXCEPTION_POLICY_REJECT', we were applying the same behavior
regardless of being in IDS or IPS mode.
This meant that (at least) the 'flow.action' was changed to drop when we
hit an exception policy in IDS mode.

Bug #6109

2 years agodecode-ipv6: Set IPv6 proto incase of ext header parsing error
Cole Dishington [Wed, 24 May 2023 00:39:33 +0000 (12:39 +1200)] 
decode-ipv6: Set IPv6 proto incase of ext header parsing error

Set the IPv6 packet proto before parsing the ext headers, similar to
decode-ipv4, incase of an ext header parsing error. Otherwise
rule decode-events are not triggered for packets encapsulated in IPv6.

Bug: #6086.

2 years agoftp: remove unnecessary code
Shivani Bhardwaj [Mon, 5 Jun 2023 10:48:15 +0000 (16:18 +0530)] 
ftp: remove unnecessary code

2 years agoftp: mark LF found per line
Shivani Bhardwaj [Mon, 5 Jun 2023 10:47:37 +0000 (16:17 +0530)] 
ftp: mark LF found per line

Currently, there is no way to mark if LF was found and then the line was
truncated. It becomes difficult to spot in the callers whether the line
was truncated despite LF being found or not. So, label it clearly with a
variable.

2 years agoftp: separate truncated line markers
Shivani Bhardwaj [Mon, 5 Jun 2023 10:45:51 +0000 (16:15 +0530)] 
ftp: separate truncated line markers

So far, we store one variable in state to hold whether we want to
discard a long line till LF irrespective of direction. This means that a
long command to the client followed by a regular command w LF can be
considered as one long line which is incorrect.

Bug 6054

2 years agowindows: add -lntdll to Windows builds 8990/head
Jason Ish [Wed, 7 Jun 2023 15:22:32 +0000 (09:22 -0600)] 
windows: add -lntdll to Windows builds

Rust 1.70 has introduced some possible issues between LLVM and gcc
causing link errors that are fixed by explicitly adding -lntdll.

Thanks to https://github.com/extendr/rextendr/pull/285 for the fix.

2 years agostreaming/buffer: handle and document slide errors
Victor Julien [Wed, 7 Jun 2023 18:16:00 +0000 (20:16 +0200)] 
streaming/buffer: handle and document slide errors

Slide error may happen if the region we're sliding starts to overlap
with the next region. If we can't temporary grow the current region
to merge with the next region, keep the regions separate.

2 years agostreaming/buffer: minor debug fixup
Victor Julien [Wed, 7 Jun 2023 05:39:26 +0000 (07:39 +0200)] 
streaming/buffer: minor debug fixup

2 years agostreaming/buffer: fix buf_offset getting out of sync
Victor Julien [Wed, 7 Jun 2023 05:38:52 +0000 (07:38 +0200)] 
streaming/buffer: fix buf_offset getting out of sync

During consolidation of regions, buf_offset could get out of sync if
the region was grown on the left side.

To fix, reset it and let "sbb slide" logic correct it.

Bug: #6117.

2 years agostreaming/buffer: fix sliding region into next
Victor Julien [Tue, 6 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
streaming/buffer: fix sliding region into next

When sliding a region it could start to overlap with the next region.
This case wasn't handled, causing validation checks to trigger.

This patch adds support for this, where largest region will be expanded
to fit both region and both regions will be consolidated into it.

Bug: #6066.

2 years agostreaming/buffer: move util code for reusability
Victor Julien [Tue, 6 Jun 2023 10:09:36 +0000 (12:09 +0200)] 
streaming/buffer: move util code for reusability

2 years agooutput/rfb: remove unused function parameters 8965/head
Philippe Antoine [Mon, 5 Jun 2023 08:03:04 +0000 (10:03 +0200)] 
output/rfb: remove unused function parameters

2 years agooutput/mqtt: remove unused function parameters
Philippe Antoine [Mon, 5 Jun 2023 08:01:33 +0000 (10:01 +0200)] 
output/mqtt: remove unused function parameters

2 years agooutput/krb5: remove unused function parameters
Philippe Antoine [Mon, 5 Jun 2023 08:00:12 +0000 (10:00 +0200)] 
output/krb5: remove unused function parameters

2 years agooutput/ftp: remove unused function parameters
Philippe Antoine [Thu, 11 May 2023 08:51:59 +0000 (10:51 +0200)] 
output/ftp: remove unused function parameters

2 years agooutput/dns: remove unused function parameters
Philippe Antoine [Thu, 11 May 2023 08:30:28 +0000 (10:30 +0200)] 
output/dns: remove unused function parameters

2 years agooutput/smtp: remove unused function parameters
Philippe Antoine [Thu, 11 May 2023 08:04:48 +0000 (10:04 +0200)] 
output/smtp: remove unused function parameters

2 years agohttp: complete multipart data on open
Philippe Antoine [Wed, 17 May 2023 16:15:02 +0000 (18:15 +0200)] 
http: complete multipart data on open

Take as much as we can when opening, by making sure that the
boundary is not present

2 years agosmb: fix data padding logic in writeAndX parser
Lancer Cheng [Mon, 29 May 2023 12:07:08 +0000 (12:07 +0000)] 
smb: fix data padding logic in writeAndX parser

Bug: #6008

2 years agosmb: fix wrong data offset when wct = 12
Lancer Cheng [Mon, 22 May 2023 09:16:34 +0000 (09:16 +0000)] 
smb: fix wrong data offset when wct = 12

Bug: #6008

2 years agoflow: optionally use livedev for hash
Philippe Antoine [Thu, 28 Apr 2022 07:49:38 +0000 (09:49 +0200)] 
flow: optionally use livedev for hash

So that in a setup with different interfaces capturing different
networks, flows do not get mixed up

Ticket: #5270

2 years agoflow: make FlowGetExistingFlowFromHash static
Philippe Antoine [Thu, 28 Apr 2022 07:38:24 +0000 (09:38 +0200)] 
flow: make FlowGetExistingFlowFromHash static

For easier reasoning about the code

2 years agodevice: limit device id to uint16_t
Philippe Antoine [Thu, 28 Apr 2022 06:58:47 +0000 (08:58 +0200)] 
device: limit device id to uint16_t

Meaning that we support 65535 live devices at the most

2 years agogeneral/typo: Correct misc. typos
Jeff Lucovsky [Sat, 27 Aug 2022 14:09:28 +0000 (10:09 -0400)] 
general/typo: Correct misc. typos

2 years agodecode/vlan: Remove unused macros/functions
Jeff Lucovsky [Sat, 27 Aug 2022 13:16:46 +0000 (09:16 -0400)] 
decode/vlan: Remove unused macros/functions

This commit removes unused functions and macros related to fetching VLAN
values.

2 years agodecode/vlan: Decode upto 3 layers of VLAN
Jeff Lucovsky [Sun, 7 Aug 2022 19:53:21 +0000 (15:53 -0400)] 
decode/vlan: Decode upto 3 layers of VLAN

Issue: 2816

This commit increase the number of VLAN layers supported by Suricata
from 2 to 3. 3-layers are dubbed "Q-in-Q-in-Q".

Note that 3 layers are not compliant with any existing standard but are
often seen in larger deployments.

2 years agojson/schema: Add additional VLAN layer stat
Jeff Lucovsky [Fri, 5 Aug 2022 13:31:59 +0000 (09:31 -0400)] 
json/schema: Add additional VLAN layer stat

Issue: 2816

This commit extends the JSON schema with the additional VLAN stat for
tracking VLAN encapsulated packets with 3 levels.

2 years agohttp2: avoid quadratic complexity in headers
Philippe Antoine [Wed, 31 May 2023 12:53:28 +0000 (14:53 +0200)] 
http2: avoid quadratic complexity in headers

When adding an element to the dynamic headers table, the oldest
ones may get evicted. When multiple elements get evicted, they
should get evicted all at once with drain, instead of one by one
as there will be a massive move each time.

Ticket: #6103

2 years agodebug: fix list-x command line options with debug
Philippe Antoine [Tue, 23 May 2023 12:06:26 +0000 (14:06 +0200)] 
debug: fix list-x command line options with debug

Debug validation checks that engine is either IPS or IDS.
But listing keywords does not care.
So, setting ids mode

Ticket: #6089

2 years agodoc: add DPDK Bond PMD docs
Lukas Sismis [Tue, 30 May 2023 14:30:27 +0000 (16:30 +0200)] 
doc: add DPDK Bond PMD docs

Ticket: #6099

2 years agodpdk: add support for DPDK Bond PMD
Lukas Sismis [Thu, 25 May 2023 12:02:15 +0000 (14:02 +0200)] 
dpdk: add support for DPDK Bond PMD

Ticket: #6099

2 years agodpdk: add linker flag for DPDK Bond library
Lukas Sismis [Thu, 25 May 2023 12:00:19 +0000 (14:00 +0200)] 
dpdk: add linker flag for DPDK Bond library

Header checking (AC_CHECK_HEADER) did not work as
DPDK 19.11 included rte_eth_bond.h file even if net/bonding
driver was disabled. However, it was still not available in
ldconfig configuration. For this reason Bond PMD is checked with
ldconfig tool.
However when installing the DPDK library manually, the user needs to
update the entries in ldconfig to be able to find the Bond PMD.

Ticket: #6099

2 years agodpdk: add device name querying function
Lukas Sismis [Wed, 31 May 2023 11:44:21 +0000 (13:44 +0200)] 
dpdk: add device name querying function

2 years agodpdk: add debug dump of RX offload capabilities
Lukas Sismis [Thu, 25 May 2023 11:59:44 +0000 (13:59 +0200)] 
dpdk: add debug dump of RX offload capabilities

2 years agodpdk: separate i40e prestop actions from DPKD 19.11
Lukas Sismis [Fri, 2 Jun 2023 13:59:52 +0000 (15:59 +0200)] 
dpdk: separate i40e prestop actions from DPKD 19.11

In DPDK 19.11 Suricata does not setup RSS on i40e driver
with rte_flow. As a result, it should not be deinitializing
RSS configuration with rte_flow as well.

2 years agodpdk: refactor i40e RSS hash function
Lukas Sismis [Thu, 25 May 2023 11:57:57 +0000 (13:57 +0200)] 
dpdk: refactor i40e RSS hash function

Setting rss_conf->rss_key to NULL and rss_key_len
to zero avoids warnings about register changes
when setting up RSS configuration through RTE flows.

2 years agodpdk: minor refactoring in error handling and variable declaration
Lukas Sismis [Thu, 25 May 2023 11:56:27 +0000 (13:56 +0200)] 
dpdk: minor refactoring in error handling and variable declaration

2 years agoflow/worker: minor refactor for app-layer callsite 8951/head
Victor Julien [Fri, 2 Jun 2023 09:08:29 +0000 (11:08 +0200)] 
flow/worker: minor refactor for app-layer callsite

2 years agodetect: remove flow drop unittest
Victor Julien [Thu, 1 Jun 2023 11:18:33 +0000 (13:18 +0200)] 
detect: remove flow drop unittest

Test broke after recent changes. Functionality is tested in
suricata-verify, so just remove the test.

2 years agodetect: add check to validate drops
Victor Julien [Thu, 1 Jun 2023 08:57:08 +0000 (10:57 +0200)] 
detect: add check to validate drops

2 years agodetect: fix stateful drops for rate_filter
Victor Julien [Thu, 1 Jun 2023 06:00:54 +0000 (08:00 +0200)] 
detect: fix stateful drops for rate_filter

2 years agoflow/timeout: no pseudo packets for dropped flows
Victor Julien [Wed, 31 May 2023 13:56:54 +0000 (15:56 +0200)] 
flow/timeout: no pseudo packets for dropped flows

When a flow is in the drop flow state, don't use pseudo packets
when it is timing out. There should be no work left to do at this
point.

2 years agostream: simplify drop handling
Victor Julien [Wed, 31 May 2023 13:52:54 +0000 (15:52 +0200)] 
stream: simplify drop handling

Remove logic to apply flow drop, as this is now handled in the
flow engine.

However, keep the logic that frees/cleans the session state.

2 years agoapp-layer: don't update UDP applayer for dropped packets
Victor Julien [Wed, 31 May 2023 13:52:14 +0000 (15:52 +0200)] 
app-layer: don't update UDP applayer for dropped packets

2 years agodetect: update/document drop flow logic
Victor Julien [Wed, 31 May 2023 13:49:57 +0000 (15:49 +0200)] 
detect: update/document drop flow logic

Now that flow drop is applied to packets before other processing,
no drop has to be issued on a packet.

2 years agoflow: apply flow to packet on flow lookup
Victor Julien [Wed, 31 May 2023 13:45:40 +0000 (15:45 +0200)] 
flow: apply flow to packet on flow lookup

Issue drop to packet as early as possible.

2 years agohttp: logs custom headers in a subobject
Philippe Antoine [Tue, 14 Jun 2022 07:29:04 +0000 (09:29 +0200)] 
http: logs custom headers in a subobject

This subobject is request_headers or response_headers

This especially avoids json keys collisions.

Ticket: #5320

Also fixes typo referrer/referer

2 years agogithub-ci: add workflow_dispatch
Jason Ish [Fri, 12 May 2023 15:41:27 +0000 (09:41 -0600)] 
github-ci: add workflow_dispatch

A workflow dispatch allows us to manually a trigger a workflow with
arguments. This dispatch allows us to use the "gh" cli command to
trigger a workflow run with our libhtp/su/sv branch and repo variables
set. For example:

  gh run builds.yml -f SV_REPO=jasonish/suricata-verify -f SV_BRANCH=pr/10

2 years agoflow: spare pool return optimization 8945/head
Victor Julien [Mon, 29 May 2023 12:05:38 +0000 (14:05 +0200)] 
flow: spare pool return optimization

In case small blocks of flows are returned, try to merge
them with existing small list head. Add full block as second
in the list as with the rest of the code.

2 years agoflow/worker: don't double count flow.wrk.flows_evicted
Victor Julien [Mon, 29 May 2023 06:42:46 +0000 (08:42 +0200)] 
flow/worker: don't double count flow.wrk.flows_evicted

Since the queue isn't fully processed every run, double counting
could happen.

Fix by only counting actually processed flows from the queue.

2 years agoflow/worker: batch return flows to spare pool
Victor Julien [Sat, 27 May 2023 16:02:15 +0000 (18:02 +0200)] 
flow/worker: batch return flows to spare pool

2 years agoflow/manager: minor code cleanup
Victor Julien [Sat, 27 May 2023 05:40:43 +0000 (07:40 +0200)] 
flow/manager: minor code cleanup

2 years agoflow/recycler: batch returns to spare pool
Victor Julien [Fri, 26 May 2023 13:17:10 +0000 (15:17 +0200)] 
flow/recycler: batch returns to spare pool

To reduce locking overhead in the spare pool, batch returns per
100 (spare pool block size).

2 years agoflow/recycler: stats micro optimization
Victor Julien [Fri, 26 May 2023 10:16:04 +0000 (12:16 +0200)] 
flow/recycler: stats micro optimization

Don't update stat from loop as it's not read until after the loop.

2 years agomqtt: fix quadratic complexity
Philippe Antoine [Tue, 30 May 2023 10:08:25 +0000 (12:08 +0200)] 
mqtt: fix quadratic complexity

get_tx_by_pkt_id loops only over the last transactions
in case there is a transaction flood

Ticket: #6100

2 years agomqtt: rustfmt mqtt.rs
Haleema Khan [Mon, 30 Jan 2023 14:24:05 +0000 (19:24 +0500)] 
mqtt: rustfmt mqtt.rs

2 years agomqtt: add mqtt frames
Haleema Khan [Fri, 13 Jan 2023 12:25:37 +0000 (17:25 +0500)] 
mqtt: add mqtt frames

Adds PDU, Header and Data frame to the MQTT parser.
Ticket: 5731

2 years agowindivert: fix compile warnings
Victor Julien [Mon, 29 May 2023 17:00:36 +0000 (19:00 +0200)] 
windivert: fix compile warnings

2 years agodoc/userguide: document include files
Jason Ish [Wed, 24 May 2023 19:18:21 +0000 (13:18 -0600)] 
doc/userguide: document include files

Document how to use include files, plus add a deprecation notice on
the use of multiple "include" statements.

2 years agodoc/userguide: merge logging changes in 7.0 upgrade notes
Jason Ish [Wed, 24 May 2023 19:15:55 +0000 (13:15 -0600)] 
doc/userguide: merge logging changes in 7.0 upgrade notes

Two "Logging changes" sections existed, merge.

2 years agosuricata.yaml: use include list for example
Jason Ish [Wed, 24 May 2023 18:24:24 +0000 (12:24 -0600)] 
suricata.yaml: use include list for example

For 7.0 multiple includes are allowed, but marked as
deprecated. Update the example to show the new way of pulling in
multiple includes.

2 years agodocs: update url to docs.suricata.io
Jason Ish [Thu, 25 May 2023 19:21:11 +0000 (13:21 -0600)] 
docs: update url to docs.suricata.io

2 years agojsonbuilder: check buffer growth
Jason Ish [Wed, 24 May 2023 23:05:34 +0000 (17:05 -0600)] 
jsonbuilder: check buffer growth

Use try_reserve before growing the internal buffer, and the internal
state vector. This allows allocation errors to be caught and an error
returned instead of just aborting the process.

Ticket: #6057

2 years agojsonbuilder: rustfmt
Jason Ish [Sun, 7 May 2023 21:54:55 +0000 (15:54 -0600)] 
jsonbuilder: rustfmt

Some very minor changes to formatting.

2 years agodetect/analyzer: add the type
Victor Julien [Wed, 24 May 2023 13:28:49 +0000 (15:28 +0200)] 
detect/analyzer: add the type

Per rule type record properties of the type.

Example output:

    {
        "raw": "alert udp any any -> any any (msg:\"UDP with flow direction\"; flow:to_server; sid:1001;)",
        "id": 1001,
        "gid": 1,
        "rev": 0,
        "msg": "UDP with flow direction",
        "app_proto": "unknown",
        "requirements": [],
        "type": "pkt",
        "flags": [
            "src_any",
            "dst_any",
            "sp_any",
            "dp_any",
            "toserver"
        ],
        "pkt_engines": [],
        "frame_engines": [],
        "lists": {}
    }

Ticket: #6085.

2 years agodetect: use explicit rule types
Victor Julien [Wed, 24 May 2023 08:44:45 +0000 (10:44 +0200)] 
detect: use explicit rule types

Instead of using flags to indicate a rule type, use an explicit `type`
field.

This will make it more clean in code paths what paths a rule is taking,
and will allow easier debugging as well as analyzer output.

Define the following fields:

- SIG_TYPE_IPONLY: sig meets IP-only criteria and is handled by the IP-only
  engine.
- SIG_TYPE_PDONLY: sig inspects protocol detection results only.
- SIG_TYPE_DEONLY: sig inspects decoder events only.
- SIG_TYPE_PKT:    sig is inspected per packet.
- SIG_TYPE_PKT_STREAM: sig is inspected against either packet payload or
  stream payload.
- SIG_TYPE_STREAM: sig is inspected against the reassembled stream
- SIG_TYPE_APPLAYER: sig is inspected against an app-layer property, but not
  against a tx engine.
- SIG_TYPE_APP_TX: sig is inspected the tx aware inspection engine(s).

Ticket: #6085.

2 years agodetect/pcre: remove redundant applayer flag set
Victor Julien [Tue, 2 Aug 2022 08:56:30 +0000 (10:56 +0200)] 
detect/pcre: remove redundant applayer flag set

2 years agodetect: minor cleanup
Victor Julien [Fri, 29 Jul 2022 09:15:03 +0000 (11:15 +0200)] 
detect: minor cleanup

2 years agohttp: fix leak of normailzed uri 8918/head
Philippe Antoine [Tue, 23 May 2023 12:15:51 +0000 (14:15 +0200)] 
http: fix leak of normailzed uri

if tx_ud == NULL, still need to free alloced normailzed uri

2 years agorust: use 2021 edition 8907/head
Jason Ish [Mon, 22 May 2023 04:01:10 +0000 (22:01 -0600)] 
rust: use 2021 edition

With the MSRV being bumped to 1.62 for 7.0, we can move the edition up
to 2021.

2 years agostreaming: minor guards cleanup 8904/head
Victor Julien [Sat, 20 May 2023 19:51:50 +0000 (21:51 +0200)] 
streaming: minor guards cleanup

2 years agostreaming: fix region buf_offset update
Victor Julien [Sat, 20 May 2023 19:43:57 +0000 (21:43 +0200)] 
streaming: fix region buf_offset update

If region wasn't the first region, the buf_offset could get out of
sync.

Bug: #6041.

2 years agostreaming: stricter validation check
Victor Julien [Sat, 20 May 2023 19:16:33 +0000 (21:16 +0200)] 
streaming: stricter validation check

2 years agostreaming: fix intersect detection
Victor Julien [Sat, 20 May 2023 05:05:16 +0000 (07:05 +0200)] 
streaming: fix intersect detection

Update logic to always use data right edge.

Bug: #5834.

2 years agogithub: change codeowners back to team
Philippe Antoine [Thu, 18 May 2023 09:51:24 +0000 (11:51 +0200)] 
github: change codeowners back to team

as in master-6.0.x

2 years agofuzz: make targets more resitant to allocation failures 8891/head
Philippe Antoine [Wed, 17 May 2023 12:33:16 +0000 (14:33 +0200)] 
fuzz: make targets more resitant to allocation failures

2 years agoflowworker: simplify pseudo packet use 8888/head
Victor Julien [Mon, 15 May 2023 08:02:26 +0000 (10:02 +0200)] 
flowworker: simplify pseudo packet use

Pseudo packets originating in the flow worker do not need to leave the
flow worker. Putting those in the ThreadVars::decode_pq will make them
be evaluated by the next steps in the pipeline, but those will all
ignore pseudo packets.

Instead, this patch returns them to the packet pool, while still honoring
the IPS verdict logic.

2 years agoall: remove unused literals
Philippe Antoine [Fri, 7 Apr 2023 16:02:02 +0000 (18:02 +0200)] 
all: remove unused literals

2 years agorust/doc: restore comment with code example, but ignore 8879/head
Jason Ish [Fri, 12 May 2023 14:59:54 +0000 (08:59 -0600)] 
rust/doc: restore comment with code example, but ignore

Use backticks for proper markdown processing. As Rust code in
backticks is compiled, and this is a non-complete example, tag the
code sample to be ignored.

2 years agogithub-ci: check for new authors in pull-request
Jason Ish [Tue, 9 May 2023 20:42:30 +0000 (14:42 -0600)] 
github-ci: check for new authors in pull-request

On pull request, get a list of commit authors for the pull request and
compare to the list of authors in git master. If any differ, save to
new-authors.txt and upload this as an artifact.

As a workflow-run, download this artifact and if non-empty, add a
comment to the pull-request that new authors may be part of the pull
request.

This 2 step approach is because GitHub actions running in pull-request
context are not allowed to comment on the pull request, instead a
post-workflow workflow has been added that runs in the context of the
repo which can then comment on the pull request.

2 years agoprofiling/rules: minor fatal error cleanup
Victor Julien [Fri, 12 May 2023 14:05:20 +0000 (16:05 +0200)] 
profiling/rules: minor fatal error cleanup

2 years agoprofiling/rules: add BUG_ON to profile tracking
Victor Julien [Fri, 12 May 2023 12:21:37 +0000 (14:21 +0200)] 
profiling/rules: add BUG_ON to profile tracking

2 years agoprofiling/rules: simplify return code handling
Victor Julien [Fri, 12 May 2023 12:12:19 +0000 (14:12 +0200)] 
profiling/rules: simplify return code handling

2 years agoprofiling/rules: minor code cleanup
Victor Julien [Fri, 12 May 2023 12:09:10 +0000 (14:09 +0200)] 
profiling/rules: minor code cleanup

2 years agoprofiling/rules: use atomics for rule flag
Victor Julien [Fri, 12 May 2023 12:08:44 +0000 (14:08 +0200)] 
profiling/rules: use atomics for rule flag

2 years agoprofiling/rules: doc updates
Victor Julien [Fri, 12 May 2023 11:59:10 +0000 (13:59 +0200)] 
profiling/rules: doc updates

2 years agoprofiling/rules: reduce sync logic scope
Victor Julien [Fri, 12 May 2023 11:56:51 +0000 (13:56 +0200)] 
profiling/rules: reduce sync logic scope

Use a simple once a second scheme.

2 years agodoc: add rule profiling information
Eric Leblond [Fri, 11 Nov 2022 13:37:12 +0000 (14:37 +0100)] 
doc: add rule profiling information

2 years agoprofiling: socket command to control rules profiling
Eric Leblond [Mon, 15 Nov 2021 06:40:32 +0000 (07:40 +0100)] 
profiling: socket command to control rules profiling

This patch adds unix socket command to start and stop the collection
of stats when running in rules profiling mode.

2 years agoprofiling: set sample rate to power of 2
Eric Leblond [Thu, 26 Aug 2021 16:11:42 +0000 (18:11 +0200)] 
profiling: set sample rate to power of 2

For the rules profiling, we really want to limit the performance
impact to the maximum. So let's use an hash size that is a power
of 2. This will allow to not use the modulo operation that is
costly and simply use a single binary operator.

This code is only active for rules profiling so we are backward
compatible.

2 years agoprofiling: let 'ruleset-profile' send message
Eric Leblond [Mon, 23 Aug 2021 19:29:24 +0000 (21:29 +0200)] 
profiling: let 'ruleset-profile' send message

Let's send the profile output as an answer on the Unix socket.

2 years agoprofiling: add 'ruleset-profile' unix command
Eric Leblond [Fri, 11 Nov 2022 13:40:27 +0000 (14:40 +0100)] 
profiling: add 'ruleset-profile' unix command

This patch adds a new unix command that allows the user to trigger
a dump of the ruleset profile to the file without having to stop
Suricata.

This will be really useful to debug performance issue related to
signatures in production environment.

2 years agoprofiling: introduce rules profiling
Eric Leblond [Sun, 22 Aug 2021 21:55:42 +0000 (23:55 +0200)] 
profiling: introduce rules profiling

Performance measurement of rules is important on live Suricata
as bad rules can cause severe performance regression. This patch
introduces the --enable-profiling-rules that activate profiling
for the rules. This reduces the performance impact of full
profiling  and provide visiblity on the rules performance at
the same time.

2 years agodetect: http_client_body for HTTP2
Philippe Antoine [Mon, 3 Apr 2023 08:09:25 +0000 (10:09 +0200)] 
detect: http_client_body for HTTP2

By using the file.data logic

Ticket: #4067