]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agoeve/metadata: create preformatted json string at start up
Victor Julien [Tue, 28 Jul 2020 15:23:50 +0000 (17:23 +0200)] 
eve/metadata: create preformatted json string at start up

Avoid runtime overhead of assembling metadata json string by
pre-creating it at rule parsing time.

5 years agodetect/profile: convert match dumps to jsonbuilder
Victor Julien [Tue, 28 Jul 2020 13:14:22 +0000 (15:14 +0200)] 
detect/profile: convert match dumps to jsonbuilder

Remove unused code and do minor misc cleanups as well.

5 years agopfring: fix compile warning 5234/head
Victor Julien [Mon, 27 Jul 2020 08:16:29 +0000 (10:16 +0200)] 
pfring: fix compile warning

5 years agoeve: remove unused json_t common functions
Victor Julien [Mon, 27 Jul 2020 17:48:08 +0000 (19:48 +0200)] 
eve: remove unused json_t common functions

These are no longer used as all callers have switched to
the JsonBuilder equivalents.

5 years agoeve/tls: minor cleanups
Victor Julien [Mon, 27 Jul 2020 17:28:22 +0000 (19:28 +0200)] 
eve/tls: minor cleanups

5 years agoeve/metadata: convert to jsonbuilder
Victor Julien [Mon, 27 Jul 2020 17:22:52 +0000 (19:22 +0200)] 
eve/metadata: convert to jsonbuilder

5 years agostream: call parser with 0 data on EOF
Victor Julien [Mon, 6 Jul 2020 10:05:08 +0000 (12:05 +0200)] 
stream: call parser with 0 data on EOF

This way both sides can call the EOF logic.

5 years agoapp-layer/tcp: don't use un-ACK'd data
Victor Julien [Mon, 6 Jul 2020 10:05:01 +0000 (12:05 +0200)] 
app-layer/tcp: don't use un-ACK'd data

Still use un-ACK'd data in unclean shutdown. This means any state
before TCP_CLOSED, or TCP_CLOSED that was caused by a RST.

5 years agoflow/timeout: flag last pseudo packet
Victor Julien [Fri, 3 Jul 2020 12:42:48 +0000 (14:42 +0200)] 
flow/timeout: flag last pseudo packet

Flag the last flow timeout pseudo packet so that we can force
TX logging w/o setting both app-layer flags.

Case this fixes:

1. flow times out when only TS TCP data received, but non of it is ACK'd.
   So there is no app-layer proto yet, or app state or Flow::alparser. So
   EOF flags can't be set.

2. Flow timeout sees no reason to create pseudo packet in TC direction.

3. TS pseudo packet finds HTTP, creates HTTP state, flag EOF TS.

4. TX logging skips HTTP logging because:
   - TC progress not reached
   - EOF TC flag not set.

The solution has been to flag the very last packet for the flow as such
and use it has a master-EOF flag.

5 years agostream/tcp: track if ssn has been closed with RST
Victor Julien [Fri, 3 Jul 2020 14:38:56 +0000 (16:38 +0200)] 
stream/tcp: track if ssn has been closed with RST

5 years agoapp-layer: set EOFs on app-layer disable
Victor Julien [Thu, 2 Jul 2020 20:31:02 +0000 (22:31 +0200)] 
app-layer: set EOFs on app-layer disable

5 years agoflow/worker: set EOF flags on change proto
Victor Julien [Thu, 2 Jul 2020 19:59:50 +0000 (21:59 +0200)] 
flow/worker: set EOF flags on change proto

5 years agoflow-timeout: set app-layer EOF flag
Victor Julien [Thu, 2 Jul 2020 19:58:48 +0000 (21:58 +0200)] 
flow-timeout: set app-layer EOF flag

5 years agoapp-layer: add debug
Victor Julien [Thu, 2 Jul 2020 19:57:04 +0000 (21:57 +0200)] 
app-layer: add debug

