]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agoutil/mime: use uint32_t for consumed bytes 8581/head
Shivani Bhardwaj [Wed, 8 Mar 2023 15:46:03 +0000 (21:16 +0530)] 
util/mime: use uint32_t for consumed bytes

In a case of the line buffer being over 255 bytes, the consumed bytes
would reset to 0 as it was uint8_t. Fix this integer overflow by setting
the type to uint32_t.

Redmine ticket: 5883

2 years agodoc: add dataset examples 8572/head
Shivani Bhardwaj [Mon, 27 Feb 2023 13:17:16 +0000 (18:47 +0530)] 
doc: add dataset examples

2 years agodetect: add comments for DETECT_SM_LIST_* types
Shivani Bhardwaj [Thu, 2 Mar 2023 07:28:17 +0000 (12:58 +0530)] 
detect: add comments for DETECT_SM_LIST_* types

2 years agoconfig: put version in configuration as a proper value
Jason Ish [Mon, 30 Jan 2023 23:13:04 +0000 (17:13 -0600)] 
config: put version in configuration as a proper value

Adds a new field, "suricata-version" to the configuration file with
the major and minor version of the Suricata that generated the
configuration file.

This may be useful in the future for presenting warnings about
important changes, or even providing different defaults based on what
the user might expect.

Ticket: 5822

2 years agopfring: Packet structure for ts fix
Jeff Lucovsky [Fri, 17 Feb 2023 14:18:24 +0000 (09:18 -0500)] 
pfring: Packet structure for ts fix

Issue: 5818

This commit addresses the issue with using the address of a packed
member of a structure. The pfring timeval is within a packed structure.

2 years agopfring/time: Track stat output with SCTime_t
Jeff Lucovsky [Sun, 29 Jan 2023 14:28:38 +0000 (09:28 -0500)] 
pfring/time: Track stat output with SCTime_t

Issue: 5818

This commit changes the datatype of the tracking value for the last time
stats were dumped.

Changing the type also eliminates a comparison between values with
different signs.

2 years agotime: SCTime additions -- neq, initializer
Jeff Lucovsky [Sun, 29 Jan 2023 13:36:42 +0000 (08:36 -0500)] 
time: SCTime additions -- neq, initializer

Issue: 5818

This commit adds an initializer for the SCTime_t type and a comparison
macro for "not equal".

Use them as follows:
    SCTime_t my_var = SCTIME_INITIALIZER;
    if (SCTIME_CMP_NEQ(sctime1_val, sctime2_val)) {
    }

2 years agoeve: add version and warning in ntlmssp
Lancer Cheng [Tue, 14 Feb 2023 11:33:35 +0000 (11:33 +0000)] 
eve: add version and warning in ntlmssp

Bug OISF#5783

2 years agodoc: add version filed in NTLMSSP documentation
Lancer Cheng [Tue, 14 Feb 2023 11:27:29 +0000 (11:27 +0000)] 
doc: add version filed in NTLMSSP documentation

Bug OISF#5783

2 years agosmb: fix parser of ntlmssp negotiateflags
Lancer Cheng [Tue, 14 Feb 2023 11:26:57 +0000 (11:26 +0000)] 
smb: fix parser of ntlmssp negotiateflags

Fix endian-conversion bug in function parse_ntlm_auth_nego_flags

Bug OISF#5783

2 years agolog/thread: Consolidate threaded file tracking
Jeff Lucovsky [Sat, 11 Feb 2023 16:42:55 +0000 (11:42 -0500)] 
log/thread: Consolidate threaded file tracking

Issue: 5836

This commit removes the duplicate threaded file tracking from the log
file mechanisms.

Tracking is now consolidated with the threaded hash table.

2 years agolog: Stop if log initialization fails at startup
Jeff Lucovsky [Sat, 4 Feb 2023 15:08:37 +0000 (10:08 -0500)] 
log: Stop if log initialization fails at startup

Issue: 5836

This commit modifies Suricata to fail if log initialization errors occur
during startup.

2 years agostream: add seq min and max; use in segment compare 8563/head
Victor Julien [Tue, 28 Feb 2023 14:00:09 +0000 (15:00 +0100)] 
stream: add seq min and max; use in segment compare

