]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
15 months agoci: clean some disk space to run CIFuzz again 10821/head
Philippe Antoine [Fri, 12 Apr 2024 08:32:46 +0000 (10:32 +0200)] 
ci: clean some disk space to run CIFuzz again

15 months agocargo: add description and license
Jason Ish [Fri, 12 Apr 2024 04:34:16 +0000 (22:34 -0600)] 
cargo: add description and license

Required for publishing to crates.io.

15 months agoautomake/rust: remove path.lib
Jason Ish [Fri, 12 Apr 2024 03:29:50 +0000 (21:29 -0600)] 
automake/rust: remove path.lib

Remove the path.lib parameter that is substituted into the output
Cargo.toml by autoconf. Instead, as part of the build, "cd" into the
source directory. We already set the Rust target directory to the
external build directory.

This makes the Cargo.toml more generic, and in a format suitable for
publishing to crates.io. It also makes it easier to pull in external
crates without needing to patch up their Cargo.toml, for example, it
might make pulling libhtp-rs easier.

15 months agoalert/syslog: fetch ipproto once
Victor Julien [Fri, 22 Mar 2024 10:53:52 +0000 (11:53 +0100)] 
alert/syslog: fetch ipproto once

15 months agoalert/syslog: stringify addresses outside alert loop
Victor Julien [Fri, 22 Mar 2024 10:19:47 +0000 (11:19 +0100)] 
alert/syslog: stringify addresses outside alert loop

15 months agoalert/syslog: minor code cleanups
Victor Julien [Fri, 22 Mar 2024 10:17:39 +0000 (11:17 +0100)] 
alert/syslog: minor code cleanups

15 months agoalert/syslog: only hold lock for syslog call
Victor Julien [Fri, 22 Mar 2024 10:11:40 +0000 (11:11 +0100)] 
alert/syslog: only hold lock for syslog call

15 months agolog/stats: allow longer counter names 10805/head
Juliana Fajardini [Mon, 8 Apr 2024 15:30:27 +0000 (12:30 -0300)] 
log/stats: allow longer counter names

With the addition of exception policy stats counters, the human readable
version of the sats log was mis-aligned, when counters for per-app-proto
were enabled.

Width change made large enough to accomodate a counter as long as
"app_layer.error.bittorrent-dht.exception_policy.pass_packet" which
could be valid.

Task #5816

15 months agoyaml: minor wording fix on Suricata package version
Juliana Fajardini [Wed, 3 Apr 2024 01:21:18 +0000 (22:21 -0300)] 
yaml: minor wording fix on Suricata package version

15 months agoyaml: explicitly mention exception policy in conf
Juliana Fajardini [Mon, 1 Apr 2024 21:09:59 +0000 (18:09 -0300)] 
yaml: explicitly mention exception policy in conf

While our documentation indicated what were the possible configuration
settings for exception policies, our yaml only explicitly mentioned
exception policy for the master switch. Clearly indicate which config
settings are about exception policies.

Related to
Task #5816

15 months agouserguide: document exception policy stats
Juliana Fajardini [Thu, 4 Apr 2024 13:58:12 +0000 (10:58 -0300)] 
userguide: document exception policy stats

Configuration options and defaults, existing counters etc.

Related to
Task #5816

15 months agouserguide: highlight exception policy effects
Juliana Fajardini [Thu, 1 Feb 2024 23:25:33 +0000 (20:25 -0300)] 
userguide: highlight exception policy effects

Some exception policies can only be applied to entire flows or
individual packets, for some exception scenarios. Make this easier to
read, in the documentation.

Related to
Task #5816

15 months agostream/midstream: add counter for exception policy
Juliana Fajardini [Wed, 22 Mar 2023 19:04:50 +0000 (16:04 -0300)] 
stream/midstream: add counter for exception policy

Add stats counters for when there is an exception policy applied in case
of a session picked up midstream.

Task #5816

15 months agostream/reassemble: add exception policy counters
Juliana Fajardini [Tue, 21 Mar 2023 21:15:57 +0000 (18:15 -0300)] 
stream/reassemble: add exception policy counters

Add stats counters for exception policies applied in case of memcap hit
during stream reassembly.

Task #5816

15 months agostream/tcp: add ssnmemcap exception policy counter
Juliana Fajardini [Wed, 22 Mar 2023 15:04:58 +0000 (12:04 -0300)] 
stream/tcp: add ssnmemcap exception policy counter

Add stats counters for exception policies applied in case a stream
session memcap is hit.

