]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agoci: adds a build with make tags 4776/head
Philippe Antoine [Fri, 3 Apr 2020 13:31:59 +0000 (15:31 +0200)] 
ci: adds a build with make tags

5 years agoconfigure: correctly display nss/nspr status
Eric Leblond [Tue, 11 Feb 2020 14:21:39 +0000 (16:21 +0200)] 
configure: correctly display nss/nspr status

If autodiscovery of libnss was used (default), then the line
 libnss support:                          yes
was never set to no.

Same behavior for libnspr.

Broken by commit 'configure: fix nspr check logic' (7ea269a212a3a2209effc3cc9300873d6a06859e)

5 years agoflow: cleanup expectations first
Victor Julien [Fri, 3 Apr 2020 08:09:07 +0000 (10:09 +0200)] 
flow: cleanup expectations first

Make sure to cleanup expectations for a flow as the first step, before
parts of the flow itself are getting cleaned/freed.

Also indicate use unlikely as flows with expectations should be relatively
rare.

5 years agoapp-layer-expectation: update copyright date
Eric Leblond [Sun, 9 Feb 2020 19:33:21 +0000 (20:33 +0100)] 
app-layer-expectation: update copyright date

5 years agoapp-layer-expectation: clean expectation at flow end
Eric Leblond [Fri, 7 Feb 2020 23:05:01 +0000 (00:05 +0100)] 
app-layer-expectation: clean expectation at flow end

When a flow timeout, we can have still existing expectations that
are linked to this flow. Given that there is a delay between the
real ending of the flow and its destruction by Suricata, the
expectation should be already honored so we can assume the risk
to clean the expectations that have been triggered by the
to-be-deleted flow.

5 years agoapp-layer-expectation: limit number of expectations
Eric Leblond [Fri, 7 Feb 2020 23:01:28 +0000 (00:01 +0100)] 
app-layer-expectation: limit number of expectations

This patch introduces a limitation in term of number of
expectations attached to one IPPair. This is done using
a circle list so we have a FIFO approach on expectation
handling.

Circleq list code is copied from BSD code like was pre existing code
in queue.h.

5 years agoapp-layer-expectation: remove unused parameter
Eric Leblond [Tue, 10 Dec 2019 21:15:14 +0000 (22:15 +0100)] 
app-layer-expectation: remove unused parameter

5 years agotests/bsize: Fuzzing test case added 4765/head
Jeff Lucovsky [Tue, 31 Mar 2020 12:46:38 +0000 (08:46 -0400)] 
tests/bsize: Fuzzing test case added

This commit adds a test case to validate the issue found during fuzz
testing.

5 years agodetect/bsize: Ensure numeric values fit
Jeff Lucovsky [Mon, 30 Mar 2020 13:51:27 +0000 (09:51 -0400)] 
detect/bsize: Ensure numeric values fit

This commit ensures that the numeric values will not exceed the size of
the containers used to hold them.

5 years agodetect/parse: fix crash on 'internal' keyword use
Victor Julien [Tue, 31 Mar 2020 12:04:07 +0000 (14:04 +0200)] 
detect/parse: fix crash on 'internal' keyword use

When keyword __flowvar__postmatch__, an internal keyword, is used
in a rule the 'Setup' func ptr will be NULL. This caused a crash.

5 years agofuzz/siginit: fix leak in case of bidir sig
Victor Julien [Tue, 31 Mar 2020 11:53:40 +0000 (13:53 +0200)] 
fuzz/siginit: fix leak in case of bidir sig

5 years agofuzz/siginit: minor improvements
Victor Julien [Tue, 31 Mar 2020 11:32:35 +0000 (13:32 +0200)] 
fuzz/siginit: minor improvements

Enable detect engine 'quiet' mode to generate less output.

Set a fake filename so that datarep doesn't hit a reachable assert.

5 years agodetect/pkt_data: error on unconsumed transforms
Victor Julien [Tue, 31 Mar 2020 08:38:06 +0000 (10:38 +0200)] 
detect/pkt_data: error on unconsumed transforms