5 years agostream: minor debug fixup
Victor Julien [Thu, 2 Jul 2020 19:53:37 +0000 (21:53 +0200)] 
stream: minor debug fixup

5 years agoapp-layer/pd: improve size check in bail conditions
Victor Julien [Thu, 2 Jul 2020 19:25:46 +0000 (21:25 +0200)] 
app-layer/pd: improve size check in bail conditions

5 years agoapp-layer: split EOF flag per direction
Victor Julien [Tue, 16 Jun 2020 08:23:49 +0000 (10:23 +0200)] 
app-layer: split EOF flag per direction

5 years agostream: app update from loop
Victor Julien [Thu, 4 Jun 2020 19:12:15 +0000 (21:12 +0200)] 
stream: app update from loop

When the stream engine has data ready for the app-layer it will call
this API from a loop instead of just once. The loop is to ensure that
if we have a very lossy stream where between 'app_progress' and
'last_ack' there are multiple chunks of data and multiple gaps we
process all the chunks.

5 years agostream: improve gap handling with 'incomplete'
Victor Julien [Sun, 17 May 2020 12:22:59 +0000 (14:22 +0200)] 
stream: improve gap handling with 'incomplete'

Make sure stream requiring more data because of 'incomplete' records
properly move ahead if there is a GAP in the window of required data.

5 years agostream: fix IDS mode using un-ACK'd data
Victor Julien [Mon, 8 Jun 2020 13:24:00 +0000 (15:24 +0200)] 
stream: fix IDS mode using un-ACK'd data

5 years agostream: code cleanup
Victor Julien [Thu, 4 Jun 2020 18:29:53 +0000 (20:29 +0200)] 
stream: code cleanup

5 years agoflow/tcp: consider pkts established based on 3whs
Victor Julien [Wed, 25 Mar 2020 14:07:39 +0000 (15:07 +0100)] 
flow/tcp: consider pkts established based on 3whs

5 years agodetect/flow: test cleanup
Victor Julien [Wed, 25 Mar 2020 13:16:36 +0000 (14:16 +0100)] 
detect/flow: test cleanup

5 years agodetect/dns-query: Splice UT to rust
Jeff Lucovsky [Mon, 25 May 2020 15:03:23 +0000 (11:03 -0400)] 
detect/dns-query: Splice UT to rust

5 years agodns: Remove parser buffering code
Jeff Lucovsky [Mon, 11 May 2020 12:12:51 +0000 (08:12 -0400)] 
dns: Remove parser buffering code

5 years agosources: hide RegisterTests behind ifdef UNITTESTS 5216/head
Victor Julien [Fri, 24 Jul 2020 11:03:58 +0000 (13:03 +0200)] 
sources: hide RegisterTests behind ifdef UNITTESTS

Update callers.

5 years agoeve/ssh: change hassh logging format
Victor Julien [Fri, 24 Jul 2020 08:49:20 +0000 (10:49 +0200)] 
eve/ssh: change hassh logging format

Elastic search didn't accept the 'hassh' and 'hassh.string'. It would
see the first 'hassh' as a string and split the second key into a
object 'hassh' with a string member 'string'. So two different types
for 'hassh', so it rejected it.

This patch mimics the ja3(s) logging by creating a 'hassh' object
with 2 members: 'hash', which holds the md5 representation, and
'string' which holds the string representation.

5 years agoeve/ssh: minor cleanup
Victor Julien [Fri, 24 Jul 2020 08:36:55 +0000 (10:36 +0200)] 
eve/ssh: minor cleanup

5 years agodcerpc: adds invalid signature unit test
Philippe Antoine [Wed, 22 Jul 2020 19:51:40 +0000 (21:51 +0200)] 
dcerpc: adds invalid signature unit test

5 years agodcerpc: check app proto for signature keywords
Philippe Antoine [Mon, 13 Jul 2020 14:42:56 +0000 (16:42 +0200)] 
dcerpc: check app proto for signature keywords

