]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
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

5 years agoenip: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:20:35 +0000 (16:20 +0200)] 
enip: support AppLayerTxData

5 years agossl/tls: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:16:57 +0000 (16:16 +0200)] 
ssl/tls: support AppLayerTxData

5 years agosmtp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:13:46 +0000 (16:13 +0200)] 
smtp: support AppLayerTxData

5 years agoftp: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 14:06:01 +0000 (16:06 +0200)] 
ftp: support AppLayerTxData

5 years agodnp3: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 13:49:04 +0000 (15:49 +0200)] 
dnp3: support AppLayerTxData

5 years agosmb: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 13:42:18 +0000 (15:42 +0200)] 
smb: support AppLayerTxData

5 years agonfs: support AppLayerTxData
Victor Julien [Sun, 7 Jun 2020 12:26:56 +0000 (14:26 +0200)] 
nfs: support AppLayerTxData

5 years agodns: remove detect_flags and logged now that we use AppLayerTxData
Victor Julien [Tue, 26 May 2020 13:12:15 +0000 (15:12 +0200)] 
dns: remove detect_flags and logged now that we use AppLayerTxData

5 years agohtp: support AppLayerTxData
Victor Julien [Wed, 18 Mar 2020 17:06:17 +0000 (18:06 +0100)] 
htp: support AppLayerTxData

5 years agoapp-layer: add ApplyTxConfig API
Victor Julien [Sun, 7 Jun 2020 11:42:09 +0000 (13:42 +0200)] 
app-layer: add ApplyTxConfig API

Optional callback a parser can register for applying configuration
to the 'transaction'. Most parsers have a bidirectional tx. For those
parsers that have different types of transaction handling, this new
callback can be used to properly apply the config.

5 years agooutput/tx: implement filtering
Victor Julien [Wed, 18 Mar 2020 14:27:34 +0000 (15:27 +0100)] 
output/tx: implement filtering

5 years agodetect: store detect flags in AppLayerTxData
Victor Julien [Tue, 26 May 2020 12:34:57 +0000 (14:34 +0200)] 
detect: store detect flags in AppLayerTxData

5 years agoapp-layer: add logger flags to AppLayerTxData
Victor Julien [Tue, 26 May 2020 10:39:44 +0000 (12:39 +0200)] 
app-layer: add logger flags to AppLayerTxData

5 years agoapp-layer: define AppLayerTxData and AppLayerTxConfig
Victor Julien [Wed, 18 Mar 2020 13:08:37 +0000 (14:08 +0100)] 
app-layer: define AppLayerTxData and AppLayerTxConfig

AppLayerTxData is a structure each tx should include that will contain
the common fields the engine needs for tracking logging, detection and
possibly other things.

AppLayerTxConfig will be used by the detection engine to configure
the transaction.

5 years agohtp: alloc user data at tx start
Victor Julien [Sun, 7 Jun 2020 20:22:05 +0000 (22:22 +0200)] 
htp: alloc user data at tx start

This way the AppLayerTxData is set up from the start. Any type of
processing (logging, detection) will lead to setting up the user
data later on anyway.

Remove other places where it was added.

5 years agoconfig: common definitions
Victor Julien [Wed, 18 Mar 2020 19:50:47 +0000 (20:50 +0100)] 
config: common definitions

5 years agorules: add config action
Victor Julien [Wed, 18 Mar 2020 20:01:54 +0000 (21:01 +0100)] 
rules: add config action

5 years agodnp3/eve: update for regenerated dnp3 object logging code
Jason Ish [Fri, 10 Jul 2020 21:43:33 +0000 (15:43 -0600)] 
dnp3/eve: update for regenerated dnp3 object logging code

Migration from Jansson to JsonBuilder.

5 years agodnp3/eve: regenerator object logging code
Jason Ish [Fri, 10 Jul 2020 21:43:19 +0000 (15:43 -0600)] 
dnp3/eve: regenerator object logging code

5 years agoscripts/dnp3-gen: update to generate JsonBuilder code
Jason Ish [Fri, 10 Jul 2020 21:42:41 +0000 (15:42 -0600)] 
scripts/dnp3-gen: update to generate JsonBuilder code

5 years agojsonbuilder: set_float, append_float methods
Jason Ish [Fri, 10 Jul 2020 19:46:41 +0000 (13:46 -0600)] 
jsonbuilder: set_float, append_float methods

New methods for setting and appending float values.

5 years agodnp3/eve: convert to jsonbuilder (non generated code)
Jason Ish [Fri, 10 Jul 2020 19:22:09 +0000 (13:22 -0600)] 
dnp3/eve: convert to jsonbuilder (non generated code)