If a rule has transforms w/o consuming them (e.g. a content keyword),
don't consider 'pkt_data' valid.

5 years agodetect/pkt_data: code and test cleanup
Victor Julien [Tue, 31 Mar 2020 09:37:51 +0000 (11:37 +0200)] 
detect/pkt_data: code and test cleanup

5 years agodetect: more robust against transform issues
Victor Julien [Tue, 31 Mar 2020 08:35:54 +0000 (10:35 +0200)] 
detect: more robust against transform issues

In case of transform issues (transform not consumed before pkt_data
for example), the code would hit an ugly BUG_ON.

Address this by a more graceful error message, that will still
invalidate the sig but not crash the engine.

5 years agorfb: make sure size calculations do not overflow
Sascha Steinbiss [Sun, 29 Mar 2020 17:33:29 +0000 (19:33 +0200)] 
rfb: make sure size calculations do not overflow

Addresses #3570 by extra checking of calculated size requests.

With the given input, the parser eventually arrived at
parser::parse_failure_reason() which parsed from the remaining four
bytes (describing the string length) that the failure string to follow
would be 4294967295 bytes long. While calculating the total size of the
data to request via AppLayerResult::incomplete(), adding the four bytes
for the parsed but not consumed string length caused the u32 length to
overflow, resulting in a much smaller value triggering the bug condition.

This problem was addressed by more careful checking of values in each step
that could overflow: one subtraction, one addition (which could overflow
the usize length values), and a final check to determine whether the result
still fit into the u32 values required by AppLayerResult::incomplete().
If so, we would safely convert the values and pass them to the result type.
If not, we simply return AppLayerResult::err() but do not erroneously and
silently request the wrong amount.

5 years agodetect/tls: Use pcre_copy_substring to avoid leak
Jeff Lucovsky [Mon, 30 Mar 2020 11:57:36 +0000 (07:57 -0400)] 
detect/tls: Use pcre_copy_substring to avoid leak

This commit eliminates a memory leak while parsing TLS version
information. The leak was identified through fuzzing.

5 years agobuild: wrap fuzz targets in guard to fix 'make tags' 4750/head
Victor Julien [Mon, 30 Mar 2020 07:11:54 +0000 (09:11 +0200)] 
build: wrap fuzz targets in guard to fix 'make tags'

5 years agofuzz/sigpcap: fix FPs due to missing pkt cleanup
Victor Julien [Sun, 29 Mar 2020 17:34:18 +0000 (19:34 +0200)] 
fuzz/sigpcap: fix FPs due to missing pkt cleanup

5 years agodecode/vxlan: minor yaml example clarrification 4746/head
Victor Julien [Fri, 27 Mar 2020 11:48:27 +0000 (12:48 +0100)] 
decode/vxlan: minor yaml example clarrification

5 years agodecode/teredo: implement port support
Victor Julien [Mon, 23 Mar 2020 10:06:55 +0000 (11:06 +0100)] 
decode/teredo: implement port support

Implement support for limiting Teredo detection and decoding to specific
UDP ports, with 3544 as the default.

If no ports are specified, the old behaviour of detecting/decoding on any
port is still in place. This can also be forced by specifying 'any' as the
port setting.

5 years agoUse StringParse* for all parsers and configurations 4739/head
Shivani Bhardwaj [Wed, 18 Dec 2019 11:01:10 +0000 (16:31 +0530)] 
Use StringParse* for all parsers and configurations

5 years agoUse appropriate ByteExtractString* functions
Shivani Bhardwaj [Wed, 18 Dec 2019 08:21:08 +0000 (13:51 +0530)] 
Use appropriate ByteExtractString* functions

5 years agoutil: Add StringParse* functions
Shivani Bhardwaj [Sun, 22 Dec 2019 16:58:54 +0000 (22:28 +0530)] 
util: Add StringParse* functions

StringParse* functions would perform a stricter check compared to
ByteExtractString* functions. These new functions shall also check if
any extra characters follow the extracted numeric value in addition to
the checks performed by ByteExtractString* and return -1 in that case.
This is particularly important in parser, configuration and setup functions.

