Commit Graph

15296 Commits (2911656d6c11e8ef64a55ce64216382cd22151fe)
 

Author SHA1 Message Date
Comfort Amaechi 491f5dcc31 util-memcmp: Convert unittests to new FAIL/PASS API
Ticket: #6107
1 year ago
Sascha Steinbiss d07e7f6862 detect: fix typo 1 year ago
Sascha Steinbiss 0c55fe3515 detect: add mqtt.connect.protocolstring
Ticket:  OISF#6396
1 year ago
Victor Julien 68a2fcaad3 mpm: thread ctx cleanups
Remove unused thread ctx' from AC variants

Use single thread store in detection.

Minor cleanups.
1 year ago
Victor Julien 3b826fff68 detect/tag: reuse result of previous host lookup
Minor optimization that could lead to a reduction in host table
lookups if more than one host feature is in use.
1 year ago
Victor Julien 6b2c33990f doc/userguide: add tag keyword page
Ticket: #3015.
1 year ago
Victor Julien 4a02a14df1 doc/userguide: document host table yaml settings 1 year ago
Victor Julien 3cad7cfa56 unittests: free packet using PacketFree
Update SigTest17 which left a dangling pointer.
1 year ago
Victor Julien 4a079541b2 detect: fix inspect engine return codes
Use proper inspect engine codes instead of bool.
1 year ago
Victor Julien 58c7a438ed detect/flow: optimize only_stream/no_stream options
Until now the implementation would scan the stream, fallback to the
packet payload in exception cases, then keep track of where the match
was and in the flow match logic reject the match if it was in the wrong
buffer.

This patch simplifies this logic, by refusing to inspect the packet
payload when `only_stream` is set.

To do this the `only_stream`/`no_stream` options are now translated
to the pseudo protocols `tcp-stream` and `tcp-pkt` at parsing, so that
the `flow` keyword doesn't have to evaluate these conditions anymore.
1 year ago
Philippe Antoine e3cd0d073f http2: app-layer event for userinfo in uri
Ticket: #6426

as per RFC 9113
":authority" MUST NOT include the deprecated userinfo subcomponent
for "http" or "https" schemed URIs.
1 year ago
Jeff Lucovsky a46779d866 detect/transform: Clarify transformation validation
Issue: 6439

Clarify the transform validation step. When a transform indicates that
the content/byte-array is not compatible, validation will stop.

Content is incompatible is some cases -- e.g., following the
to_lowercase transform with content containing uppercase characters.
An alert is not possible since the content contains uppercase and the
transform has converted the buffer into all lowercase.
1 year ago
Jeff Lucovsky 1110a86cb9 detect/transform: Register case-change transforms
Issue: 6439
1 year ago
Jeff Lucovsky 9ee55d2394 doc/transform: Document case-changing transforms.
Issue: 6439
1 year ago
Jeff Lucovsky e5c2f9a56d detect/transform: Add case changing transforms
This commit adds the implementation for the case changing transforms:
to_lowercase and to_uppercase

Issue: 6439
1 year ago
Jeff Lucovsky ffd559cd8e detect/transform: Add case-change transform constants
Add the constants for the to_lowercase and to_uppercase transforms

Issue: 6439
1 year ago
Jeff Lucovsky 6a41843035 detect/tenants: Add tenant context to rule loads
Issue: 1520

This commit adds the tenant id for context to rule and .config file
loads.
1 year ago
Jeff Lucovsky 9d8eec453a general: Remove vi formatting directives 1 year ago
Jeff Lucovsky ad96382cf2 output/null: Add the null output device
This commit adds the null output device; to use, set the filetype
to "nullsink" for each output that should discard and never persist
logs/alerts/etc.

This is implemented as an "internal eve output plugin" just like the
syslog eve output type.
1 year ago
Ralph Eastwood 9865164e75 napatech: update docs to remove hba reference 1 year ago
Ralph Eastwood 7b0a5dae60 napatech: remove deprecated hba support 1 year ago
Philippe Antoine ab9b6e30b1 detect: adds flow integer keywords
Ticket: #6164

flow.pkts_toclient
flow.pkts_toserver
flow.bytes_toclient
flow.bytes_toserver
1 year ago
Philippe Antoine 8c5310aefd doc: quic in eve/schema
Ticket: #6076
1 year ago
Victor Julien 2f4027c117 version: start work on 8.0.0 1 year ago
Victor Julien 6bb882c4c0 macset: remove dead flow init/cleanup code
FlowInit() will only be called on a newly allocated, or a fully cleaned
up flow, so no existing storage will exist.

The only caller of `FLOW_RECYCLE` first calls `FlowFreeStorage()`, so
the reset logic in `FLOW_RECYCLE` can never trigger.