2 years agostream: fix overlap detection
Victor Julien [Tue, 28 Feb 2023 10:41:59 +0000 (11:41 +0100)] 
stream: fix overlap detection

If a in-tree segment was partly before base_seq the overlap detection
miscalculated the data offset. This lead to memcmp comparing the wrong
data.

Bug: #5881.

2 years agostream: reuse TCP session after TFO SYN+data reject 8562/head
Victor Julien [Mon, 27 Feb 2023 14:42:37 +0000 (15:42 +0100)] 
stream: reuse TCP session after TFO SYN+data reject

2 years agoeve/stream: log tcp reuse flag in packets
Victor Julien [Mon, 27 Feb 2023 14:42:15 +0000 (15:42 +0100)] 
eve/stream: log tcp reuse flag in packets

2 years agoflow: remove unused tcp reuse flow flag
Victor Julien [Mon, 27 Feb 2023 14:41:36 +0000 (15:41 +0100)] 
flow: remove unused tcp reuse flow flag

2 years agostream: support SYN/ACK with TFO only ack'ing ISN
Victor Julien [Sat, 25 Feb 2023 09:10:29 +0000 (10:10 +0100)] 
stream: support SYN/ACK with TFO only ack'ing ISN

Not ack'ing the data.

2 years agostream: add counter for acks for unseen data
Victor Julien [Thu, 23 Feb 2023 09:29:06 +0000 (10:29 +0100)] 
stream: add counter for acks for unseen data

This is another indicator for packet loss or strange captures.

2 years agoeve/stream: ack unseen data
Victor Julien [Wed, 22 Feb 2023 20:14:52 +0000 (21:14 +0100)] 
eve/stream: ack unseen data

2 years agostream: flag ACKs that ack segments after next_seq
Victor Julien [Wed, 22 Feb 2023 20:14:23 +0000 (21:14 +0100)] 
stream: flag ACKs that ack segments after next_seq

Avoid this for async streams.

2 years agostream: fix spurious retransmission handling
Victor Julien [Sat, 18 Feb 2023 09:48:51 +0000 (10:48 +0100)] 
stream: fix spurious retransmission handling

Fix spurious retransmissions getting dropped, stalling connections in IPS
mode.

There are several reasons why benign spurious retransmissions can happen,
with the most obvious one that an ACK is lost so the sender retransmits
while the receiver has ACK'd it. If Suricata sees the ACK but afterwards
it gets lost, we can get in this condition. Packet loss can have a wide
range of causes here, including packets reaching a host but getting
dropped in the NIC queue or kernel queues due to resource constraints.

So these packets are no longer an "error" in this patch.

Next to this, the accuracy of the spurious retransmission has been
improved. Use SEQ macros to compare sequence numbers. Only use base_seq
if reassembly is still enabled for a stream.

A special case is added for cases where a segment is before last_ack
but after base_seq, which can happen when protocol detection isn't
finished yet. In this case the segment is tagged as spurious, but still
processed. This way we can check for overlaps.

Bug: #5875.

2 years agostream: add liberal timetamps option
Victor Julien [Wed, 22 Feb 2023 14:17:53 +0000 (15:17 +0100)] 
stream: add liberal timetamps option

Linux is slightly more permissive wrt timestamps than many
other OS'. To avoid many events/issues with linux hosts, add an
option to allow for this slightly more permissive behavior.

Ideally the host-os config would be used, but in practice this
setting is rarely set up correctly, if at all.

This option is enabled by default.

2 years agostream: D-SACK detection and logging
Victor Julien [Tue, 21 Feb 2023 09:47:13 +0000 (10:47 +0100)] 
stream: D-SACK detection and logging

RFC 2883 specifies a special use of SACKs to indicate a host has
received a segment it considers a spurious retransmission.

2 years agostream: Dup-ACK detection
Victor Julien [Tue, 21 Feb 2023 09:08:31 +0000 (10:08 +0100)] 
stream: Dup-ACK detection

Modeled after Wiresharks Dup-ACK detection.

2 years agostream: fix next_seq updates after temporary gap
Victor Julien [Sat, 18 Feb 2023 14:36:55 +0000 (15:36 +0100)] 
stream: fix next_seq updates after temporary gap