5 years agofuzz: remove obsolete AFL code 4735/head
Philippe Antoine [Thu, 26 Mar 2020 15:11:21 +0000 (16:11 +0100)] 
fuzz: remove obsolete AFL code

5 years agoci: add fuzztargets and afl build test 4732/head
Victor Julien [Thu, 26 Mar 2020 13:44:58 +0000 (14:44 +0100)] 
ci: add fuzztargets and afl build test

5 years agofuzz: simpler way to force usage of CXX linker
Philippe Antoine [Thu, 26 Mar 2020 13:55:31 +0000 (14:55 +0100)] 
fuzz: simpler way to force usage of CXX linker

5 years agofuzz: remove decodeder fuzz target
Philippe Antoine [Thu, 26 Mar 2020 13:42:50 +0000 (14:42 +0100)] 
fuzz: remove decodeder fuzz target

As we removed decodeder function

5 years agoconfigure: right test for AFLFUZZ_PERSISTANT_MODE 4731/head
Philippe Antoine [Thu, 26 Mar 2020 13:29:38 +0000 (14:29 +0100)] 
configure: right test for AFLFUZZ_PERSISTANT_MODE

5 years agoci: enables fuzz targets in one build 4729/head
Philippe Antoine [Thu, 26 Mar 2020 13:06:32 +0000 (14:06 +0100)] 
ci: enables fuzz targets in one build

github workflow wih debian

5 years agostream/tcp: fix STREAM_HAS_SEEN_DATA macro 4726/head
Victor Julien [Tue, 24 Mar 2020 12:11:03 +0000 (13:11 +0100)] 
stream/tcp: fix STREAM_HAS_SEEN_DATA macro

The macro would not return true for smaller TCP streams, leading to
cases where the app-layer was not notified of EOF.

5 years agostream/tcp: clean up stream flags
Victor Julien [Tue, 24 Mar 2020 10:37:01 +0000 (11:37 +0100)] 
stream/tcp: clean up stream flags

5 years agorust/x509: map decoding errors to decoder events 4721/head
Pierre Chifflier [Sun, 22 Mar 2020 15:19:57 +0000 (16:19 +0100)] 
rust/x509: map decoding errors to decoder events

5 years agossl/tls: call rs_cstring_free for strings allocated in Rust
Pierre Chifflier [Mon, 9 Mar 2020 20:49:51 +0000 (21:49 +0100)] 
ssl/tls: call rs_cstring_free for strings allocated in Rust

5 years agorust/x509: use the raw serial number so leading zeros are not removed
Pierre Chifflier [Mon, 9 Mar 2020 19:36:21 +0000 (20:36 +0100)] 
rust/x509: use the raw serial number so leading zeros are not removed

5 years agoDER: remove the C parser for DER
Pierre Chifflier [Mon, 9 Mar 2020 19:35:27 +0000 (20:35 +0100)] 
DER: remove the C parser for DER

5 years agossl/tls: use the rust decoder to decode X.509 certificates
Pierre Chifflier [Mon, 9 Mar 2020 12:38:13 +0000 (13:38 +0100)] 
ssl/tls: use the rust decoder to decode X.509 certificates

5 years agorust: add common function to exchange CString objects from/to C
Pierre Chifflier [Mon, 23 Mar 2020 15:53:51 +0000 (16:53 +0100)] 
rust: add common function to exchange CString objects from/to C

5 years agodetect: byte-test convert neg_op flag to a bool 4717/head
Jeff Lucovsky [Mon, 16 Dec 2019 22:07:20 +0000 (17:07 -0500)] 
detect: byte-test convert neg_op flag to a bool

Only 8 flags are permitted so convert one of them to a struct member. I
choose neg_op

5 years agodetect: Add unittests to exercise bitmask
Jeff Lucovsky [Sun, 15 Dec 2019 19:47:27 +0000 (14:47 -0500)] 
detect: Add unittests to exercise bitmask

5 years agodetect: fixup incorrect comments, indentation
Jeff Lucovsky [Sun, 15 Dec 2019 19:47:00 +0000 (14:47 -0500)] 
detect: fixup incorrect comments, indentation