Task #5816

15 months agoapplayer: add stats counters for exception errors
Juliana Fajardini [Mon, 26 Feb 2024 19:23:14 +0000 (16:23 -0300)] 
applayer: add stats counters for exception errors

Add stats counters for exception policy are applied for app-layer errors

Part of
Task #5816

15 months agodefrag: add exception policy memcap stats counters
Juliana Fajardini [Thu, 30 Mar 2023 19:53:01 +0000 (16:53 -0300)] 
defrag: add exception policy memcap stats counters

Add defrag memcap stats counter.

Task #5816

15 months agodecode/flow: add exception policy stats counters
Juliana Fajardini [Tue, 11 Apr 2023 18:36:48 +0000 (15:36 -0300)] 
decode/flow: add exception policy stats counters

We will register stats counters for all policies, even though for now
Suri only uses one possible configuration policy at a time. The idea is
that this could change in the near future, so we want to have this
ready.

Task #5816

15 months agoexceptions: make types and ToStr fns more accessible
Juliana Fajardini [Sun, 11 Feb 2024 21:47:31 +0000 (18:47 -0300)] 
exceptions: make types and ToStr fns more accessible

Decode file needed ExceptionPolicy types and exception-policy file
needed Decode types, rendering some works quite difficult to work
around.

ExceptionPolicyToStr is useful for registering exception policy
counters, so make that public.

Part of
Task #5816

15 months agoschema: apply clang formatting changes
Juliana Fajardini [Mon, 26 Feb 2024 19:43:25 +0000 (16:43 -0300)] 
schema: apply clang formatting changes

15 months agoapp-layer/htp: clean up unused code in unittests 10800/head 10803/head
Juliana Fajardini [Wed, 10 Apr 2024 22:09:52 +0000 (19:09 -0300)] 
app-layer/htp: clean up unused code in unittests

Remove unit test that was disabled and printf statements that were
replaced but not deleted, both in 48cf0585fb69c9bad71237.

15 months agoapp-layer: fix minor typo and formatting in LogInfo
Juliana Fajardini [Wed, 10 Apr 2024 21:38:14 +0000 (18:38 -0300)] 
app-layer: fix minor typo and formatting in LogInfo

Also update copyright years.

15 months agodetect/analyzer: add more details for tcp_seq 10795/head
Daniel Olatunji [Tue, 30 Jan 2024 17:30:37 +0000 (18:30 +0100)] 
detect/analyzer: add more details for tcp_seq

Log the matched Sequence number of a packet
Issue: 6353

15 months agodpdk: implement DPDK SW tests
Lukas Sismis [Sun, 24 Mar 2024 06:34:50 +0000 (07:34 +0100)] 
dpdk: implement DPDK SW tests

Implement Github CI tests to run DPDK Suri with the minimal
configuration to verify that Suricata can start in both IDS
and IPS configuration.

15 months agodpdk: fix thread slot assignment
Lukas Sismis [Sat, 23 Mar 2024 22:11:16 +0000 (23:11 +0100)] 
dpdk: fix thread slot assignment

Commit 5592ec07 introduced a bug where ptv->slot was
assigned with the current one instead of the next one
in the list. This caused a Suricata crash in the DPDK mode.

Ticket: 6877

15 months agodpdk: make static variables thread_local
Lukas Sismis [Sat, 23 Mar 2024 22:10:41 +0000 (23:10 +0100)] 
dpdk: make static variables thread_local

Per a newly obtained knowledge, static variables in functions
are not thread-safe and as a result thread_local attribute was
added.

15 months agoci: bump up the DPDK versions
Lukas Sismis [Thu, 21 Mar 2024 12:52:20 +0000 (13:52 +0100)] 
ci: bump up the DPDK versions