On every accepted packet in established state, update next_seq if
packet seq+len is larger than existing next_seq. This allows it to
catch up after large gaps that are filled again a bit later.

Bug: #5877.

2 years agoeve/stream: per packet stream engine logging
Victor Julien [Thu, 16 Feb 2023 07:59:31 +0000 (08:59 +0100)] 
eve/stream: per packet stream engine logging

Debug facility to get a per packet view into the stream engine's state.

Logs after a packet has been processed in the stream engine, so the view
into the state includes the updates based on the current packet.

Marked as experimental so it can be changed w/o notice.

Bug: #5876.

2 years agostream: implement config option for SYN queue
Victor Julien [Fri, 17 Feb 2023 12:03:41 +0000 (13:03 +0100)] 
stream: implement config option for SYN queue

Default to allowing 10 SYNs to not trigger an event on a connection
attempt that times out.

2 years agostream: track packet flags in packet
Victor Julien [Thu, 16 Feb 2023 05:17:24 +0000 (06:17 +0100)] 
stream: track packet flags in packet

These flags can then later be used by stream logging.

2 years agostream: improve first FIN next_seq update
Victor Julien [Tue, 14 Feb 2023 14:36:56 +0000 (15:36 +0100)] 
stream: improve first FIN next_seq update

For accepted FIN packets, always update next_seq. This helps track the
FIN sequence.

Bug: #5877.

2 years agostream: improve FIN next_seq handling
Victor Julien [Wed, 15 Feb 2023 10:56:47 +0000 (11:56 +0100)] 
stream: improve FIN next_seq handling

Update next_seq to SEQ + payload_len + 1, so retransmission checks
work better.

Bug: #5877.

2 years agostream: set next_seq before last_ack
Victor Julien [Wed, 15 Feb 2023 10:56:01 +0000 (11:56 +0100)] 
stream: set next_seq before last_ack

next_seq sometimes depends on last_ack in cases of packet loss
catch up, so first update it.

Bug: #5877.

2 years agostream/tcp: fix wrong ACK trigger FIN1 to FIN2
Victor Julien [Sat, 11 Feb 2023 12:14:53 +0000 (13:14 +0100)] 
stream/tcp: fix wrong ACK trigger FIN1 to FIN2

An ACK that ACK'd older data while still being in-window could
lead to FIN_WAIT1 to FIN_WAIT2 state transition. Detect this
case and generally harden the check.

Bug: #5877.

2 years agostream: SYN queue support
Victor Julien [Thu, 9 Feb 2023 16:11:21 +0000 (17:11 +0100)] 
stream: SYN queue support

Support case where there are multiple SYN retransmits, where
each has a new timestamp.

Before this patch, Suricata would only accept a SYN/ACK that
matches the last timestamp. However, observed behavior is that
the server may choose to only respond to the first. In IPS mode
this could lead to a connection timing out as Suricata drops
the SYN/ACK it considers wrong, and the server continues to
retransmit it.

This patch reuses the SYN/ACK queuing logic to keep a list
of SYN packets and their window, timestamp, wscale and sackok
settings. Then when the SYN/ACK arrives, it is first evaluated
against the normal session state. But if it fails due to a
timestamp mismatch, it will look for queued SYN's and see if
any of them match the timestamp. If one does, the ssn is updated
to use that SYN and the SYN/ACK is accepted.

Bug: #5856.

2 years agostream: fix direction macro to be used in conditions
Victor Julien [Mon, 13 Feb 2023 07:53:03 +0000 (08:53 +0100)] 
stream: fix direction macro to be used in conditions

2 years agostream: minor code cleanup
Victor Julien [Sun, 12 Feb 2023 20:34:56 +0000 (21:34 +0100)] 
stream: minor code cleanup

2 years agoflow: fix comment typo
Victor Julien [Sun, 12 Feb 2023 20:34:33 +0000 (21:34 +0100)] 
flow: fix comment typo

2 years agostream: turn session bool into flag
Victor Julien [Sat, 11 Feb 2023 18:22:26 +0000 (19:22 +0100)] 
stream: turn session bool into flag