5 years agodetect: hide RegisterTests behind ifdef UNITTESTS
Victor Julien [Tue, 21 Jul 2020 14:04:58 +0000 (16:04 +0200)] 
detect: hide RegisterTests behind ifdef UNITTESTS

Update all callers to more aggressively use UNITTESTS guards as well.

5 years agoftp: fix direction of expectation for STOR command
Xiaofan Wang [Thu, 19 Mar 2020 15:50:48 +0000 (23:50 +0800)] 
ftp: fix direction of expectation for STOR command

Fix direction in active mode.

5 years agosip: minor cleanup
Victor Julien [Tue, 21 Jul 2020 10:58:44 +0000 (12:58 +0200)] 
sip: minor cleanup

5 years agohtp: minor UNITTESTS guarding cleanup
Victor Julien [Tue, 21 Jul 2020 09:45:45 +0000 (11:45 +0200)] 
htp: minor UNITTESTS guarding cleanup

5 years agoftp: small code cleanup
Victor Julien [Sun, 20 Oct 2019 18:22:41 +0000 (20:22 +0200)] 
ftp: small code cleanup

5 years agogitignore: add .vscode and various other files
Victor Julien [Fri, 24 Jul 2020 07:54:26 +0000 (09:54 +0200)] 
gitignore: add .vscode and various other files

5 years agoftp: Restrict file name lengths 5212/head
Jeff Lucovsky [Mon, 3 Feb 2020 14:44:08 +0000 (09:44 -0500)] 
ftp: Restrict file name lengths

Restrict file name lengths to PATH_MAX - 1 to avoid over subscribing
memory to FTP file name tracking.

5 years agobytetest: use ByteExtractString instead of StringParse 5207/head
Shivani Bhardwaj [Tue, 21 Jul 2020 08:16:18 +0000 (13:46 +0530)] 
bytetest: use ByteExtractString instead of StringParse

5 years agoutil: fix trailing char check with ByteExtractString
Shivani Bhardwaj [Tue, 21 Jul 2020 07:58:06 +0000 (13:28 +0530)] 
util: fix trailing char check with ByteExtractString

5 years agossh: fixing incomplete kex parsing
Philippe Antoine [Mon, 13 Jul 2020 12:29:27 +0000 (14:29 +0200)] 
ssh: fixing incomplete kex parsing

We use the record length from the ssh record header,
and not the size of the parsed data, as is done in other places.

5 years agonfs: fix 'dangling' files in lossy sessions
Victor Julien [Mon, 20 Jul 2020 12:49:59 +0000 (14:49 +0200)] 
nfs: fix 'dangling' files in lossy sessions

In case of lossy connections the NFS state would properly clean up
transactions, including file transactions. However for files the
state was never set to 'truncated', leading to files to stay 'active'.

This would lead these files staying in the NFS's state. In long running
sessions with lots of files this would lead to performance and memory
use issues.

This patch cleans truncates the file that was being transmitted when
a file transaction is being closed.

Based on 65e9a7c31cc68bdb1fb3e1412b0a56260265c608

5 years agonfs: check post-gap timeouts once a second at most
Victor Julien [Mon, 20 Jul 2020 12:30:39 +0000 (14:30 +0200)] 
nfs: check post-gap timeouts once a second at most

Based on 25f2efe97749611760e6e26d388b420091423732

5 years agonfs: update ts only if it changed
Victor Julien [Mon, 20 Jul 2020 12:18:52 +0000 (14:18 +0200)] 
nfs: update ts only if it changed

Based on 8aa380600da15b95e74a6649e6003a1c484c4ce0

5 years agordp: remove parser buffering code
Zach Kelly [Sat, 18 Jul 2020 01:00:54 +0000 (21:00 -0400)] 
rdp: remove parser buffering code

5 years agordp/eve: convert to jsonbuilder
Zach Kelly [Sat, 18 Jul 2020 00:58:48 +0000 (20:58 -0400)] 
rdp/eve: convert to jsonbuilder