15 months agodoc: update http keyword listing order
jason taylor [Fri, 8 Mar 2024 00:42:27 +0000 (00:42 +0000)] 
doc: update http keyword listing order

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update file.name keyword information
jason taylor [Tue, 6 Feb 2024 17:27:09 +0000 (17:27 +0000)] 
doc: update file.name keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update file.data keyword information
jason taylor [Mon, 5 Feb 2024 22:33:49 +0000 (22:33 +0000)] 
doc: update file.data keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.response_header keyword
jason taylor [Mon, 5 Feb 2024 21:55:48 +0000 (21:55 +0000)] 
doc: update http.response_header keyword

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.request_header keyword
jason taylor [Mon, 5 Feb 2024 21:46:59 +0000 (21:46 +0000)] 
doc: update http.request_header keyword

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.host http.host.raw keyword
jason taylor [Sat, 3 Feb 2024 18:31:49 +0000 (18:31 +0000)] 
doc: update http.host http.host.raw keyword

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.location keyword information
jason taylor [Sat, 3 Feb 2024 16:08:59 +0000 (16:08 +0000)] 
doc: update http.location keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.server keyword information
jason taylor [Sat, 3 Feb 2024 16:03:23 +0000 (16:03 +0000)] 
doc: update http.server keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.response_body keyword information
jason taylor [Sat, 3 Feb 2024 15:58:07 +0000 (15:58 +0000)] 
doc: update http.response_body keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.response_line keyword information
jason taylor [Sat, 3 Feb 2024 15:48:25 +0000 (15:48 +0000)] 
doc: update http.response_line keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.stat_msg keyword information
jason taylor [Sat, 3 Feb 2024 15:26:29 +0000 (15:26 +0000)] 
doc: update http.stat_msg keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.stat_code keyword information
jason taylor [Sat, 3 Feb 2024 15:23:52 +0000 (15:23 +0000)] 
doc: update http.stat_code keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.request_body keyword information
jason taylor [Sat, 3 Feb 2024 15:14:24 +0000 (15:14 +0000)] 
doc: update http.request_body keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.header_names keyword information
jason taylor [Thu, 1 Feb 2024 22:39:12 +0000 (22:39 +0000)] 
doc: update http.header_names keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.start keyword information
jason taylor [Wed, 31 Jan 2024 22:48:18 +0000 (22:48 +0000)] 
doc: update http.start keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.referer keyword information
jason taylor [Wed, 31 Jan 2024 22:33:01 +0000 (22:33 +0000)] 
doc: update http.referer keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.content_len keyword information
jason taylor [Wed, 31 Jan 2024 20:08:58 +0000 (20:08 +0000)] 
doc: update http.content_len keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.content_type keyword information
jason taylor [Wed, 31 Jan 2024 19:47:07 +0000 (19:47 +0000)] 
doc: update http.content_type keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.connection keyword information
jason taylor [Wed, 31 Jan 2024 19:30:51 +0000 (19:30 +0000)] 
doc: update http.connection keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.accept_lang keyword information
jason taylor [Tue, 9 Jan 2024 22:42:15 +0000 (22:42 +0000)] 
doc: update http.accept_lang keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.accept_enc keyword information
jason taylor [Tue, 9 Jan 2024 22:25:15 +0000 (22:25 +0000)] 
doc: update http.accept_enc keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http keyword normalization notes
jason taylor [Tue, 9 Jan 2024 22:15:48 +0000 (22:15 +0000)] 
doc: update http keyword normalization notes

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.accept keyword information
jason taylor [Tue, 9 Jan 2024 21:53:52 +0000 (21:53 +0000)] 
doc: update http.accept keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.user_agent keyword
jason taylor [Fri, 5 Jan 2024 22:06:47 +0000 (22:06 +0000)] 
doc: update http.user_agent keyword

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.cookie keyword information
jason taylor [Wed, 3 Jan 2024 22:04:23 +0000 (22:04 +0000)] 
doc: update http.cookie keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodetect: minor http.cookie keyword typo fix
jason taylor [Wed, 3 Jan 2024 21:57:33 +0000 (21:57 +0000)] 
detect: minor http.cookie keyword typo fix

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.header keyword information
jason taylor [Tue, 2 Jan 2024 22:07:08 +0000 (22:07 +0000)] 
doc: update http.header keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: remove legacy description/duplicated data
jason taylor [Tue, 2 Jan 2024 21:07:54 +0000 (21:07 +0000)] 
doc: remove legacy description/duplicated data

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.request_line keyword information
jason taylor [Tue, 2 Jan 2024 21:04:03 +0000 (21:04 +0000)] 
doc: update http.request_line keyword information

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.protocol keyword documentation
jason taylor [Tue, 2 Jan 2024 21:00:09 +0000 (21:00 +0000)] 
doc: update http.protocol keyword documentation

Ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update urilen keyword documentation
jason taylor [Fri, 29 Dec 2023 12:04:58 +0000 (12:04 +0000)] 
doc: update urilen keyword documentation

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: remove legacy uricontent information
jason taylor [Fri, 29 Dec 2023 11:59:29 +0000 (11:59 +0000)] 
doc: remove legacy uricontent information

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.uri and http.uri.raw keywords
jason taylor [Fri, 29 Dec 2023 11:57:18 +0000 (11:57 +0000)] 
doc: update http.uri and http.uri.raw keywords

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http.method keyword
jason taylor [Fri, 29 Dec 2023 11:50:02 +0000 (11:50 +0000)] 
doc: update http.method keyword

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: add http keyword links
jason taylor [Fri, 29 Dec 2023 11:45:03 +0000 (11:45 +0000)] 
doc: add http keyword links

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: update http primer information
jason taylor [Fri, 29 Dec 2023 11:24:01 +0000 (11:24 +0000)] 
doc: update http primer information

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agodoc: remove legacy tables and image references
jason taylor [Fri, 29 Dec 2023 10:46:32 +0000 (10:46 +0000)] 
doc: remove legacy tables and image references