2 years agostream: turn session flags into u32
Victor Julien [Sat, 11 Feb 2023 18:16:28 +0000 (19:16 +0100)] 
stream: turn session flags into u32

Due to gaps/padding the size of the struct won't change.

2 years agostream/config: optimize stream config structure layout
Victor Julien [Sat, 11 Feb 2023 13:27:00 +0000 (14:27 +0100)] 
stream/config: optimize stream config structure layout

2 years agostream/config: turn async_oneside into bool
Victor Julien [Sat, 11 Feb 2023 13:20:21 +0000 (14:20 +0100)] 
stream/config: turn async_oneside into bool

2 years agostream: minor code cleanups in ACK validation
Victor Julien [Sat, 11 Feb 2023 07:09:17 +0000 (08:09 +0100)] 
stream: minor code cleanups in ACK validation

2 years agostream: remove unused macros
Victor Julien [Wed, 15 Feb 2023 08:51:30 +0000 (09:51 +0100)] 
stream: remove unused macros

2 years agostream: remove usused thread pseudo packet queue
Victor Julien [Wed, 15 Feb 2023 08:41:31 +0000 (09:41 +0100)] 
stream: remove usused thread pseudo packet queue

2 years agostream: remove unused packetqueue argument
Victor Julien [Wed, 15 Feb 2023 08:21:12 +0000 (09:21 +0100)] 
stream: remove unused packetqueue argument

2 years agorfb: add unittests to rfb.rs 8536/head
Haleema Khan [Fri, 16 Dec 2022 02:38:37 +0000 (07:38 +0500)] 
rfb: add unittests to rfb.rs

Task: #5741

2 years agotcp: pick up a midstream session even with FIN flag
Philippe Antoine [Mon, 26 Dec 2022 10:56:18 +0000 (11:56 +0100)] 
tcp: pick up a midstream session even with FIN flag

Ticket: #5437

2 years agouserguide: update tls keywords information
Haleema Khan [Tue, 24 Jan 2023 21:50:14 +0000 (02:50 +0500)] 
userguide: update tls keywords information

Ticket #5544

2 years agosmb: handles records with trailing nbss data
Philippe Antoine [Wed, 18 Jan 2023 15:47:56 +0000 (16:47 +0100)] 
smb: handles records with trailing nbss data

If a file (read/write) SMB record has padding/trailing data
after the buffer being read or written, and that Suricata falls
in one case where it skips the data, it should skip until
the very end of the NBSS record, meaning it should also skip the
padding/trailing data.

Otherwise, an attacker may smuggle some NBSS/SMB record in this
trailing data, that will be interpreted by Suricata, but not
by the SMB client/server, leading to evasions.

Ticket: #5786

2 years agosmb: checks against nbss records length
Philippe Antoine [Tue, 27 Dec 2022 16:34:47 +0000 (17:34 +0100)] 
smb: checks against nbss records length

When Suricata handles files over SMB, it does not wait for the
NBSS record to be complete, and can stream the payload to the
file... But it did not check the consistency of the SMB record
length being read or written against the NBSS record length.

This could lead to an evasion where an attacker crafts a SMB
write with a too big Length field, and then sends its evil
payload, even if the server returned an error for the write request.

Ticket: #5770

2 years agouserguide: add DHCP EVE log information
jason taylor [Wed, 8 Feb 2023 18:54:47 +0000 (18:54 +0000)] 
userguide: add DHCP EVE log information

Signed-off-by: jason taylor <jtfas90@gmail.com>
2 years agostream: minor cleanups 8529/head
Victor Julien [Thu, 9 Feb 2023 15:57:23 +0000 (16:57 +0100)] 
stream: minor cleanups

2 years agostream: reduce scope of inline drop check
Victor Julien [Thu, 9 Feb 2023 15:52:53 +0000 (16:52 +0100)] 
stream: reduce scope of inline drop check

2 years agostream: move state queue code into util func
Victor Julien [Thu, 9 Feb 2023 15:35:53 +0000 (16:35 +0100)] 
stream: move state queue code into util func

2 years agostream: set event on bad timestamp on syn_sent state
Victor Julien [Thu, 9 Feb 2023 08:36:56 +0000 (09:36 +0100)] 
stream: set event on bad timestamp on syn_sent state