5 years agordp: rustfmt (update)
Zach Kelly [Sat, 18 Jul 2020 00:57:08 +0000 (20:57 -0400)] 
rdp: rustfmt (update)

5 years agothreads/runmode: Changes to thread config behaviour
Joshua Lumb [Fri, 17 Jul 2020 13:29:20 +0000 (09:29 -0400)] 
threads/runmode: Changes to thread config behaviour

5 years agogh-checks: Add enable-debug-validation to test 5190/head
Shivani Bhardwaj [Wed, 20 May 2020 19:57:46 +0000 (01:27 +0530)] 
gh-checks: Add enable-debug-validation to test

5 years agotravis: add test for enable-debug-validation
Shivani Bhardwaj [Tue, 19 May 2020 18:07:36 +0000 (23:37 +0530)] 
travis: add test for enable-debug-validation

5 years agojsonbuilder: run test if not debug-validate
Shivani Bhardwaj [Wed, 15 Jul 2020 11:58:14 +0000 (17:28 +0530)] 
jsonbuilder: run test if not debug-validate

5 years agosip: remove extra jsonbuilder close
Shivani Bhardwaj [Wed, 15 Jul 2020 17:07:58 +0000 (22:37 +0530)] 
sip: remove extra jsonbuilder close

5 years agodcerpc: fix tests to have a valid header
Shivani Bhardwaj [Fri, 5 Jun 2020 14:35:21 +0000 (20:05 +0530)] 
dcerpc: fix tests to have a valid header

5 years agologging: Add DCERPC logger
Shivani Bhardwaj [Tue, 21 Apr 2020 09:08:09 +0000 (14:38 +0530)] 
logging: Add DCERPC logger

5 years agodcerpc: Add multi transaction support
Shivani Bhardwaj [Fri, 5 Jun 2020 13:48:05 +0000 (19:18 +0530)] 
dcerpc: Add multi transaction support

DCERPC parser so far provided support for single transactions only.
Extend that to support multiple transactions.

In order for multiple transactions to work, there is always a
transaction identifier for any protocol in its header that lets a
response match the request. In DCERPC, for TCP, that param is call_id in
the header which is a 32 bit field. For UDP, however since it uses
different version of RPC (4.x), this is defined by serial number field
defined in the header. This field however is not contiguous and needs to
be assembled by the provided serial_low and serial_hi fields.

5 years agodetect/mpm: fix hs check 5188/head
Victor Julien [Wed, 15 Jul 2020 07:22:12 +0000 (09:22 +0200)] 
detect/mpm: fix hs check

5 years agodoc: fix spelling in flowbits image
Tristan Fletcher [Tue, 14 Apr 2020 20:57:13 +0000 (15:57 -0500)] 
doc: fix spelling in flowbits image

5 years agopcap: 32bit counters can wrap-around
Roland Fischer [Thu, 28 May 2020 05:58:00 +0000 (01:58 -0400)] 
pcap: 32bit counters can wrap-around

Fixes issue 2845.

pcap_stats is based on 32bit counters and given a big enough throughput
will overflow them. This was reported by people using Myricom cards which
should only be a happenstance. The problem exists for all pcap-based
interfaces.

Let's use internal 64bit counters that drag along the pcap_stats and
handle pcap_stats wrap-around as we update the 64bit stats "often enough"
before the pcap_stats can wrap around twice.

5 years agokrb: convert to jsonbuilder
Shivani Bhardwaj [Fri, 10 Jul 2020 19:32:10 +0000 (01:02 +0530)] 
krb: convert to jsonbuilder

Closes redmine ticket 3754.

5 years agosnmp: convert to jsonbuilder
Shivani Bhardwaj [Fri, 10 Jul 2020 18:55:10 +0000 (00:25 +0530)] 
snmp: convert to jsonbuilder

Closes redmine ticket 3756.