5 years agodetect: byte_test impl for bitmask
Jeff Lucovsky [Sun, 15 Dec 2019 19:45:50 +0000 (14:45 -0500)] 
detect: byte_test impl for bitmask

This commit implements byte_test's bitmask feature.

5 years agodoc: fix documentation typos
Jeff Lucovsky [Sun, 15 Dec 2019 19:44:45 +0000 (14:44 -0500)] 
doc: fix documentation typos

5 years agodoc: Update byte_test documentation
Jeff Lucovsky [Sun, 15 Dec 2019 19:44:07 +0000 (14:44 -0500)] 
doc: Update byte_test documentation

5 years agorfb: use more idiomatic Rust code 4715/head
Sascha Steinbiss [Thu, 19 Mar 2020 18:19:56 +0000 (19:19 +0100)] 
rfb: use more idiomatic Rust code

Using 'if let Some()...' makes the code in these many checks more
concise and readable.

5 years agostream/tcp: fix fast open off by one
Victor Julien [Thu, 19 Mar 2020 20:30:45 +0000 (21:30 +0100)] 
stream/tcp: fix fast open off by one

With data on SYN the sequence number used for the first data
was off by one, leading to the next segments to appear to come
after a one byte gap.

5 years agofuzz: check tcp splitting evasions in protocol detection
Philippe Antoine [Thu, 19 Mar 2020 08:00:29 +0000 (09:00 +0100)] 
fuzz: check tcp splitting evasions in protocol detection

5 years agofuzz: enable AFLFUZZ_PERSISTANT_MODE for libfuzzer targets
Philippe Antoine [Fri, 28 Feb 2020 08:41:52 +0000 (09:41 +0100)] 
fuzz: enable AFLFUZZ_PERSISTANT_MODE for libfuzzer targets

5 years agofuzz: use env variable to restrict app layer
Philippe Antoine [Fri, 21 Feb 2020 10:47:37 +0000 (11:47 +0100)] 
fuzz: use env variable to restrict app layer

5 years agofuzz: adds eight fuzz targets
Philippe Antoine [Mon, 27 May 2019 15:02:22 +0000 (17:02 +0200)] 
fuzz: adds eight fuzz targets

And ways to compile them with enable-fuzztargets at configure time
Adds utility function in util-unittest-helper

5 years agoadd RFB parser 4710/head
Frank Honza [Fri, 7 Feb 2020 12:22:17 +0000 (13:22 +0100)] 
add RFB parser

This commit adds support for the Remote Framebuffer Protocol (RFB) as
used, for example, by various VNC implementations. It targets the
official versions 3.3, 3.7 and 3.8 of the protocol and provides logging
for the RFB handshake communication for now. Logged events include
endpoint versions, details of the security (i.e. authentication)
exchange as well as metadata about the image transfer parameters.
Detection is enabled using keywords for:

 - rfb.name: Session name as sticky buffer
 - rfb.sectype: Security type, e.g. VNC-style challenge-response
 - rfb.secresult: Result of the security exchange, e.g. OK, FAIL, ...

The latter could be used, for example, to detect brute-force attempts
on open VNC servers, while the name could be used to map unwanted VNC
sessions to the desktop owners or machines.

We also ship example EVE-JSON output and keyword docs as part of the
Sphinx source for Suricata's RTD documentation.

5 years agooutput/anomaly: minor code cleanups
Victor Julien [Thu, 19 Mar 2020 14:13:22 +0000 (15:13 +0100)] 
output/anomaly: minor code cleanups

5 years agodetect/app-layer-event: code cleanups
Victor Julien [Thu, 19 Mar 2020 14:07:21 +0000 (15:07 +0100)] 
detect/app-layer-event: code cleanups

5 years agodetect/pcre: Correct spelling typos
Jeff Lucovsky [Tue, 17 Mar 2020 14:34:39 +0000 (10:34 -0400)] 
detect/pcre: Correct spelling typos

5 years agogeneral: copyright bump
Jeff Lucovsky [Sun, 8 Mar 2020 19:32:04 +0000 (15:32 -0400)] 
general: copyright bump