First step of converting DNP3 to JsonBuilder by first converting
the non-generated code.

5 years agoscript/dnp3-gen: update generator to reflect in tree changes
Jason Ish [Fri, 10 Jul 2020 19:19:35 +0000 (13:19 -0600)] 
script/dnp3-gen: update generator to reflect in tree changes

Some changes were made to the generated files instead of the
generator script. Update the script to generate what is
in the current state of the in-tree generated files.

5 years agosrc: use FatalError whenever possible
Shivani Bhardwaj [Thu, 9 Jul 2020 09:01:01 +0000 (14:31 +0530)] 
src: use FatalError whenever possible

Replaces all patterns of SCLogError() followed by exit() with
FatalError(). Cocci script to do this:

@@
constant C;
constant char[] msg;
@@

- SCLogError(C,
+ FatalError(SC_ERR_FATAL,
  msg);
- exit(EXIT_FAILURE);

Closes redmine ticket 3188.

5 years agodoc: Add byte_math documentation
Jeff Lucovsky [Sun, 3 May 2020 14:36:17 +0000 (10:36 -0400)] 
doc: Add byte_math documentation

5 years agogeneral: Correct typos
Jeff Lucovsky [Mon, 27 Jan 2020 00:39:15 +0000 (19:39 -0500)] 
general: Correct typos

5 years agodetect: byte_math support
Jeff Lucovsky [Sun, 3 May 2020 13:00:04 +0000 (09:00 -0400)] 
detect: byte_math support

5 years agodetect: Use byte-math to byte var handling func
Jeff Lucovsky [Sun, 3 May 2020 12:55:37 +0000 (08:55 -0400)] 
detect: Use byte-math to byte var handling func

5 years agodetect: Add byte_math detector
Jeff Lucovsky [Mon, 27 Jan 2020 00:27:22 +0000 (19:27 -0500)] 
detect: Add byte_math detector

5 years agodetect: Add utility module for byte var handling
Jeff Lucovsky [Sun, 3 May 2020 12:55:04 +0000 (08:55 -0400)] 
detect: Add utility module for byte var handling

5 years agoeve/alert: minor cleanups 5164/head
Victor Julien [Fri, 10 Jul 2020 13:31:24 +0000 (15:31 +0200)] 
eve/alert: minor cleanups

5 years agoeve/alert: move files logging into util func
Victor Julien [Fri, 10 Jul 2020 13:26:53 +0000 (15:26 +0200)] 
eve/alert: move files logging into util func

5 years agoeve/alert: move app-layer logic into a util func
Victor Julien [Fri, 10 Jul 2020 13:21:59 +0000 (15:21 +0200)] 
eve/alert: move app-layer logic into a util func

5 years agohyperscan: better error message if not compiled
Shivani Bhardwaj [Wed, 1 Jul 2020 11:59:01 +0000 (17:29 +0530)] 
hyperscan: better error message if not compiled

5 years agossh: fix incomplete return for ssh kex
Philippe Antoine [Fri, 10 Jul 2020 07:40:49 +0000 (09:40 +0200)] 
ssh: fix incomplete return for ssh kex

In the case where we already parsed some records

5 years agodcerpc: detect right parsing of empty op version
Philippe Antoine [Fri, 10 Jul 2020 08:50:36 +0000 (10:50 +0200)] 
dcerpc: detect right parsing of empty op version

5 years agorfb: set app proto for signature keyword rfb.secresult
Philippe Antoine [Fri, 10 Jul 2020 08:38:14 +0000 (10:38 +0200)] 
rfb: set app proto for signature keyword rfb.secresult

5 years agosuricata.yaml.in: update stream-depth description
Jeff Lucovsky [Wed, 25 Sep 2019 20:49:48 +0000 (16:49 -0400)] 
suricata.yaml.in: update stream-depth description

5 years agodoc: update stream-depth description
Jeff Lucovsky [Wed, 25 Sep 2019 20:47:49 +0000 (16:47 -0400)] 
doc: update stream-depth description

5 years agodoc: update file-store stream depth description
Jeff Lucovsky [Wed, 25 Sep 2019 20:44:33 +0000 (16:44 -0400)] 
doc: update file-store stream depth description

5 years agofilestore: Use proper string in error case
Jeff Lucovsky [Mon, 23 Sep 2019 23:44:00 +0000 (19:44 -0400)] 
filestore: Use proper string in error case

When make-open-files has an invalid value, the incorrect value was being
displayed improperly

5 years agofilestore: Validate stream-depth when non-zero
Jeff Lucovsky [Mon, 23 Sep 2019 23:43:14 +0000 (19:43 -0400)] 
filestore: Validate stream-depth when non-zero

Make sure that configured non-zero values for stream-depth are
greater than stream_config.depth

5 years agooutput/json: Correct clang warning 5163/head
Jeff Lucovsky [Fri, 10 Jul 2020 12:42:37 +0000 (08:42 -0400)] 
output/json: Correct clang warning

This commit corrects the warning for mismatched type.

5 years agooutput/alert: Correct FORWARD_NULL Coverity issue.
Jeff Lucovsky [Fri, 10 Jul 2020 12:23:56 +0000 (08:23 -0400)] 
output/alert: Correct FORWARD_NULL Coverity issue.

This commit corrects the FORWARD_NULL issue in AlertJson by
null-checking p->flow

5 years agooutput/ftp: Correct Coverity DEADCODE issue
Jeff Lucovsky [Fri, 10 Jul 2020 12:22:43 +0000 (08:22 -0400)] 
output/ftp: Correct Coverity DEADCODE issue

This commit corrects the deadcode (CID 1465224) issue in
EveFTPLogCommand.

5 years agofilestore: Correct Coverity RESOURCE_LEAK issue
Jeff Lucovsky [Fri, 10 Jul 2020 12:19:51 +0000 (08:19 -0400)] 
filestore: Correct Coverity RESOURCE_LEAK issue

This commit corrects the RESOURCE_LEAK issue (CID 1465222) of the `FILE`
pointer.

5 years agodetect: Correct Coverity REVERSE_INULL issue
Jeff Lucovsky [Fri, 10 Jul 2020 12:16:06 +0000 (08:16 -0400)] 
detect: Correct Coverity REVERSE_INULL issue

This commit corrects the "Null pointer dereferences" issue (CID
1465221).

5 years agoqa: add atoi to list of banned functions 5148/head
Shivani Bhardwaj [Wed, 8 Jul 2020 19:31:49 +0000 (01:01 +0530)] 
qa: add atoi to list of banned functions

5 years agopfring: fix StringParse* warnings
Shivani Bhardwaj [Wed, 1 Jul 2020 18:14:50 +0000 (23:44 +0530)] 
pfring: fix StringParse* warnings

Closes redmine ticket 3808.

5 years agottl: Make IPV4 TTL uint_8t
Shivani Bhardwaj [Sun, 22 Dec 2019 06:04:43 +0000 (11:34 +0530)] 
ttl: Make IPV4 TTL uint_8t

5 years agosrc: remove multiple uses of atoi
Shivani Bhardwaj [Sun, 22 Dec 2019 05:51:17 +0000 (11:21 +0530)] 
src: remove multiple uses of atoi

atoi() and related functions lack a mechanism for reporting errors for
invalid values. Replace them with calls to the appropriate
ByteExtractString* functions.

Partially closes redmine ticket 3053.

5 years agodetect/asn1: Simplify errors and checks
Emmanuel Thompson [Wed, 3 Jun 2020 18:37:30 +0000 (14:37 -0400)] 
detect/asn1: Simplify errors and checks

5 years agodetect/asn1: Update ASN1 struct lifetime
Emmanuel Thompson [Thu, 30 Apr 2020 13:53:10 +0000 (09:53 -0400)] 
detect/asn1: Update ASN1 struct lifetime

- 'static is only realistic when allocating and leaking it over the
FFI boundary

5 years agodetect/asn1: Log out errors
Emmanuel Thompson [Wed, 29 Apr 2020 17:10:06 +0000 (13:10 -0400)] 
detect/asn1: Log out errors

- Failure to parse asn1-max-frames
- Failure on asn1 detection checks

5 years agodetect/asn1: Update relative_offset keyword
Emmanuel Thompson [Wed, 20 May 2020 14:58:34 +0000 (10:58 -0400)] 
detect/asn1: Update relative_offset keyword

- To be consistent with recent C version changes
- Add checks for over/underflows

5 years agodetect/asn1: Remove asn1 C parser
Emmanuel Thompson [Mon, 27 Apr 2020 17:18:37 +0000 (13:18 -0400)] 
detect/asn1: Remove asn1 C parser

- In favor of rust parser

5 years agodetect/asn1: Update asn1 C files to use rust code
Emmanuel Thompson [Tue, 28 Apr 2020 15:12:04 +0000 (11:12 -0400)] 
detect/asn1: Update asn1 C files to use rust code

Mark rust extern "C" functions as pub in asn1 module to expose via cbindgen
Update detect-asn1.c/h to use rust functions

5 years agorust/asn1: Introduce ASN1 rust module
Emmanuel Thompson [Mon, 27 Apr 2020 20:27:22 +0000 (16:27 -0400)] 
rust/asn1: Introduce ASN1 rust module

This module uses the `der-parser` crate to parse ASN1 objects in order to replace src/util-decode-asn1.c
It also handles the parsing of the asn1 keyword rules and detection checks performed in src/detect-asn1.c

5 years agorust: Update der, kerberos and snmp parser dependencies
Emmanuel Thompson [Mon, 27 Apr 2020 17:09:20 +0000 (13:09 -0400)] 
rust: Update der, kerberos and snmp parser dependencies

- The update to der-parser allows us to use the latest API changes

5 years agoutil/proto: Convert validation routine to bool 5146/head
Jeff Lucovsky [Sun, 31 May 2020 12:20:28 +0000 (08:20 -0400)] 
util/proto: Convert validation routine to bool

This commit changes the signature of the protocol validation code to
bool and simplifies the validation steps.

5 years agooutput/json: Improve protocol output handling
Jeff Lucovsky [Sun, 31 May 2020 12:19:31 +0000 (08:19 -0400)] 
output/json: Improve protocol output handling

Improve protocol label handling by eliminating an unneeded copy.

Additionally, unknown protocol values are no longer zero-padded.

5 years agooutput/flow: Improve protocol output handling
Jeff Lucovsky [Sun, 31 May 2020 12:18:02 +0000 (08:18 -0400)] 
output/flow: Improve protocol output handling

This commit improves handling of the protocol label by removing an
unnecessary copy.

Additionally, unknown protocol values are no longer zero-padded.

5 years agolog/syslog: Improve protocol output handling
Jeff Lucovsky [Mon, 1 Jun 2020 14:23:12 +0000 (10:23 -0400)] 
log/syslog: Improve protocol output handling

Move protocol handling outside of the packet alert loop.

5 years agolog: Use updated SCProtoNameValid signature
Jeff Lucovsky [Mon, 1 Jun 2020 14:00:04 +0000 (10:00 -0400)] 
log: Use updated SCProtoNameValid signature

5 years agooutput/lua: Remove unused proto code
Jeff Lucovsky [Sun, 31 May 2020 12:07:33 +0000 (08:07 -0400)] 
output/lua: Remove unused proto code

This commit removes unused protocol string handling logic.

5 years agoapplayer template (rust): convert to JsonBuilder
Jason Ish [Tue, 7 Jul 2020 06:04:13 +0000 (00:04 -0600)] 
applayer template (rust): convert to JsonBuilder

5 years agoapplayer template (C): convert to JsonBuilder
Jason Ish [Tue, 7 Jul 2020 06:03:55 +0000 (00:03 -0600)] 
applayer template (C): convert to JsonBuilder

5 years agomodbus: align comments properly 5144/head
Shivani Bhardwaj [Wed, 8 Jul 2020 07:11:43 +0000 (12:41 +0530)] 
modbus: align comments properly

5 years agomodbus: make subfunction uint16_t
Shivani Bhardwaj [Wed, 8 Jul 2020 07:10:46 +0000 (12:40 +0530)] 
modbus: make subfunction uint16_t

5 years agoenip: remove unnecessarry definition
Shivani Bhardwaj [Fri, 26 Jun 2020 06:51:09 +0000 (12:21 +0530)] 
enip: remove unnecessarry definition

5 years agosrc: remove multiple uses of atoi
Shivani Bhardwaj [Tue, 23 Jun 2020 07:54:24 +0000 (13:24 +0530)] 
src: remove multiple uses of atoi

atoi() and related functions lack a mechanism for reporting errors for
invalid values. Replace them with calls to the appropriate
ByteExtractString* functions.

Closes redmine ticket 3053.

5 years agofuzz/sigpcap: make sure hassh is enabled
Victor Julien [Tue, 7 Jul 2020 19:27:08 +0000 (21:27 +0200)] 
fuzz/sigpcap: make sure hassh is enabled

5 years agouserguide: add documentation for Hassh usage 5141/head
Vadym Malakhatko [Tue, 30 Jun 2020 11:42:26 +0000 (14:42 +0300)] 
userguide: add documentation for Hassh usage

1. Rules keywords
2. Json keywords
3. Usage in lua
4. Enabling in configuration file

5 years agolua: add functions to get hassh parameters
Vadym Malakhatko [Tue, 30 Jun 2020 11:14:52 +0000 (14:14 +0300)] 
lua: add functions to get hassh parameters

5 years agoeve: add Hassh fields to SSH JSON logger and add ssh log condition
Vadym Malakhatko [Tue, 7 Jul 2020 14:05:36 +0000 (17:05 +0300)] 
eve: add Hassh fields to SSH JSON logger and add ssh log condition