5 years agogithub-ci: build rust doc on stable and 1.34.2
Jason Ish [Mon, 6 Jul 2020 19:21:20 +0000 (13:21 -0600)] 
github-ci: build rust doc on stable and 1.34.2

Nothing is done with the rustdoc, its just build to make
sure it builds with our supported versions of Rust

5 years agorust: add doc target to build rust docs
Jason Ish [Mon, 6 Jul 2020 19:17:26 +0000 (13:17 -0600)] 
rust: add doc target to build rust docs

Uses "cargo doc --no-deps" to build the documentation just for
our Suricata package. Without --no-deps, documentation will be
build for all our dependencies as well.

The generated documentation will end up in target/doc as HTML.

5 years agoapplayer template (rust): better gap handling example 5184/head
Jason Ish [Tue, 14 Jul 2020 06:02:59 +0000 (00:02 -0600)] 
applayer template (rust): better gap handling example

In the request parser, show checking if a gap was received
and what one example of trying to continue might look like.

5 years agoapplayer template (rust): incomplete support
Jason Ish [Mon, 13 Jul 2020 18:29:01 +0000 (12:29 -0600)] 
applayer template (rust): incomplete support

Show how to use the incomplete AppLayerResult type within the
limits of what the template protocol parser can provide.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3541

5 years agorust app-layer template: add stubs for gap handling
Jason Ish [Mon, 13 Jul 2020 16:53:24 +0000 (10:53 -0600)] 
rust app-layer template: add stubs for gap handling

5 years agorust/dns: use new flags field to set parser option flags
Jason Ish [Mon, 13 Jul 2020 16:32:51 +0000 (10:32 -0600)] 
rust/dns: use new flags field to set parser option flags

5 years agoapplayer: add flags to parser registration struct
Jason Ish [Mon, 13 Jul 2020 16:24:24 +0000 (10:24 -0600)] 
applayer: add flags to parser registration struct

This will allow Rust parsers to register for gap handing from
Rust (some Rust parsers do handle gaps, but they set the flag
from C).

5 years agotemplate: add gap handling
Jason Ish [Fri, 31 Aug 2018 04:59:56 +0000 (22:59 -0600)] 
template: add gap handling

5 years agodoc/userguide: fix outdated mpm info 5183/head
Victor Julien [Tue, 14 Jul 2020 10:05:21 +0000 (12:05 +0200)] 
doc/userguide: fix outdated mpm info

5 years agodetect/mpm: 'mpm-algo' parsing cleanups
Victor Julien [Tue, 14 Jul 2020 09:42:55 +0000 (11:42 +0200)] 
detect/mpm: 'mpm-algo' parsing cleanups

5 years agoflow: fix unlikely issue with int handling
Victor Julien [Tue, 14 Jul 2020 08:48:57 +0000 (10:48 +0200)] 
flow: fix unlikely issue with int handling

Thanks for reporting this magenbluten PR 4575.

5 years agodoc/suricata-update: fix typo and do minor cleanups
Victor Julien [Tue, 14 Jul 2020 08:42:43 +0000 (10:42 +0200)] 
doc/suricata-update: fix typo and do minor cleanups

Thanks to showipintbri PR 4465.

5 years agobuildbot-pcaps: remove redundant sudo
Zackeus Bengtsson [Thu, 5 Mar 2020 16:06:42 +0000 (17:06 +0100)] 
buildbot-pcaps: remove redundant sudo

5 years agosuricatasc: updates copyright date and FSF address
jason taylor [Mon, 24 Feb 2020 13:15:53 +0000 (08:15 -0500)] 
suricatasc: updates copyright date and FSF address

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agosuricatasc: update copyright date and FSF address
jason taylor [Mon, 24 Feb 2020 13:14:47 +0000 (08:14 -0500)] 
suricatasc: update copyright date and FSF address

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agoprscript: update copyright dates and FSF address
jason taylor [Mon, 24 Feb 2020 13:14:01 +0000 (08:14 -0500)] 
prscript: update copyright dates and FSF address

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agodetect/stream_size: minor code cleanups 5170/head
Victor Julien [Sat, 11 Jul 2020 14:28:17 +0000 (16:28 +0200)] 
detect/stream_size: minor code cleanups