Remove now unused MacSetReset logic.
1 year ago
daniel zhao de14e3d0b5 detect/flow: fix DETECT_FLOW_FLAG_ESTABLISHED check
Ticket: #6448
1 year ago
Victor Julien 741ba51c1e github-ci: Fedora 37 to 39; use packaged cbindgen 1 year ago
Jason Ish 327c629253 outputs: call plugin ThreadDeinit, not Deinit
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: #6438
1 year ago
Jason Ish f2b47bb0dc eve: remove some dead code 1 year ago
Philippe Antoine 6249722589 http2: normalize host when there is user info
Ticket: 6479
1 year ago
Philippe Antoine b6cd66f41d http2: update brotli crate
Fixes debug assertion found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63144
1 year ago
Philippe Antoine 46a46e5b1f http2: event on mismatch between authority and host
Ticket: #6425
1 year ago
Philippe Antoine ae72ce77fa detect: parse units for integers
Ticket: #6423

Especially for filesize, instead of just a number, a signature
can use a number and a unit such as kb, mb or Gb
1 year ago
Kirjan Kohuladas c8a7204b15 doc/rule-profiling: fix suricatasc typo 1 year ago
Lukas Sismis 5300cb625e privs: refactor SCGetUser/GroupID to void functions
SCGetUserID/SCGetGroupID either FatalErrored out or
returned zero. As a result, the functions got refactored
into non-returning void functions.
1 year ago
Lukas Sismis 5b4ba0fe46 privs: hint the user of unset user/group name
Ticket: #6278
1 year ago
Victor Julien dc40a139ac packetpool: signal waiter within lock
Needed for predictable scheduling. From pthread_cond_signal man page:

"The pthread_cond_signal() or pthread_cond_broadcast() functions may
 be called by a thread whether or not it currently owns the mutex that
 threads calling pthread_cond_wait() or pthread_cond_timedwait() have
 associated with the condition variable during their waits; however, if
 predictable scheduling behaviour is required, then that mutex is locked
 by the thread calling pthread_cond_signal() or pthread_cond_broadcast()."
1 year ago
Victor Julien 087ca49e39 packetpool: return one packet as well on sync now
If a thread is hitting the packet pool return on a 'sync_now' return
the packet also if it is the first packet since the last flush.

Bug: #6435.
1 year ago
Victor Julien 6ae37b06f1 packetpool: remove WaitForN logic as it is unused 1 year ago
Victor Julien 0dda7f535c flow/timeout: no need to wait for packetpool
The timeout logic no longer passes packets around, so don't depend
on the packet pool.

Bug: #6292.
1 year ago
Victor Julien 6307a4d4b9 host/iprep: run all timeout logic
Run all timeout logic if iprep is in use as well.

Minor code cleanups.

Bug: #6436.
1 year ago
Victor Julien 80f13b93aa detect/urilen: fix discontinue matching logic
Actually discontinue matching.

Fixes: 21f9cc3a39 ("discontinue matching on buffer if urilen returns a match failure.")
1 year ago
Daniel Olatunji 3a40ed5641 detect/bytetest: convert unittests to FAIL/PASS
Issue: #6332
1 year ago
Jason Ish 7d60bb7139 dns/eve: make removed v1 style a warning, not an error
We don't error out in this case, but instead default to v2. So use a
warning instead of an error.
1 year ago
Jason Ish a240a93b69 dns/eve: use default formats if formats is empty
If the configuration field "formats" is empty, DNS response records do
not have any relevant information other than that there was a
response, but not much about the response.

I'm pretty sure the intention here was to log the response details if
no formats were provided, which is what happens when the field is
commented out.

So if no formats are specified, use the default of all.

Bug: #6420
1 year ago
Daniel Olatunji d4e4bdac90 detect/bytejump: convert unittests to FAIL/PASS
Issue: #6328
1 year ago
Jason Ish 804c5b737b runmodes: remove obsolete references to pcap auto modes
These auto modes were remove many years ago. Also cleanup the wording
a little.

Task: #6427
1 year ago
Jeff Lucovsky f363b99fd7 detect/bytejump: Improve end-of-buffer handling
Issue: 4623

This commit addresses the issues reported in issue 4623 when the jump
value points at the last byte in the buffer.
1 year ago
Jeff Lucovsky ffd769d178 detect/bytejump: Remove unused "Match" function
Issue: 4623

DetectBytejumpMatch is no longer used -- it's counterpart --
DetectByteJumpDoMatch is and will remain.
1 year ago
Lukas Sismis 292fda88b4 unix-manager: prioritize the shutdown check
Make sure Suricata is in the running state before
you attempt to execute commands on the Unix sockets.
UnixMain is being called in an infinite loop where
TmThreadsCheckFlag(th_v, THV_KILL) is checked for the
deinit phase. However, it may take some time between
the start of Suricata's deinitialization and
the receipt of THV_KILL flag in the Unix thread.

In between this time period, the Unix manager can still
perform select() operation on the Unix socket while
the socket being already deinitialized.

Likely with a longer time span between the initial shutdown
command and actual closing of Unix sockets resulted in
an error of invalid file descriptors.

Ticket: #6272
1 year ago