Commit Graph

18377 Commits (2deb1d25c4a15252e371868448ac5d9d96290d48)
 

Author SHA1 Message Date
Ambre Iooss 91c9e34419 doc/userguide: update windivert instructions
The IPS documentation for Windows had a dead link
to a PDF. Update the Windows build page to include
WinDivert instructions.

Documentation: #8137.
8 months ago
Ambre Iooss 3bcad5f364 windivert: upgrade to 2.0.0
WinDivert 2 was released in 2019. This introduced some minimal
changes to some functions arguments.

Bug: #8138.
8 months ago
Philippe Antoine cf88ed518c jsonschema: check for duplicate keys
Ticket: 6691

And fix the one duplicate found
8 months ago
Victor Julien 365ed2a2ff af-packet: disable hwtimestamp by default
Add enable-hwtimestamp option to replace disable-hwtimestamp.

Ticket: #7585.
8 months ago
Jeff Lucovsky 845544aad3 doc/luaxform: Clarify luaxform calling convention
Issue: 8135

Clarify the calling convention for the Lua transform's `transform`
function.
8 months ago
James Kaddu 78d8fd7b9d output/file: validate force-hash YAML values
Previously, the force-hash configuration for file logging silently accepted
unknown or invalid hash types (e.g., 'shanani')
Now, invalid values trigger FatalError.

Bug OISF#4330
8 months ago
James Kaddu 354e9987e4 detect/analyzer: add details for the xbits keyword
Add xbits keyword details. Exposes cmd, name, track, and expire
properties, following the same pattern as byte_jump and flowbits.

Task #6351
8 months ago
Juliana Fajardini 6c06ab6144 devguide: update backports policy for Suricata 7.0
Also remove mentions to `master` and `6.0x`.

Task #7937
8 months ago
Juliana Fajardini e3878042c9 stream/reassemble: use more legible FAIL macros
Use `FAIL_IF_NOT` instead of `FAIL_IF(!` or `FAIL_IF(.... !=`
8 months ago
James Kaddu 1b18081dfb stream/tcp/reassemble: convert unittests to FAIL/PASS API
Updated the stream TCP reassembly unit tests to use the new
FAIL/PASS API instead of the deprecated legacy assertion macros.

Task OISF#6324
8 months ago
Juliana Fajardini 907f4faff8 doc/thresholding: minor fix for backoff subsection 8 months ago
Philippe Antoine c93e69830a detect/ssl: properly handle negation in ssl_version keyword
Ticket: 3220

DetectSslVersionMatch did not handle properly negation.
It could never match on a signatrue with ssl_version: !tls1.3
That is because, if we had such a signature and network traffic
with tls1.1, we were looking into DetectSslVersionData field
for tls1.1, which was not set, instead of looking at field
for tls1.3 which was set with negated flag.

Previous DetectSslVersionData was holding redundant information.
It did not need to have it for each ssl version, but just globally.
Also, it did not need to hold the version as a value in the array,
as it was redundant with the index of the array.
8 months ago
Jeff Lucovsky 3d80c7fb19 main/options: Limit verbose option count
Issue: 7389

Continue to recognize multiple 'v' specifications up to the maximum
recognized. The maximum recognized is the number of slots between the
NOTICE and DEBUG levels.

When debug is configured, `-vvvv` is required to set the log level to
debug. Specifying 4 or more `v` will maintain debug level.

When debug is not configured, `-vvvv` and more `v`'s will cause
config messages to be printed.
8 months ago
Philippe Antoine 09e50ac3f4 stream/tcp: check new last_ack stays within base_seq bounds
If we have
- stream->last_ack 0x40021
Then, we call StreamTcpUpdateLastAck with 0x8000fc21

Then we satisfy SEQ_GT((ack), (stream)->last_ack)
But we do not satisfy SEQ_GT(ack, (stream)->base_seq))

and the new last_ack will be compared to base_seq

So, refuse to make such a big update

Ticket: 6865
8 months ago
dependabot[bot] 973ab60a34 github-actions: bump github/codeql-action from 4.31.2 to 4.31.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.2 to 4.31.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v4.31.2...v4.31.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
8 months ago
dependabot[bot] 9095eb9b22 github-actions: bump actions/checkout from 5.0.0 to 6.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months ago
Philippe Antoine 1329786f84 detect: new command line option : list-rule-protos
To list the protocols we can use a in a rule header

Ticket: 635
8 months ago
Philippe Antoine 69c95f2b7c detect: rewrite DetectProtoParse
To use an array, instead of hard-coded values.
Opens the path to list the rule protocols