5 years agodetect: Update to take advantage of PCRE refactor
Jeff Lucovsky [Tue, 19 Nov 2019 00:30:53 +0000 (19:30 -0500)] 
detect: Update to take advantage of PCRE refactor

This commit changes the keyword detectors to use the refactored PCRE
modifications from detect-parse.[ch]

5 years agodetect/pcre: Changes to support pcre_jit_exec
Jeff Lucovsky [Mon, 18 Nov 2019 22:02:17 +0000 (17:02 -0500)] 
detect/pcre: Changes to support pcre_jit_exec

This command causes `pcre_jit_exec` to be used when available. If it's
available and there are allocation errors preparing for it, things
fallback to `pcre_exec`.

5 years agodetect/pcre: Add warning for failed registrations
Jeff Lucovsky [Wed, 18 Mar 2020 12:43:59 +0000 (08:43 -0400)] 
detect/pcre: Add warning for failed registrations

This commit adds a warning used by the PCRE detect logic when it fails
to register initialization and free functions for per-thread JIT stack
handling.

This error code is only used when the platform has PCRE JIT exec
functionality.

5 years agodetect/parse: Refactor interfaces/definitions
Jeff Lucovsky [Sun, 17 Nov 2019 21:07:56 +0000 (16:07 -0500)] 
detect/parse: Refactor interfaces/definitions

This commit refactors existing code patterns to reduce code duplication
and to be a base for supporting additional PCRE jit-related actions.

5 years agoconfigure: Determine whether pcre_jit_exec exists
Jeff Lucovsky [Sun, 17 Nov 2019 20:58:01 +0000 (15:58 -0500)] 
configure: Determine whether pcre_jit_exec exists

This commit adds logic to determine whether pcre_jit_exec is present in
the system's pcre library using AC_RUN_ELSEIF

5 years agodevguide: document new app-layer retvals
Victor Julien [Wed, 18 Mar 2020 09:39:50 +0000 (10:39 +0100)] 
devguide: document new app-layer retvals

5 years agodoc: adds doc for ipv4.hdr signature keyword 4702/head
Philippe Antoine [Thu, 12 Mar 2020 08:11:52 +0000 (09:11 +0100)] 
doc: adds doc for ipv4.hdr signature keyword

5 years agodetect: adds icmpv6.mtu keyword
Philippe Antoine [Thu, 5 Mar 2020 21:18:57 +0000 (22:18 +0100)] 
detect: adds icmpv6.mtu keyword

5 years agodetect: adds utility file for uint keywords
Philippe Antoine [Thu, 5 Mar 2020 14:39:37 +0000 (15:39 +0100)] 
detect: adds utility file for uint keywords

5 years agodetect: define generic PrefilterIsPrefilterableById
Philippe Antoine [Fri, 6 Mar 2020 08:55:02 +0000 (09:55 +0100)] 
detect: define generic PrefilterIsPrefilterableById

5 years agodetect: extend PrefilterPacketHeaderValue to 16 bytes
Philippe Antoine [Fri, 6 Mar 2020 08:54:25 +0000 (09:54 +0100)] 
detect: extend PrefilterPacketHeaderValue to 16 bytes

5 years agodecode: fix endianness for ICMPv6 MTU
Philippe Antoine [Fri, 28 Feb 2020 14:08:33 +0000 (15:08 +0100)] 
decode: fix endianness for ICMPv6 MTU

5 years agodoc: fix typo in DetectTcpmssSetup description
Philippe Antoine [Fri, 28 Feb 2020 13:19:44 +0000 (14:19 +0100)] 
doc: fix typo in DetectTcpmssSetup description

And use lowercase true for boolean

5 years agostream: fix direction flags in corner case 4691/head
Victor Julien [Tue, 17 Mar 2020 12:08:33 +0000 (13:08 +0100)] 
stream: fix direction flags in corner case

When a TCP DNS flow would start with a GAP on the TS side, the successful
protocol detection on the TC side would trigger 'opposing side' reassembly
and app-layer processing. In this case the stream flags would indicate the
wrong direction and the wrong parser would be called.

