Commit Graph

15195 Commits (suricata-7.0.4)
 

Author SHA1 Message Date
Jeff Lucovsky 86a3a77622 detect/transform: Add case-change transform constants
Add the constants for the to_lowercase and to_uppercase transforms

Issue: 6439
(cherry picked from commit ffd559cd8e)
2 years ago
Juliana Fajardini e8f375325f userguide/eve: explain pgsql requests & responses
Add a more visible explanation of that requests, responses, frontend and
and backend are, in Pgsql context, to avoid having to repeat that over
different portions of the docs.

(cherry picked from commit bba3d4fc63)
2 years ago
Juliana Fajardini dda79c689c pgsql: add cancel request message
A CanceldRequest can occur after any query request, and is sent over a
new connection, leading to a new flow. It won't take any reply, but, if
processed by the backend, will lead to an ErrorResponse.

Task #6577

(cherry picked from commit 30ac77ce65)
2 years ago
Juliana Fajardini 1ae2451919 doc/eve-format: break pgsql section to char limit
(cherry picked from commit 7dcc2e7a71)
2 years ago
Juliana Fajardini 6ee4567952 pgsql: extract length validation into function
This is called so many times that it seems to make sense that we use a
function for this.

(cherry picked from commit 7fa8bbfe43)
2 years ago
Philippe Antoine 6b889c4c92 http2: do not have leading space for response line
Ticket: 6547
(cherry picked from commit 1b5e04bee3)
2 years ago
Philippe Antoine e974dbea0e detect: header_lowercase transform
Ticket: 6290
(cherry picked from commit 32cce122e1)
2 years ago
Juliana Fajardini 2e967202d2 pgsql: don't log password msg if password disabled
If the logging of the password is disabled, there isn't much point in
logging the password message itself.

(cherry picked from commit bdec2d8ea8)
2 years ago
Juliana Fajardini bc8231d6ef pgsql: remove probe_ts function
With the changes in the probing_ts function, this other one could become
obsolete. Remove it, and directly call `parser::parse_request` when
checking for gaps, instead.

(cherry picked from commit 9aeeac532e)
2 years ago
Juliana Fajardini d4e7299f68 pgsql: remove unused error handling call
(cherry picked from commit 53d29f652a)
2 years ago
Juliana Fajardini e7c96c3937 pgsql: don't log unknown message type
(cherry picked from commit afd6e4dc41)
2 years ago
Juliana Fajardini c35057a9ed pgsql: fix probing functions
Some non-pgsql traffic seen by Suricata is mistankenly identified as
pgsql, as the probing function is too generic. Now, if the parser sees
an unknown message type, even if it looks like pgsql, it will fail.

Bug #6080

(cherry picked from commit 4f85d06192)
2 years ago
Juliana Fajardini 7e39a9f4a9 pgsql: add unknonwn frontend message type
We had unkonwn message type for the backend, but not the frontend
messages. It's important to better identify those to improve pgsql
probing functions.

Related to
Bug #6080

(cherry picked from commit 1ac5d97259)
2 years ago
Victor Julien 6ee698c5fa github-ci: add cherry-pick line check 2 years ago
Stephen Donnelly 4fda50da84 util/time: Improve usecs handling in time macros
Fix SCTIME_ADD_SECS zeroing subsecond part

When adding s seconds to SCtime_t ts, don't zero out the ts.usecs field.

Issue: 6584

Fix SCTIME_FROM_TIMESPEC garbage microseconds part

When converting nanosecond to microseconds divide by 1000 instead
of multiplying by 1000.

Issue: 6585
(cherry picked from commit 0850e3d137)
2 years ago
Ilya Bakhtin 49ed65d008 napatech: Fix packet timestamps
Initialize both seconds and useconds of packet timestamp from napatech
timestamp format.

This commit uses updated macro definitions from util-utime.h to avoid
zero seconds value.

Issue: 6372
(cherry picked from commit 417806ca35)
2 years ago
Ilya Bakhtin 3e4c91bee6 util/time: Prevent usecs overflow
This commit takes care of original seconds value and prevents the
useconds field from overflowing pas its maximum value.

Issue: 6372
(cherry picked from commit d3095ac058)
2 years ago
jason taylor aae6beaa5a doc: update file.data keyword documentation
Signed-off-by: jason taylor <jtfas90@gmail.com>
2 years ago
Juliana Fajardini 20f9e2434a userguide: update tls not_after/not_before mentions
Our tls fields not_after and not_before are actually logged as
`notafter` and `notbefore`, but were documented with the underscore.

Update the documentation, since updating the log format itself would be
a breaking change.

Task #5494

(cherry picked from commit a649a92afd)
2 years ago
Juliana Fajardini 16bf5ce493 userguide: document flow_id, with examples
Flow_id explanation expanded from version shared by Peter Manev.

Task #6445

(cherry picked from commit 58fb559594)
2 years ago
Victor Julien f6fb48c0ca doc/userguide: add tag keyword page
Ticket: #3015.
(cherry picked from commit 6b2c33990f)
2 years ago
Victor Julien c5be44957e doc/userguide: document host table yaml settings
(cherry picked from commit 4a02a14df1)
2 years ago
Philippe Antoine b6e889bd95 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.

(cherry picked from commit e3cd0d073f)
2 years 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.
2 years ago
daniel zhao de14e3d0b5 detect/flow: fix DETECT_FLOW_FLAG_ESTABLISHED check
Ticket: #6448
2 years ago
Victor Julien 741ba51c1e github-ci: Fedora 37 to 39; use packaged cbindgen 2 years 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
2 years ago
Jason Ish f2b47bb0dc eve: remove some dead code 2 years ago
Philippe Antoine 6249722589 http2: normalize host when there is user info
Ticket: 6479
2 years 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
2 years ago
Philippe Antoine 46a46e5b1f http2: event on mismatch between authority and host
Ticket: #6425
2 years 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
2 years ago
Kirjan Kohuladas c8a7204b15 doc/rule-profiling: fix suricatasc typo 2 years 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.
2 years ago
Lukas Sismis 5b4ba0fe46 privs: hint the user of unset user/group name
Ticket: #6278
2 years 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()."
2 years 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.
2 years ago
Victor Julien 6ae37b06f1 packetpool: remove WaitForN logic as it is unused 2 years 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.
2 years 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.
2 years 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.")
2 years ago
Daniel Olatunji 3a40ed5641 detect/bytetest: convert unittests to FAIL/PASS
Issue: #6332
2 years 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.
2 years 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
2 years ago
Daniel Olatunji d4e4bdac90 detect/bytejump: convert unittests to FAIL/PASS
Issue: #6328
2 years 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
2 years 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.
2 years 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.
2 years 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
2 years ago
Juliana Fajardini a9851430e2 github: improve template CLA request info
Indicate that the CLA only has to be signed once, as we have had
contributors think that was required for each new PR.
2 years ago