2 years agostream: remove unnecessary ssn checks
Victor Julien [Thu, 9 Feb 2023 08:35:48 +0000 (09:35 +0100)] 
stream: remove unnecessary ssn checks

Add debug validation to catch any change.

2 years agoeve/flow: optimize tcp gap checks
Victor Julien [Wed, 8 Feb 2023 19:02:09 +0000 (20:02 +0100)] 
eve/flow: optimize tcp gap checks

2 years agotime: don't log debug messages from debug logging
Victor Julien [Wed, 8 Feb 2023 06:28:07 +0000 (07:28 +0100)] 
time: don't log debug messages from debug logging

Bug: #5835.

Fixes: 31793aface58 ("time: Replace struct timeval with scalar value")
2 years agogithub: avoid bash escaping 8522/head
Philippe Antoine [Thu, 2 Feb 2023 21:32:57 +0000 (22:32 +0100)] 
github: avoid bash escaping

so as to allow ' in github discussion and get CI green

2 years agodetect: initialize empty buffers
Victor Julien [Tue, 7 Feb 2023 11:23:57 +0000 (12:23 +0100)] 
detect: initialize empty buffers

2 years agostream/regions: improve region shrinking 8521/head
Victor Julien [Fri, 3 Feb 2023 06:54:58 +0000 (07:54 +0100)] 
stream/regions: improve region shrinking

Handle failure on shrink.

Keep size multiple of configured buf_size setting.

2 years agostreaming/sbb: propegate allocation errors
Victor Julien [Fri, 3 Feb 2023 06:47:20 +0000 (07:47 +0100)] 
streaming/sbb: propegate allocation errors

2 years agostreaming: remove unused function
Victor Julien [Fri, 3 Feb 2023 06:38:30 +0000 (07:38 +0100)] 
streaming: remove unused function

2 years agostream/tcp: allow tcp session reuse on null sessions
Victor Julien [Thu, 2 Feb 2023 13:45:30 +0000 (14:45 +0100)] 
stream/tcp: allow tcp session reuse on null sessions

When a "stream starter" packet finds an existing TCP flow, the flow will be
evaluated for reuse.

The following scenario wasn't handled well:

1. Suricata starts after a tool has just stopped using lots of connections
   (e.g. ab stress testing a webserver)
2. even though the client is closed already, the server is still doing
   connection cleanup sending many FINs and later RSTs
3. Suricata creates flows for these packets, but no TCP sessions
4. client resumes testing, creating flows that have the same 5 tuple as the
   flows created for the FIN/RST packets
5. Suricata refuses to "reuse" the flows as the condition "tcp flow w/o session"
   is not considered valid for session reuse
6. new TCP connection is not properly tracked and evaluated in parsing and
   detection

There may be other vectors into this, like a flow w/o session because of
memcap issues.

Bug: #5843.

2 years agostreaming/regions: fix consolidation cornercases
Victor Julien [Wed, 1 Feb 2023 16:13:13 +0000 (17:13 +0100)] 
streaming/regions: fix consolidation cornercases

Incorrect "end" region for consolidation was selected if the "dst"
would be expanded to overlap with it.

Fix list handling when the first region to consider (src_start) was
not the list start.

Bug: #5833.
Bug: #5834.

2 years agostreaming: grow more conservatively
Victor Julien [Wed, 1 Feb 2023 16:11:39 +0000 (17:11 +0100)] 
streaming: grow more conservatively

Don't grow to next multiple of cfg->buf_size if size is already
a multiple of buf_size.

2 years agostreaming: minor debug logging improvement
Victor Julien [Wed, 1 Feb 2023 10:08:10 +0000 (11:08 +0100)] 
streaming: minor debug logging improvement

2 years agoversion: start development towards 7.0.0-rc2
Victor Julien [Wed, 1 Feb 2023 10:07:41 +0000 (11:07 +0100)] 
version: start development towards 7.0.0-rc2

2 years agorelease: 7.0.0-rc1; update changelog 8502/head suricata-7.0.0-rc1
Shivani Bhardwaj [Tue, 31 Jan 2023 06:27:46 +0000 (11:57 +0530)] 
release: 7.0.0-rc1; update changelog