5 years agoapp-layer: minor code cleanup
Victor Julien [Mon, 16 Mar 2020 21:25:49 +0000 (22:25 +0100)] 
app-layer: minor code cleanup

5 years agoapp-layer: fix progress tracking
Victor Julien [Mon, 16 Mar 2020 14:18:02 +0000 (15:18 +0100)] 
app-layer: fix progress tracking

Esp in combination with GAPs and proto detection.

5 years agoapp-layer: extend AppLayerResult to add convenience
Victor Julien [Sat, 14 Mar 2020 12:38:05 +0000 (13:38 +0100)] 
app-layer: extend AppLayerResult to add convenience

5 years agorust: merge parser.rs into applayer.rs
Victor Julien [Fri, 13 Mar 2020 19:01:21 +0000 (20:01 +0100)] 
rust: merge parser.rs into applayer.rs

Both were serving the same purpose.

5 years agoapp-layer: document return macros
Victor Julien [Fri, 13 Mar 2020 13:43:00 +0000 (14:43 +0100)] 
app-layer: document return macros

5 years agonfs: switch to new 'incomplete' logic
Victor Julien [Fri, 13 Mar 2020 11:56:18 +0000 (12:56 +0100)] 
nfs: switch to new 'incomplete' logic

Remove buffering code in favor of using incomplete API.

5 years agonfs: switch to AppLayerResult
Victor Julien [Fri, 13 Mar 2020 10:03:19 +0000 (11:03 +0100)] 
nfs: switch to AppLayerResult

5 years agosmb: update return type of GAP handling
Victor Julien [Fri, 13 Mar 2020 09:13:56 +0000 (10:13 +0100)] 
smb: update return type of GAP handling

5 years agosmb: convert to return AppLayerResult
Victor Julien [Mon, 9 Mar 2020 18:33:38 +0000 (19:33 +0100)] 
smb: convert to return AppLayerResult

Support returning 'incomplete' and remove the buffering
code from the parser.

5 years agoapp-layer: add 'incomplete' return logic
Victor Julien [Thu, 12 Mar 2020 15:35:56 +0000 (16:35 +0100)] 
app-layer: add 'incomplete' return logic

Allow app-layer parsers to indicate how much data they need
before being called again.

5 years agoapp-layer: update API to return more details
Victor Julien [Sun, 8 Mar 2020 21:17:58 +0000 (22:17 +0100)] 
app-layer: update API to return more details

Add AppLayerResult struct as the Parser return type in
preparation of allowing returning 'Incomplete(size)' similar
to what nom in Rust allows.

5 years agoapp-layer: change return codes
Victor Julien [Fri, 6 Mar 2020 21:03:20 +0000 (22:03 +0100)] 
app-layer: change return codes

This patch simplifies the return codes app-layer parsers use,
in preparation of a patch set for overhauling the return type.

Introduce two macros:

APP_LAYER_OK (value 0)
APP_LAYER_ERROR (value -1)

Update all parsers to use this.

5 years agoapp-layer: minor optimization
Victor Julien [Tue, 10 Mar 2020 20:14:39 +0000 (21:14 +0100)] 
app-layer: minor optimization

5 years agostream: fix function style
Victor Julien [Thu, 12 Mar 2020 18:52:58 +0000 (19:52 +0100)] 
stream: fix function style

5 years agoftp: minor code cleanups
Victor Julien [Sun, 8 Mar 2020 07:29:44 +0000 (08:29 +0100)] 
ftp: minor code cleanups

5 years agonfs: code cleanups
Victor Julien [Tue, 17 Mar 2020 20:11:27 +0000 (21:11 +0100)] 
nfs: code cleanups

Use 'if let' to replace simple 'match' statements.

Use explicit returns to easy code review.

5 years agosmb: fix rustc 1.42 warnings
Victor Julien [Tue, 17 Mar 2020 19:44:33 +0000 (20:44 +0100)] 
smb: fix rustc 1.42 warnings

5 years agoconfig: General typo and grammar cleanup 4679/head
Jeff Lucovsky [Tue, 3 Mar 2020 14:48:46 +0000 (09:48 -0500)] 
config: General typo and grammar cleanup