ticket: 3025

Signed-off-by: jason taylor <jtfas90@gmail.com>
15 months agosystemd: reimplement sd_notify logic using UNIX socket 10790/head
Victor Julien [Wed, 3 Apr 2024 08:51:21 +0000 (10:51 +0200)] 
systemd: reimplement sd_notify logic using UNIX socket

One of the lessons of the XZ backdoor story was that just linking to
libsystemd to call sd_notify is discouraged by the systemd project:

Lennart Poettering:
"PSA: In context of the xzpocalypse we now added an example reimplementation
of sd_notify() to our man page:

https://www.freedesktop.org/software/systemd/man/devel/sd_notify.html#Notes

It's pretty comprehensive (i.e. uses it for reload notification too), but
still relatively short.

In the past, I have been telling anyone who wanted to listen that if all you
want is sd_notify() then don't bother linking to libsystemd, since the
protocol is stable and should be considered the API, not our C wrapper
around it. After all, the protocol is so trivial"

From: https://mastodon.social/@pid_eins/112202687764571433

This commit takes the example code and uses it to reimplement the notify
logic.

The code is enabled if Linux is detected in configure. Since the code
won't do anything if the NOTIFY_SOCKET env var isn't set, this should
also work fine on systems w/o systemd.

Ticket: #6913.

15 months agodetect/analyzer: add more details for the tcp ack keyword
Daniel Olatunji [Sat, 27 Jan 2024 13:28:02 +0000 (14:28 +0100)] 
detect/analyzer: add more details for the tcp ack keyword

Issue: 6354
Added the DETECT_ACK case to detect-engine-analyzer.c

15 months agodecode: don't clear computed csums twice 10783/head
Victor Julien [Fri, 22 Mar 2024 09:02:16 +0000 (10:02 +0100)] 
decode: don't clear computed csums twice

Already done in a generic way by PACKET_RESET_CHECKSUMS.

15 months agodecode/ipv4: remove unused field
Victor Julien [Fri, 22 Mar 2024 08:44:59 +0000 (09:44 +0100)] 
decode/ipv4: remove unused field

15 months agooutput/eve: constify mac address logic
Victor Julien [Tue, 2 Apr 2024 08:18:10 +0000 (10:18 +0200)] 
output/eve: constify mac address logic

15 months agomacset: constify addr parameters
Victor Julien [Tue, 2 Apr 2024 08:09:08 +0000 (10:09 +0200)] 
macset: constify addr parameters

15 months agodecode/udp: no need to pack the structure
Victor Julien [Thu, 4 Apr 2024 07:26:11 +0000 (09:26 +0200)] 
decode/udp: no need to pack the structure

15 months agodecode/tcp: no need to pack the structure
Victor Julien [Thu, 4 Apr 2024 07:00:32 +0000 (09:00 +0200)] 
decode/tcp: no need to pack the structure

15 months agodecode/icmpv4: no need to pack the structure
Victor Julien [Thu, 4 Apr 2024 07:00:03 +0000 (09:00 +0200)] 
decode/icmpv4: no need to pack the structure

15 months agoconfigure: tabs to spaces; minor reformatting
Victor Julien [Tue, 2 Apr 2024 09:39:47 +0000 (11:39 +0200)] 
configure: tabs to spaces; minor reformatting

15 months agounittests: don't set ports for non-port proto
Victor Julien [Sun, 31 Mar 2024 19:13:40 +0000 (21:13 +0200)] 
unittests: don't set ports for non-port proto

15 months agodetect/http: fix compile warning in body tests
Victor Julien [Thu, 28 Mar 2024 09:43:46 +0000 (10:43 +0100)] 
detect/http: fix compile warning in body tests