2 years agorequirements: use suricata-update 1.3.0rc1 8501/head
Jason Ish [Mon, 30 Jan 2023 17:15:37 +0000 (11:15 -0600)] 
requirements: use suricata-update 1.3.0rc1

2 years agodoc: warn IPS users on new exception policy default
Victor Julien [Mon, 30 Jan 2023 17:42:38 +0000 (18:42 +0100)] 
doc: warn IPS users on new exception policy default

2 years agoexception/policy: add more info on defaults
Victor Julien [Mon, 30 Jan 2023 17:28:04 +0000 (18:28 +0100)] 
exception/policy: add more info on defaults

Be more informative where a exception value came from: defaults,
master switch or an explicit setting.

2 years agostream/midstream: add bug number to policy warning
Victor Julien [Mon, 30 Jan 2023 17:02:39 +0000 (18:02 +0100)] 
stream/midstream: add bug number to policy warning

2 years agoexception/policy: 'auto' sets IPS to 'drop-flow'
Victor Julien [Mon, 30 Jan 2023 16:15:49 +0000 (17:15 +0100)] 
exception/policy: 'auto' sets IPS to 'drop-flow'

In IPS mode set all exception policies to drop-flow by default, both
in the default yaml and if no `exception-policy` is defined.

2 years agoexception/policy: fix formatting issues
Victor Julien [Mon, 30 Jan 2023 16:06:10 +0000 (17:06 +0100)] 
exception/policy: fix formatting issues

2 years agodecoder: mention removal of udp.hlen_invalid sig
Victor Julien [Mon, 30 Jan 2023 13:32:28 +0000 (14:32 +0100)] 
decoder: mention removal of udp.hlen_invalid sig

2 years agorules/decoder: fix sid for udp.len_invalid rule
Shivani Bhardwaj [Mon, 30 Jan 2023 09:44:06 +0000 (15:14 +0530)] 
rules/decoder: fix sid for udp.len_invalid rule

2 years agoflow: enforce flow assumption 8495/head
Victor Julien [Mon, 30 Jan 2023 10:27:37 +0000 (11:27 +0100)] 
flow: enforce flow assumption

Enforce assumption that packets in ThreadVars::decode_pq have no flow
attached to it because this is only true for packets while they are
in the FlowWorker.

2 years agoflow/mgr: remove flows_timeout_inuse counter
Victor Julien [Mon, 30 Jan 2023 10:07:45 +0000 (11:07 +0100)] 
flow/mgr: remove flows_timeout_inuse counter

2 years agoflow: rearrange Flow struct to be more compact
Victor Julien [Sun, 29 Jan 2023 09:47:53 +0000 (10:47 +0100)] 
flow: rearrange Flow struct to be more compact

2 years agoflow: remove use_cnt
Victor Julien [Fri, 27 Jan 2023 19:47:46 +0000 (20:47 +0100)] 
flow: remove use_cnt

Packets only ever reference the flow while holding its lock. This
means than any code possibly evicting the flow will have to wait
for the existing users to complete their work. Therefore the use_cnt
serves no function anymore and can be removed.

2 years agoflowworker: don't keep unnecessary flow reference
Victor Julien [Fri, 27 Jan 2023 19:30:20 +0000 (20:30 +0100)] 
flowworker: don't keep unnecessary flow reference

Flow stream/detect/log flush packets, don't hold on to the flow
beyond the flow worker module.

2 years agostream: remove unused pseudo packet function
Victor Julien [Fri, 27 Jan 2023 19:22:44 +0000 (20:22 +0100)] 
stream: remove unused pseudo packet function

2 years agogithub-ci: dump github context and pr body 8489/head
Jason Ish [Wed, 25 Jan 2023 21:41:50 +0000 (15:41 -0600)] 
github-ci: dump github context and pr body

For debugging the parsing of suricata-verify-pr.

2 years agogithub-ci: annotate job with s-v info
Jason Ish [Wed, 25 Jan 2023 18:48:57 +0000 (12:48 -0600)] 
github-ci: annotate job with s-v info

2 years agorfb: remove duplicate logging of depth
Jason Ish [Wed, 25 Jan 2023 17:07:19 +0000 (11:07 -0600)] 
rfb: remove duplicate logging of depth