Ticket: 635
8 months ago
Victor Julien 08d625bb10 mpm: remove remaining ac-bs references 8 months ago
Victor Julien be2c40bde7 doc/af-packet: document disable-hwtimestamp option
Ticket: #1954.
8 months ago
Victor Julien 18a6a079da af-packet: add disable-hwtimestamp option
HW timestamping is not always reliable, so add an option to disable it.

Bug: #1954.
8 months ago
Victor Julien 7c0776abeb counters: remove ThreadVars from counter registration
Just pass the StatsThreadContext pointer directly.
8 months ago
Victor Julien 419bbc79cc counters: remove unused thread name in counter registration 8 months ago
Victor Julien 5194c877f2 threads: remove thread group name logic
Once used to merge stats. Stats are tracked per thread and merge by counter
name in the current code.

It was set only for autofp modes.
8 months ago
Victor Julien 77ddbbb9c8 counters: regular counter get local API update 8 months ago
Victor Julien 9956f1f3c0 counters: regular counter Decr API update 8 months ago
Victor Julien 78da4cfcae counters: regular counter Incr API update 8 months ago
Victor Julien 045142a1f1 counters: regular counter Set API update 8 months ago
Victor Julien dfbfc81c51 counters: regular counter Add API update 8 months ago
Victor Julien adebfcd4a5 counters: remove ThreadVars from Avg counter API 8 months ago
Victor Julien 379b8ac5a6 counters: remove ThreadVars from Max counter API 8 months ago
Victor Julien ba3a86100b counters: debug code for inspecting counter registration 8 months ago
Victor Julien 72e4275456 app-layer: only register flow counter for detection-only
Other counters are never incremented if no parser is active.
8 months ago
Victor Julien c89d01679f counters: improve thread setup error handling 8 months ago
Victor Julien 33589e6079 unix-socket: don't doubly setup stats private area 8 months ago
Victor Julien 13d2fa6092 counters: minor code cleanup 8 months ago
Victor Julien c27d0b4192 counters: remove ThreadVars from sync API 8 months ago
Victor Julien 3f4af00fdd counters: remove ThreadVars from API 8 months ago
Victor Julien 4234567bb9 counters: unify public and private structs
This way ThreadVars can hold a single stats member.
8 months ago
Victor Julien 3a58c53b93 counters: improve error checking
Implement for unix manager.

Harden against incomplete setup.

More gracefully handle no-stats config
8 months ago
Victor Julien c4551e95bc counters: compress local stats table
To avoid overhead of copies during syncs, compress the local stats table.

Previously all counters had 2 64bit ints: one for the value, one to
track the number of times the counter was updated. The updates field was
only used for counters of type "average" however. Since only a few
average counters were in use, this effectively meant that almost half of
the space used for the table was wasted.

This patch reduces `StatsLocalCounter` to a single i64. Regular counters
simply use this directly by using their id as an index into the table.

For avg counters the logic is similar, however they effectively use 2
indexes, idx and idx+1. The value is at `idx`, the updates are at `idx +
1`.

Ticket: #5613.
8 months ago
Victor Julien 70096873ce counters: threadvar init func
Add initializion.

Also fixes DetectDsizeIcmpv6Test01 using two different ThreadVar
structs.
8 months ago
Victor Julien 6c77c8f371 counters: use spinlock for thread sync
Sync should be short, so no value in getting scheduled away.
8 months ago
Victor Julien 96cabab46b counters: optimize thread stats syncs
Minimize the work done under lock when synchronizing thread stats.

Instead of looping all stats to copy them from the threads private store
to the public store, this patch simply memcpy's the whole array.

When the stats thread then takes the stats from the threads public
store, it now also copies the whole array to a local store before
processing the stats one by one.

This keeps the locking time minimal.

Packet Thread(s)

[ private thread stats          ]

       | lock
       | memcpy
       V unlock

[ copy of thread stats          ]

Stats Thread

[ copy of thread stats          ]

       | lock
       | memcpy
       V unlock

[ private copy of thread stats  ]
8 months ago
Victor Julien 11f214bda8 counters: reduce scope of helper function
Not needed outside of the counters code.
8 months ago
Victor Julien 5f754b11a6 counters: move counter pointer out of thread private data
Ticket: #5613.
8 months ago
Victor Julien 3da562cd1b counters: remove unused elements from StatsThreadStore 8 months ago
Victor Julien 444166ec84 counters: move regular counter id to dedicated type 8 months ago
Victor Julien 0d8c81c062 counters: avoid unneeded 'updates' increment
No longer used now that the counter functions are only for regular counters.
8 months ago
Victor Julien fd9ce24fa3 counters: remove unused id var in local stats counter
Ticket: #5613.
8 months ago