]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Mon, 5 Oct 2020 06:17:19 +0000 (08:17 +0200)]
http: error check htp_list_size
This avoids a potential casting to uint64_t of -1, leading to a very
high upper bound of the tx loop.
Jeff Lucovsky [Mon, 28 Sep 2020 12:24:17 +0000 (08:24 -0400)]
doc/eve: Update threaded filename examples
Jeff Lucovsky [Sat, 26 Sep 2020 12:29:43 +0000 (08:29 -0400)]
output/json: Update threaded filename example
Jeff Lucovsky [Fri, 25 Sep 2020 11:47:53 +0000 (07:47 -0400)]
log/eve: Threaded filename change: eve.N.json
This commit changes the name of the file used with threaded eve logging
to better support log rotation
Instead of using "eve.json.N" and creating potential issues with log
rotation (which also uses a ".N" suffix), the eve logs will be named
"eve.N.json" when threaded.
Jeff Lucovsky [Wed, 30 Sep 2020 11:30:34 +0000 (07:30 -0400)]
path: SCBasename - function to return basename
This commit returns the basename of a file, if it exists
in the same way that `basename(1)` works.
Jeff Lucovsky [Wed, 23 Sep 2020 12:15:41 +0000 (08:15 -0400)]
detect/rules: Fix copy/paste error
This commit corrects a copy/paste error handling the `include-mpm-stats`
configuration setting.
Jeff Lucovsky [Sat, 19 Sep 2020 14:06:59 +0000 (10:06 -0400)]
detect: Apply clang-format updates
Jeff Lucovsky [Sat, 19 Sep 2020 12:47:56 +0000 (08:47 -0400)]
detect/rules: Increase array size to remove SEGV
This commit changes the size of reporting variables to be dynamic based
on the buffer ids in use instead of a fixed value to address a SEGV when
the fixed value was less than the max buffer/type id in use.
Jason Ish [Wed, 30 Sep 2020 17:18:46 +0000 (11:18 -0600)]
scripts/setup-app-layer: fix rust generation
Fix Rust app-layer generation. Main parser file was being named
gopher.rs instead of the name of the protocol.
Philippe Antoine [Thu, 1 Oct 2020 13:10:27 +0000 (15:10 +0200)]
http2: complete parsing of priority frames
Philippe Antoine [Wed, 30 Sep 2020 21:29:36 +0000 (23:29 +0200)]
http2: keep track of dynamic headers table size
And evict entries accordingly to maximum size
Philippe Antoine [Wed, 30 Sep 2020 19:41:24 +0000 (21:41 +0200)]
http2: variable size integers decoded everywhere
Philippe Antoine [Wed, 30 Sep 2020 12:23:11 +0000 (14:23 +0200)]
http2: StreamIdReuse frame types exceptions
Also handles better the state so as not to revert from
HTTP2StateHalfClosedClient to HTTP2StateDataServer and not
go to final HTTP2StateClosed
Philippe Antoine [Thu, 17 Sep 2020 20:48:52 +0000 (22:48 +0200)]
http2: use variable integer for headers lengths
Philippe Antoine [Fri, 18 Sep 2020 12:44:40 +0000 (14:44 +0200)]
protodetect: rerun probing parser if pattern matched
If a pattern matches in the other direction, after
probing parser finished without finding a protocol,
we will rerun the probing parser, which will include
the newly protocol found by its pattern
Philippe Antoine [Thu, 17 Sep 2020 14:52:13 +0000 (16:52 +0200)]
protodetect: runs probing parser on protocol found
It a protocol is found in a first direction, we should run the
probing parser, even if it is not in the known ports.
That can happen for HTTP2, where client magic is detected,
then server probe can be run
Philippe Antoine [Mon, 28 Sep 2020 08:27:20 +0000 (10:27 +0200)]
applayer: fix a leak in protocol change
TCPProtoDetect can either set f->alproto, change f->alstate
and return error.
When the original alstate gets freed, we shall set the pointer
to NULL, as it can get reused.
Shivani Bhardwaj [Wed, 23 Sep 2020 04:50:56 +0000 (10:20 +0530)]
dcerpc: fix gap handling
This patch addresses issues discovered by redmine ticket 3896. With the
approach of finding latest record, there was a chance that no record was
found at all and consumed + needed became input length.
e.g.
input_len = 1000
input = 01 05 00 02 00 03 a5 56 00 00 .....
There exists no |05 00| identifier in the rest of the record. After
having parsed |05 00|, there was a search for another record with the
leftover data. Current data length at this point would be 997. Since the
identifier was not found in the data, we calculate the consumed bytes at
this point i.e. consumed = current_data.len() - 1 which would be 996.
Needed bytes still stay at a constant of 2. So, consumed + needed = 996
+ 2 = 998 which is lesser than initial input length of 1000 and hence
the assertion fails.
There could be two fixes to this problem.
1. Finding the latest record but making use of the last found record in
case no new record was found.
2. Always use the earliest record.
This patch takes the approach (2). It also makes sure that the gap and
current direction are the same.
Philippe Antoine [Thu, 17 Sep 2020 10:07:29 +0000 (12:07 +0200)]
fuzz: better configure checks for MSAN building
More compatible check for rust nightly
Checks for CARGO_BUILD_TARGET
Builds release or debug mode independently
Jeff Lucovsky [Fri, 18 Sep 2020 11:53:10 +0000 (07:53 -0400)]
log/anomaly: Move metadata out of anomaly section
This commit moves the metadata from the anomaly object where it was
incorrectly located.
Jason Ish [Wed, 16 Sep 2020 16:50:05 +0000 (10:50 -0600)]
doc/userguide: add info about --set and lists
Victor Julien [Mon, 21 Sep 2020 19:44:36 +0000 (21:44 +0200)]
app-layer: improve depth handling
Consider txs inspected and done for a direction after depth is reached for
that direction.
Victor Julien [Mon, 21 Sep 2020 07:12:55 +0000 (09:12 +0200)]
stream: make sure to call app-layer in case of depth reached
Victor Julien [Sat, 19 Sep 2020 18:57:35 +0000 (20:57 +0200)]
dcerpc: implement tx free function
Victor Julien [Sat, 19 Sep 2020 18:44:40 +0000 (20:44 +0200)]
dcerpc/tcp: implement trunc logic
When one side of the connection reaches the STREAM_DEPTH condition the
parser should be aware of this. Otherwise transactions will forever be
waiting for data in that direction.
Victor Julien [Sat, 19 Sep 2020 18:25:05 +0000 (20:25 +0200)]
applayer/rust: expose truncate callback
Victor Julien [Sat, 19 Sep 2020 13:50:47 +0000 (15:50 +0200)]
app-layer: don't check tx detect flags if detect is disabled
Victor Julien [Wed, 23 Sep 2020 11:52:29 +0000 (13:52 +0200)]
stream: remove GAP flag from stream
This flag was checked in many places, but never set expect in 2 unittests.
Jeff Lucovsky [Wed, 16 Sep 2020 12:11:10 +0000 (08:11 -0400)]
log/eve: Rename fileinfo alert object to files
This commit changes the name of the "fileinfo" array in the alert object
to "files" to better support legacy use of "fileinfo" in reporting and
elsewhere.
The "fileinfo" event type is not an array while the alert "fileinfo"
member was.
Jason Ish [Tue, 15 Sep 2020 15:27:36 +0000 (09:27 -0600)]
doc/userguide: include man page even when not including pdf
Fix a mistake in Makefile.am where the man page was only being
added to the distribution if the PDF was also created. It should
be included even if the PDF cannot be included.
Shivani Bhardwaj [Thu, 24 Sep 2020 05:22:01 +0000 (10:52 +0530)]
dcerpc: fix datatypes while handling stub data
Shivani Bhardwaj [Thu, 24 Sep 2020 14:42:09 +0000 (20:12 +0530)]
dcerpc: fix datatype for stub data len
Philippe Antoine [Wed, 9 Sep 2020 14:05:56 +0000 (16:05 +0200)]
rust: rebuilds std when building fuzzers
so as to have MSAN working
Victor Julien [Fri, 7 Aug 2020 14:42:22 +0000 (16:42 +0200)]
version: continue 6 development
Victor Julien [Thu, 10 Sep 2020 19:42:35 +0000 (21:42 +0200)]
version: update to 6.0.0-rc1
Victor Julien [Thu, 10 Sep 2020 19:42:00 +0000 (21:42 +0200)]
changelog: update for 6.0.0-rc1
Philippe Antoine [Fri, 11 Sep 2020 07:44:25 +0000 (09:44 +0200)]
dceprc: signature rust check with is_char_boundary
before calling split_at which would panic
Shivani Bhardwaj [Fri, 11 Sep 2020 06:28:28 +0000 (11:58 +0530)]
datasets: use default memcap
Philippe Antoine [Wed, 9 Sep 2020 13:54:36 +0000 (15:54 +0200)]
detect: initialize pointer before calling pcre_study
So as not to check an uninitialized value
Found by MSAN
Victor Julien [Thu, 10 Sep 2020 19:52:44 +0000 (21:52 +0200)]
datasets: remove experimental warning
Shivani Bhardwaj [Thu, 10 Sep 2020 12:22:18 +0000 (17:52 +0530)]
doc/datasets: add info about memcap and hashsize
Shivani Bhardwaj [Thu, 10 Sep 2020 08:34:16 +0000 (14:04 +0530)]
datasets: parse defaults section from yaml
Datasets can now have a global defaults setting in suricata.yaml. In
case the settings for memcap and hashsize are not find in the yaml or
rule, this shall be the fallback.
Example:
datasets:
defaults:
memcap: 100mb
hashsize: 2048
ua-seen:
type: string
load: datasets.csv
Shivani Bhardwaj [Thu, 10 Sep 2020 11:45:00 +0000 (17:15 +0530)]
datasets: allow memcap, hashsize be set via yaml or rule
It is now possible to set the memcap and hashsize via suricata.yaml and
rules.
Rule example:
alert http any any -> any any (http.user_agent; dataset:isset,ua-seen,type string,load datasets.csv,memcap 100mb,hashsize 2048; sid:1;)
suricata.yaml example:
datasets:
ua-seen:
type: string
load: datasets.csv
memcap: 20mb
hashsize: 2048
Shivani Bhardwaj [Thu, 10 Sep 2020 11:34:21 +0000 (17:04 +0530)]
datasets: allow max possible memcap while loading
While using the "load" option of datasets, it should be possible to load
any file from the disk, so set the limit to highest possible.
Jason Ish [Thu, 3 Sep 2020 19:29:57 +0000 (13:29 -0600)]
rules/tls: sync with changes to the TLS events
Sync rules with event changes in commit
01aef49cbd32fb2437d1615a2111111e5f3ee862 .
Jeff Lucovsky [Wed, 9 Sep 2020 12:59:32 +0000 (08:59 -0400)]
log/eve: Ensure eve logs have sequential suffixes
This commit ensures that the eve logs have sequential suffixes without
gaps.
Jeff Lucovsky [Thu, 10 Sep 2020 11:47:46 +0000 (07:47 -0400)]
atomics: Add "decl and init with value" function
This commit adds an interface to declare and initialize an atomic with a
specific value. This can help with situations where there's no defined
initialization path to set things up.
Jeff Lucovsky [Tue, 8 Sep 2020 12:26:36 +0000 (08:26 -0400)]
log: Ensure threaded eve honors SIGHUP
This commit ensures that all logging contexts register for the file
rotation mechanism (SIGHUP and configured).
Jason Ish [Tue, 8 Sep 2020 20:01:02 +0000 (14:01 -0600)]
doc: document removal of unified2
And suggest an alternate tool, Meer if compatibility with
Barnyard2 style databases is required.
Redmine ticket:
https://redmine.openinfosecfoundation.org/issues/3497
Jason Ish [Tue, 8 Sep 2020 19:29:11 +0000 (13:29 -0600)]
doc: add removal of individual json loggers
Add link to multiple eve instances as a replacement for this
feature.
Philippe Antoine [Fri, 4 Sep 2020 07:39:44 +0000 (09:39 +0200)]
http: disables lzma by default for HTTP
Philippe Antoine [Thu, 3 Sep 2020 12:22:29 +0000 (14:22 +0200)]
http2: settings from http1 upgrade
Philippe Antoine [Fri, 4 Sep 2020 14:06:16 +0000 (16:06 +0200)]
http2: mimic HTTP1 request from upgrade
Philippe Antoine [Thu, 3 Sep 2020 12:19:28 +0000 (14:19 +0200)]
http2: first connection upgrade from http1
Philippe Antoine [Sat, 5 Sep 2020 09:43:53 +0000 (11:43 +0200)]
dnp3: fix unit tests when fuzzing
Philippe Antoine [Tue, 8 Sep 2020 07:23:24 +0000 (09:23 +0200)]
applayer: keep running detection on protocol change
ie do not stop on first try if we do not have enough data
Philippe Antoine [Wed, 9 Sep 2020 08:09:33 +0000 (10:09 +0200)]
applayer: on protocol change, use previous state
Philippe Antoine [Wed, 9 Sep 2020 08:08:50 +0000 (10:08 +0200)]
http: removal of connect unit tests
moved to suricata-verify
Philippe Antoine [Fri, 4 Sep 2020 13:29:41 +0000 (15:29 +0200)]
applayer: pass parameter to StateAlloc
This parameter is NULL or the pointer to the previous state
for the previous protocol in the case of a protocol change,
for instance from HTTP1 to HTTP2
This way, the new protocol can use the old protocol context.
For instance, HTTP2 mimicks the HTTP1 request, to have a HTTP2
transaction with both request and response
Sascha Steinbiss [Wed, 9 Sep 2020 07:51:56 +0000 (09:51 +0200)]
mqtt: add some extra tests for varint parsing
Philippe Antoine [Wed, 9 Sep 2020 07:27:00 +0000 (09:27 +0200)]
http2: handles incomplete frames after banner
To signal incomplete data, we must return the number of
consumed bytes. When we get a banner and some records, we have
to take into account the number of bytes already consumed by
the banner parsing before reaching an incomplete record.
Philippe Antoine [Tue, 8 Sep 2020 19:13:07 +0000 (21:13 +0200)]
mqtt: limit size of variable integer
Jason Ish [Tue, 8 Sep 2020 16:54:20 +0000 (10:54 -0600)]
datasets: fix dataset load path construction
Test the full path instead of just the filename provided in the
rule to see if it exists.
Fixes the case where a rule file is loaded from a directory
other than the default-rule-directory.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3916
Philippe Antoine [Tue, 8 Sep 2020 14:23:29 +0000 (16:23 +0200)]
http2: returns error in case of index 0
As is documented in RFC 7541, section 6.1
The index value of 0 is not used. It MUST be treated as a decoding
error if found in an indexed header field representation.
Philippe Antoine [Tue, 8 Sep 2020 11:33:34 +0000 (13:33 +0200)]
signature: frees transform options in SigMatchPrepare
Philippe Antoine [Thu, 27 Aug 2020 15:11:10 +0000 (17:11 +0200)]
detect: checks for overflow when comparing signatures priorities
Victor Julien [Tue, 8 Sep 2020 08:41:29 +0000 (10:41 +0200)]
flow: suppress Coverity FP
Victor Julien [Tue, 8 Sep 2020 08:40:06 +0000 (10:40 +0200)]
flow: minor code cleanup
Victor Julien [Tue, 8 Sep 2020 08:29:23 +0000 (10:29 +0200)]
flow: turn BUG_ON into debug check
Eric Leblond [Sat, 5 Sep 2020 20:57:23 +0000 (22:57 +0200)]
ebpf: fix invalid description in doc string
Victor Julien [Mon, 7 Sep 2020 18:04:02 +0000 (20:04 +0200)]
doc/datasets: explain reloads, general improvements
Victor Julien [Mon, 7 Sep 2020 14:46:39 +0000 (16:46 +0200)]
detect/app-layer-events: improve warnings/errors
Improve handling of outdated events that are no longer supported by the engine.
Eric Leblond [Sun, 6 Sep 2020 18:27:04 +0000 (20:27 +0200)]
prscript: port to python 3
Victor Julien [Mon, 7 Sep 2020 10:57:59 +0000 (12:57 +0200)]
flow/bypass: don't bypass on flow timeout pseudo packets
Jason Ish [Fri, 4 Sep 2020 16:45:52 +0000 (10:45 -0600)]
rule parsing: valid that input rule string is UTF8
Before parsing a rule string, validate that it is UTF-8 first.
Related Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3850
Jason Ish [Fri, 4 Sep 2020 16:44:27 +0000 (10:44 -0600)]
rust/util: expose function to test strings for valid UTF-8
rs_check_utf8 will check that the provided string is valid
UTF-8 by converting it to a Rust string and returning true
or false.
Jason Ish [Fri, 4 Sep 2020 15:04:34 +0000 (09:04 -0600)]
http/eve: use set_string_from_bytes where appropriate
The JsonBuilder set_string_from_bytes will escape unprintable
characters in the output stream. Using BytesToStringBuffer
can generate invalid UTF-8 which prevents the conversion from
a C string to a Rust string.
Victor Julien [Mon, 7 Sep 2020 09:38:11 +0000 (11:38 +0200)]
detect/dataset: error if set couldn't be fully loaded
Victor Julien [Mon, 7 Sep 2020 08:25:37 +0000 (10:25 +0200)]
datasets: free old data when reusing a hash container
Jeff Lucovsky [Tue, 11 Aug 2020 12:17:12 +0000 (08:17 -0400)]
log: Log errors while writing log info
This commit adds logic to log errors during output. Errors are logged
once and the number of errors is maintained.
Jeff Lucovsky [Tue, 11 Aug 2020 12:16:52 +0000 (08:16 -0400)]
log: Add log output error code
Jeff Lucovsky [Fri, 7 Aug 2020 12:34:20 +0000 (08:34 -0400)]
log: Use unlocked variants of stdio functions
This commit uses the unlocked variants of additional stdio functions
Jeff Lucovsky [Tue, 11 Aug 2020 12:15:52 +0000 (08:15 -0400)]
log: Add more stdio_unlocked macros
This commit adds additional macros for interfaces in stdio_unlocked
according to their local availability.
Victor Julien [Mon, 7 Sep 2020 05:09:05 +0000 (07:09 +0200)]
error: reformat enum
Victor Julien [Fri, 4 Sep 2020 13:38:58 +0000 (15:38 +0200)]
app-layer: handle parser return code issues more gracefully
Victor Julien [Fri, 4 Sep 2020 08:52:04 +0000 (10:52 +0200)]
pcap: fix minor scan-build warnings
Victor Julien [Fri, 4 Sep 2020 08:46:59 +0000 (10:46 +0200)]
commandline: add static analyzer hint for -r parsing
Victor Julien [Fri, 4 Sep 2020 08:44:54 +0000 (10:44 +0200)]
commandline: minor formatting fixes
Jeff Lucovsky [Thu, 6 Aug 2020 12:34:45 +0000 (08:34 -0400)]
general: Improve grammar in error messages
This commit corrects a minor grammar issue in address/port error
messages.
Victor Julien [Fri, 4 Sep 2020 08:11:40 +0000 (10:11 +0200)]
decode/geneve: add config to yaml
Jason Ish [Wed, 2 Sep 2020 17:53:20 +0000 (11:53 -0600)]
github-ci: apply default CFLAGS to all builds
Jason Ish [Tue, 1 Sep 2020 21:37:54 +0000 (15:37 -0600)]
github-ci: add test build without jansson
This is to cover a test from Travis CI where we make sure
that ./configure fails if libjansson is not available.
Jason Ish [Tue, 1 Sep 2020 21:32:38 +0000 (15:32 -0600)]
github-ci: update debian 9 test to use known Rust version
Choose Rust 1.39.0 as a known version of Rust that we build against
to see in CI if we build with this version, but fail with latest.
This is to cover a similar test from Travis CI.
Jason Ish [Tue, 1 Sep 2020 21:23:03 +0000 (15:23 -0600)]
github-ci: enable debug on Fedora 32 build
Jason Ish [Wed, 19 Aug 2020 18:17:00 +0000 (12:17 -0600)]
github-ci: check that configure fails if rust to old
Migration of similar test from Travis-CI.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3869
Jason Ish [Wed, 19 Aug 2020 15:28:07 +0000 (09:28 -0600)]
github-ci: Ubuntu 20.4 build with -NDEBUG
To cover Travis-CI test that builds with -NDEBUG.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3869
Jason Ish [Mon, 17 Aug 2020 22:51:38 +0000 (16:51 -0600)]
github-ci: ubuntu 20.04 build without nss/nspr
Adds a test that builds and tests Suricata without nss/nspr
to replace the similar test on Travis-CI.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3869
Jason Ish [Wed, 12 Aug 2020 15:06:23 +0000 (09:06 -0600)]
github-ci: Fedora 32 builder with asan enabled
Also enables -Wshadow and rust-strict to cover those cases
from Travis.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3868
Ali Jad Khalil [Sat, 2 May 2020 21:04:07 +0000 (21:04 +0000)]
decode/teredo: Modified/refactored Teredo logic
This is just a slight refactor to make analagous decoding/encapsulation
schemes - Geneve, Teredo, and VXLAN - be implemented as similarly as
possible.
Ali Jad Khalil [Sat, 2 May 2020 21:01:58 +0000 (21:01 +0000)]
decode/vxlan: Modified/refactored VXLAN logic
This is just a slight refactor to make analagous decoding/encapsulation
schemes - Geneve, Teredo, and VXLAN - be implemented as similarly as
possible.