The "depth" field in the "pixel_format" object was being logged twice.

Issue: 5813

2 years agosmb: fix duplicate interface logging
Jason Ish [Wed, 25 Jan 2023 17:53:08 +0000 (11:53 -0600)] 
smb: fix duplicate interface logging

An array of interfaces was being logged without creating an array,
resulting in duplicate "interface" objects being logged. Instead put
these interfaces into an array like already done elsewhere.

Issue: 5814

2 years agoeve: remove dcerpc.interface from schema
Jason Ish [Wed, 25 Jan 2023 17:52:07 +0000 (11:52 -0600)] 
eve: remove dcerpc.interface from schema

Looks like this was due to an error in the dcerpc logging where the
interfaces should have been logged to the "interfaces" array that was
already defined.

Issue: 5814

2 years agosmb: remove duplicate tree_id logging
Jason Ish [Wed, 25 Jan 2023 18:02:27 +0000 (12:02 -0600)] 
smb: remove duplicate tree_id logging

Remove the second occurrence of tree_id logging which appears to
always be a duplicate of the first tree_id logged, even though they
come from different data structures.

Issue: 5811

2 years agogithub-ci/rust: display clippy diff
Jason Ish [Sat, 28 Jan 2023 18:54:36 +0000 (12:54 -0600)] 
github-ci/rust: display clippy diff

2 years agorust: utility function to copy Rust strings to C strings
Jason Ish [Fri, 27 Jan 2023 06:58:58 +0000 (00:58 -0600)] 
rust: utility function to copy Rust strings to C strings

As there are a few places where a Rust string is copied into a provided
C string buffer, create a utility function to take care of these
details.

2 years agotls: fix date logging for dates before 1970
Jason Ish [Fri, 27 Jan 2023 05:03:22 +0000 (23:03 -0600)] 
tls: fix date logging for dates before 1970

The Rust time crate used by the x509-parser crate represents dates
before 1970 as negative numbers which do not survive the conversion to
SCTime_t and formatting with the current time formatting functions.

Instead of fixing our formatting functions to handle such dates,
create a Rust function for logging TLS dates directly to JSON using
the time crate that handles such dates properly.

Also add a FFI function for formatting to a provided C buffer for the
legacy tls-log.

Issue: 5817

2 years agoschema: add regular expression for tls date format
Jason Ish [Thu, 26 Jan 2023 20:37:54 +0000 (14:37 -0600)] 
schema: add regular expression for tls date format

2 years agodetect/frames: improve IPS and GAP handling 8482/head
Victor Julien [Thu, 26 Jan 2023 14:40:49 +0000 (15:40 +0100)] 
detect/frames: improve IPS and GAP handling

Inspect individual chunks in lossy traffic.

Don't use the frame idx as the inspection buffer idx. Engines are running
per frame, so multi inspection can be used for stream chunks instead.

Ticket: #4977.

2 years agodetect/frames: handle duplicate sigs in candidates
Victor Julien [Fri, 27 Jan 2023 11:37:32 +0000 (12:37 +0100)] 
detect/frames: handle duplicate sigs in candidates

Prefilter engines run on each stream chunk in a lossy stream, so
we can get the same sid in the list multiple times.

2 years agostream: add util to get absolute right edge of data
Victor Julien [Thu, 26 Jan 2023 14:39:45 +0000 (15:39 +0100)] 
stream: add util to get absolute right edge of data

2 years agodetect/frames: reduce scope of private function
Victor Julien [Thu, 26 Jan 2023 11:00:14 +0000 (12:00 +0100)] 
detect/frames: reduce scope of private function

2 years agooutput: move function name in non-release output
Victor Julien [Thu, 26 Jan 2023 14:46:08 +0000 (15:46 +0100)] 
output: move function name in non-release output

2 years agodetect/tls.certs: improve buffer init logic
Victor Julien [Sat, 28 Jan 2023 10:40:53 +0000 (11:40 +0100)] 
detect/tls.certs: improve buffer init logic

2 years agodetect/quic: update buffer initialization logic
Victor Julien [Sat, 28 Jan 2023 10:33:00 +0000 (11:33 +0100)] 
detect/quic: update buffer initialization logic