5 years agodns: conditional logging 5168/head 5169/head
Jason Ish [Sun, 7 Jun 2020 12:07:26 +0000 (14:07 +0200)] 
dns: conditional logging

Apply config to newly created response TX.

5 years agodetect/config: set config for special cases
Victor Julien [Sat, 6 Jun 2020 17:02:28 +0000 (19:02 +0200)] 
detect/config: set config for special cases

Allow app-layer to declare the txs are uni-directional and special
care is needed for applying config.

5 years agodetect/config: initial version
Victor Julien [Fri, 6 Mar 2020 11:34:34 +0000 (12:34 +0100)] 
detect/config: initial version

5 years agoapp-layer: handle AppLayerTxData being NULL
Victor Julien [Sun, 7 Jun 2020 20:41:11 +0000 (22:41 +0200)] 
app-layer: handle AppLayerTxData being NULL

Http parser can have 'NULL' user data in case of memcap limit getting
reached.

5 years agoapp-layer: remove unused detect flags API
Victor Julien [Sun, 7 Jun 2020 19:29:43 +0000 (21:29 +0200)] 
app-layer: remove unused detect flags API

5 years agoapp-layer/rust: don't use option for GetTxDataFn anymore
Victor Julien [Sun, 7 Jun 2020 19:21:05 +0000 (21:21 +0200)] 
app-layer/rust: don't use option for GetTxDataFn anymore

5 years agoapp-layer: GetTxData callback is mandatory
Victor Julien [Sun, 7 Jun 2020 19:13:32 +0000 (21:13 +0200)] 
app-layer: GetTxData callback is mandatory

5 years agoapp-layer: remove DetectFlags API. Replaced by AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:45:40 +0000 (16:45 +0200)] 
app-layer: remove DetectFlags API. Replaced by AppLayerTxData

5 years agordp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 19:13:02 +0000 (21:13 +0200)] 
rdp: support AppLayerTxData

5 years agoapp-layer: remove logged API calls
Victor Julien [Sun, 7 Jun 2020 18:57:19 +0000 (20:57 +0200)] 
app-layer: remove logged API calls

5 years agotemplate: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 18:56:16 +0000 (20:56 +0200)] 
template: support AppLayerTxData

5 years agotftp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 18:38:44 +0000 (20:38 +0200)] 
tftp: support AppLayerTxData

5 years agosip: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 18:19:59 +0000 (20:19 +0200)] 
sip: support AppLayerTxData

5 years agontp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 18:12:46 +0000 (20:12 +0200)] 
ntp: support AppLayerTxData

5 years agoikev2: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 18:04:49 +0000 (20:04 +0200)] 
ikev2: support AppLayerTxData

5 years agoapplayer/template: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 17:55:35 +0000 (19:55 +0200)] 
applayer/template: support AppLayerTxData

5 years agodhcp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 17:48:47 +0000 (19:48 +0200)] 
dhcp: support AppLayerTxData

5 years agosnmp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 15:28:58 +0000 (17:28 +0200)] 
snmp: support AppLayerTxData

5 years agorfb: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 15:24:21 +0000 (17:24 +0200)] 
rfb: support AppLayerTxData

5 years agokrb5: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 15:16:38 +0000 (17:16 +0200)] 
krb5: support AppLayerTxData

5 years agossh: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 15:06:46 +0000 (17:06 +0200)] 
ssh: support AppLayerTxData

5 years agodcerpc/udp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:36:58 +0000 (16:36 +0200)] 
dcerpc/udp: support AppLayerTxData

5 years agodcerpc: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:30:58 +0000 (16:30 +0200)] 
dcerpc: support AppLayerTxData

5 years agomodbus: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:23:43 +0000 (16:23 +0200)] 
modbus: support AppLayerTxData