When --enable-unittests w/o --enable-debug is used.

15 months agodetect/ipproto: clean up test
Victor Julien [Tue, 26 Mar 2024 08:55:58 +0000 (09:55 +0100)] 
detect/ipproto: clean up test

15 months agodetect/fragbits: remove unused IP header struct from tests
Victor Julien [Tue, 26 Mar 2024 08:54:22 +0000 (09:54 +0100)] 
detect/fragbits: remove unused IP header struct from tests

15 months agodefrag: test cleanups and fixes
Victor Julien [Tue, 26 Mar 2024 08:50:22 +0000 (09:50 +0100)] 
defrag: test cleanups and fixes

Pass tv and dtv to make sure reassembled packet is decoded.

15 months agodecode/icmpv6: minor test cleanup
Victor Julien [Mon, 25 Mar 2024 20:53:43 +0000 (21:53 +0100)] 
decode/icmpv6: minor test cleanup

15 months agodetect/dsize: remove unused ip6h from test
Victor Julien [Mon, 25 Mar 2024 18:47:52 +0000 (19:47 +0100)] 
detect/dsize: remove unused ip6h from test

15 months agoconfigure: .git can be a file as well
Jason Ish [Fri, 5 Apr 2024 16:33:14 +0000 (10:33 -0600)] 
configure: .git can be a file as well

In worktree scenarios, .git is a file. Assuming its a directory causes
the release date to check the ChangeLog instead of the last commit,
while not a big issue, can be confusing.

16 months agojsonbuilder: fix serialization of nan and inf 10774/head
Jason Ish [Fri, 5 Apr 2024 14:35:36 +0000 (08:35 -0600)] 
jsonbuilder: fix serialization of nan and inf

When outputting a float, check if its infinity, or not a number and
output a null instead.

Using a null was chosen as this is what serde_yaml, Firefox, Chrome,
Node, etc. do.

Ticket: #6921

16 months agohost-info: remove pcre2_substring_list_free use 10768/head
Victor Julien [Thu, 4 Apr 2024 15:51:48 +0000 (17:51 +0200)] 
host-info: remove pcre2_substring_list_free use

Function prototype has changed in a recent release. Rather than dealing
with detecting that, fall back to our regular pattern of using
pcre2_substring_copy_bynumber().

Bug: #6918.

16 months agogithub-actions: bump github/codeql-action from 3.24.6 to 3.24.9
dependabot[bot] [Mon, 1 Apr 2024 19:39:26 +0000 (19:39 +0000)] 
github-actions: bump github/codeql-action from 3.24.6 to 3.24.9

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.6 to 3.24.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.6...v3.24.9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
16 months agogithub-ci: set checkout directory as safe before running git commands 10767/head
Jason Ish [Tue, 2 Apr 2024 17:04:08 +0000 (11:04 -0600)] 
github-ci: set checkout directory as safe before running git commands

While the checkout job appears to do this, it is done with a different
version of git which seems to be the cause for it not having an effect
when doing manual git operations from within a job.

Also removes duplicate checkout statements in Windows builds.

16 months agoconfigure: export release date for documentation
Jason Ish [Mon, 1 Apr 2024 16:37:49 +0000 (10:37 -0600)] 
configure: export release date for documentation

Sphinx embeds a date in the generated man pages, and to provide
reproducible builds this date needs to be provided to Sphinx,
otherwise it will use the current date.

If building from Git, extract the date from the most recent commit. In
a release, this commit would be the commit that sets the version so is
accurate.

If .git does not exist, use the most recent data found in the
ChangeLog.

The ChangeLog is not used when building from git, as the main/master
branch may not have recent enough timestamps.

This should provide a consistent date when re-building the
distribution from the same non-git archive, or from the same git
commit.

Ticket: #6911

16 months agodocs/userguide: use a consistent date for reproducible builds
Jason Ish [Mon, 1 Apr 2024 16:35:39 +0000 (10:35 -0600)] 
docs/userguide: use a consistent date for reproducible builds

By default, when Sphinx generates the man pages, the current date will
be embedded in them. This can be set to a specific date with the
"today" variable. Typically the date embedded in manpages in the
release date.

To achieve this, attempt to use the environment variable, RELEASE_DATE
to set the "today" variable, reverting back to the empty string if not
set. It is up to our build system to properly set this date.

Ticket: #6911