5 years agodocs/napatech: Correct typo
Jeff Lucovsky [Tue, 3 Mar 2020 14:48:27 +0000 (09:48 -0500)] 
docs/napatech: Correct typo

5 years agopython: style for prscript
Philippe Antoine [Fri, 22 Nov 2019 14:20:45 +0000 (15:20 +0100)] 
python: style for prscript

Remove unnecessary pass
Remove unused variable

5 years agopython: style for suricatasc.py
Philippe Antoine [Fri, 22 Nov 2019 14:20:11 +0000 (15:20 +0100)] 
python: style for suricatasc.py

Remove unnecessary return
Better comparison with None

5 years agopython: remove unused imports
Philippe Antoine [Fri, 22 Nov 2019 14:19:09 +0000 (15:19 +0100)] 
python: remove unused imports

5 years agodag: Skip over ERF_TYPE_META records
Stephen Donnelly [Thu, 5 Mar 2020 21:49:17 +0000 (10:49 +1300)] 
dag: Skip over ERF_TYPE_META records

Suricata generates an error on unrecognised ERF types.
Suricata should ignore ERF 'Provenance' records with ERF_TYPE_META.

5 years agosuricata.yaml/dns: removed unused settings
Jason Ish [Fri, 21 Feb 2020 22:29:58 +0000 (16:29 -0600)] 
suricata.yaml/dns: removed unused settings

Remove DNS settings global-memcap, state-memcap and request-flood.
These have never been used in the Rust implementation of the DNS
decoder.

5 years agodetect/parse: allow for OK signature parsing errors
Jason Ish [Tue, 25 Feb 2020 16:41:26 +0000 (10:41 -0600)] 
detect/parse: allow for OK signature parsing errors

The idea of an OK signature parsing error is an error that is
allowed to occur, but still lets test mode pass, unlike
silent errors which will still fail testing.

This is introduced to allow for app-layer event keywords to be
removed, but not have old rules fail out on this case. For example
the Rust DNS parser removes from DNS app-layer events that are
not used anymore.

To signal that an error is OK, -3 is returned. This also implies
silent.

5 years agodetect/parse: softer error on unknown app-layer event
Jason Ish [Fri, 21 Feb 2020 21:49:36 +0000 (15:49 -0600)] 
detect/parse: softer error on unknown app-layer event

On an unknown app-layer event, return -3 for "silent OK fail". A
warning will still be emitted, but its not considered a rule parse
error. This is to handle app-layer events being removed in a more
graceful manner for the user.

This allows -T to pass with an old app-layer events rule file
that may used removed app-layer event keywords.

5 years agodhcp: remove C app-layer-dhcp wrapper
Jason Ish [Mon, 13 Jan 2020 18:31:14 +0000 (12:31 -0600)] 
dhcp: remove C app-layer-dhcp wrapper

This just wrapped the Rust function to register the parse,
so instead just call the Rust function directly to remove
the C wrapper, and the 2 C files.

5 years agodns: register parsers from Rust
Jason Ish [Wed, 29 Jan 2020 22:34:00 +0000 (16:34 -0600)] 
dns: register parsers from Rust

And port the C DNS tests to Rust.

5 years agodns: remove C wrapper functions to Rust
Jason Ish [Tue, 14 Jan 2020 00:35:57 +0000 (18:35 -0600)] 
dns: remove C wrapper functions to Rust

Remove registration of C wrapper functions and register
the Rust functions directly for UDP.

5 years agodns: cleanup: move event callbacks into Rust
Jason Ish [Thu, 9 Jan 2020 22:21:54 +0000 (16:21 -0600)] 
dns: cleanup: move event callbacks into Rust

Remove app-layer-dns-common.c as its no longer needed.

5 years agodns: cleanup: remove unused events
Jason Ish [Thu, 9 Jan 2020 18:10:32 +0000 (12:10 -0600)] 
dns: cleanup: remove unused events

Removed events that are no longer used since the Rust
implementation of DNS:
- UnsolicitedResponse
- StateMemCapReached
- Flooded