16 months agoconfigure: don't check ./revision, it never exists
Jason Ish [Tue, 2 Apr 2024 15:41:08 +0000 (09:41 -0600)] 
configure: don't check ./revision, it never exists

Stop checking the ./revision file for the git revision info, its never
created.

16 months agodocs/conf.py: fix python escape warning
Jason Ish [Mon, 1 Apr 2024 16:34:45 +0000 (10:34 -0600)] 
docs/conf.py: fix python escape warning

/home/jason/oisf/dev/suricata/master/doc/userguide/conf.py:74: SyntaxWarning: invalid escape sequence '\('
  "AC_INIT\(\[suricata\],\s*\[(.*)?\]\)",

16 months agogithub-actions: bump codecov/codecov-action from 4.1.0 to 4.1.1 10745/head
dependabot[bot] [Mon, 1 Apr 2024 19:38:51 +0000 (19:38 +0000)] 
github-actions: bump codecov/codecov-action from 4.1.0 to 4.1.1

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/54bcd8715eee62d40e33596ef5e8f0f48dbbccab...c16abc29c95fcf9174b58eb7e1abf4c866893bc8)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
16 months agosip: convert transaction list to vecdeque 10720/head
Philippe Antoine [Sun, 24 Mar 2024 20:31:22 +0000 (21:31 +0100)] 
sip: convert transaction list to vecdeque

Ticket: 6891

So as to avoid quadratic complexity on tx cleanup with SIP/TCP
that can create many transactions in one go.

16 months agodetect/port: handle range and upper boundary ports
Shivani Bhardwaj [Mon, 25 Mar 2024 13:38:31 +0000 (19:08 +0530)] 
detect/port: handle range and upper boundary ports

So far, if a port was found to be single which was earlier a part of the
range, port + 1 was added to the list to honor the range that it was a
part of. But, this is incorrect in case the port is 65535 or if the port
was found to be of range when it was earlier a single port.

Bug 6896

16 months agoexamples/capture: fix the slot
Jason Ish [Fri, 22 Mar 2024 19:47:11 +0000 (13:47 -0600)] 
examples/capture: fix the slot

Use slot->slot_next, not the slot as passed in.

16 months agosuricata: expose and break out configuration loading
Jason Ish [Mon, 4 Mar 2024 23:08:08 +0000 (17:08 -0600)] 
suricata: expose and break out configuration loading

Expose LoadYamlConfig as SCLoadYamlConfig and remove it from
SuricataInit. This is required to allow the library user the ability
customize the loading of the configuration, for example doing some
programmatic configuration then loading a configuration file.

16 months agosmtp: fix configuration node creation
Jason Ish [Mon, 4 Mar 2024 21:59:09 +0000 (15:59 -0600)] 
smtp: fix configuration node creation

A configuration sequence node needs to have name, which is just its
index in the sequence.

Discovered by calling ConfDump() after Suricata was fully initialized.

16 months agosuricata: move SuricataMain into main()
Jason Ish [Mon, 26 Feb 2024 22:45:07 +0000 (16:45 -0600)] 
suricata: move SuricataMain into main()

Move the contents of SuricataMain into the `main()` function found in
main.c. This forces the Suricata application to bootstrap and run
Suricata through the same interfaces as a library user might do.

Required exposing StartInternalRunMode as SCStartInternalRunmode. Its
arguable whether those "actions" belong in the library or just the
application, but I think that is separation we can look at later.

For now the lib example and Suricata's own main are the same, however
the example will probably extend more into programmatically
configuring Suricata or dynamically registering a runmode, which
doesn't really belong the main Suricata application.

16 months agosuricata: expose FinalizeRunMode and ParseCommandLine
Jason Ish [Mon, 26 Feb 2024 22:29:25 +0000 (16:29 -0600)] 
suricata: expose FinalizeRunMode and ParseCommandLine

Expose the functions FinalizeRunMode and ParseCommandLine to library
users, renaming with the `SC` prefix in the process.

This involves moving "application" level details from SuricataInit
into SuricataMain, as parsing command line options should be opt-in
for a library user.

16 months agowindows: remove argc, argv from SCServiceRemove
Jason Ish [Mon, 26 Feb 2024 22:04:32 +0000 (16:04 -0600)] 
windows: remove argc, argv from SCServiceRemove

Not used.

16 months agosuricata: remove argv from FinalizeRunMode
Jason Ish [Mon, 26 Feb 2024 21:59:59 +0000 (15:59 -0600)] 
suricata: remove argv from FinalizeRunMode

FinalizeRunMode can get the program name from suri->progname.