]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Sat, 14 Dec 2019 19:20:45 +0000 (20:20 +0100)]
streaming/api: fix overlap check
In some cases a SBB could be seen as overlapping with the requested
offset, when it was in fact precisely before it. In some special cases
this could lead to the stream engine not progressing the 'raw' progress.
Victor Julien [Sat, 14 Dec 2019 06:11:26 +0000 (07:11 +0100)]
debug/validation: check tcp/app-layer data lengths
Victor Julien [Fri, 13 Dec 2019 21:26:30 +0000 (22:26 +0100)]
stream: improve app-layer data retrieval with GAPs
Don't assume that the next block after the sbb head is after the
requested offset.
If the next block was before the offset, the returned data_len
would underflow and return a nonsense value to the app-layer.
Bug #2993.
Jeff Lucovsky [Sat, 11 Jan 2020 14:51:00 +0000 (09:51 -0500)]
modbus: Correct typo
Jeff Lucovsky [Sat, 11 Jan 2020 14:49:55 +0000 (09:49 -0500)]
modbus: Update correct TX flags
Jeff Lucovsky [Sat, 4 Jan 2020 14:12:38 +0000 (09:12 -0500)]
analysis: exit if table entries are stale
This commit causes Suricata to exit when a buffer from the analyzer
table is not recognized.
Since the table must match what's registered, exiting will bring noticed
to the condition.
Victor Julien [Fri, 17 Jan 2020 15:40:38 +0000 (16:40 +0100)]
rust: fix vendor use on MinGW
Jason Ish [Thu, 16 Jan 2020 15:30:28 +0000 (09:30 -0600)]
rust: Don't use --frozen during build.
If sources are vendored, we get the same effect of using frozen
with a lock file, and the Cargo.lock is generated based
on the vendored sources.
This also removes the need to ship a Cargo.lock.
Fixed out of source builds with vendored sources.
Jason Ish [Thu, 16 Jan 2020 15:09:13 +0000 (09:09 -0600)]
rust/Makefile: Don't include Cargo.toml
There is no need to include Cargo.toml in the distribution,
it is always generated from Cargo.toml.in during
./configure.
Jason Ish [Wed, 8 Jan 2020 16:16:40 +0000 (10:16 -0600)]
github-ci: do distcheck on fedora 31 build
There were no distchecks being done on builds from git.
Jason Ish [Tue, 31 Dec 2019 15:19:43 +0000 (09:19 -0600)]
github-ci: make distcheck on centos 7 build
Tests distcheck on a build from a distribution archive.
Shivani Bhardwaj [Sat, 21 Dec 2019 00:22:42 +0000 (05:52 +0530)]
doc/conf: Update copyright and regex for version
Make the new regex in compliance with the modern autoconf syntax.
Closes redmine ticket #3423
jason taylor [Wed, 18 Dec 2019 14:59:54 +0000 (09:59 -0500)]
doc: minor capitalization fix
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Wed, 18 Dec 2019 14:59:23 +0000 (09:59 -0500)]
doc: add bsize documentation and rule example
Signed-off-by: jason taylor <jtfas90@gmail.com>
Jason Ish [Thu, 19 Dec 2019 17:02:56 +0000 (11:02 -0600)]
rust: remove unnecessary parentheses (Rust 1.40 fixup)
Rust 1.40 in strict mode will now fail the build on the
presence of unnecessary parentheses.
warning: unnecessary parentheses around type
--> src/smb/smb2_ioctl.rs:41:12
|
41 | -> (&mut SMBTransaction)
| ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: `#[warn(unused_parens)]` on by default
Jason Ish [Fri, 13 Dec 2019 15:14:35 +0000 (09:14 -0600)]
github-ci: use container for 18.04 build
As the action runs natively on 18.04 we were not explicitly
setting a container, but this means we're using what GitHub
provides us as a default state which might be broken. Instead
use the standard Ubuntu 18.04 container.
Victor Julien [Fri, 13 Dec 2019 15:49:52 +0000 (16:49 +0100)]
version: starting work on 5.0.2
Victor Julien [Thu, 12 Dec 2019 08:54:45 +0000 (09:54 +0100)]
version: release 5.0.1
Victor Julien [Fri, 13 Dec 2019 10:09:18 +0000 (11:09 +0100)]
changelog: update for 5.0.1
Victor Julien [Sun, 3 Nov 2019 08:50:14 +0000 (09:50 +0100)]
detect/asn1: fix offset bounds checking
Jason Ish [Thu, 14 Nov 2019 20:56:43 +0000 (14:56 -0600)]
ipv4: continue parsing options after invalid option
As long as an option has a valid length, we can continue
parsing the options after an invalid one.
Jason Ish [Thu, 14 Nov 2019 17:34:56 +0000 (11:34 -0600)]
ipv4: fail packet decoding on bad ipv4 option length
Currently all failures in IPv4 option decode are ignore with
respect to continuing to handle the packet.
Change this to fail, and abort handling the packet if the
option length is invalid.
Ticket 3328:
https://redmine.openinfosecfoundation.org/issues/3328
Victor Julien [Thu, 21 Nov 2019 15:10:21 +0000 (16:10 +0100)]
stream: reject broken ACK packets
Fix evasion posibility by rejecting packets with a broken ACK field.
These packets have a non-0 ACK field, but do not have a ACK flag set.
Bug #3324.
Reported-by: Nicolas Adba
Victor Julien [Thu, 21 Nov 2019 13:47:04 +0000 (14:47 +0100)]
stream: fix SYN_SENT RST/FIN injection
RST injection during the SYN_SENT state could trick Suricata into marking
a session as CLOSED. The way this was done is: using invalid TSECR value
in RST+ACK packet. The ACK was needed to force Linux into considering the
TSECR value and compare it to the TSVAL from the SYN packet.
The second works only against Windows. The client would not use a TSVAL
but the RST packet would. Windows will reject this, but Suricata considered
the RST valid and triggered the CLOSED logic.
This patch addresses both. When the SYN packet used timestamp support
the timestamp of incoming packet is validated. Otherwise, packet responding
should not have a timestamp.
Bug #3286
Reported-by: Nicolas Adba
Victor Julien [Fri, 13 Dec 2019 10:12:15 +0000 (11:12 +0100)]
configure: require libhtp 0.5.32
Victor Julien [Thu, 12 Dec 2019 14:57:29 +0000 (15:57 +0100)]
decode/tcp: accept TCP fast open cookie request
Jason Ish [Tue, 10 Dec 2019 22:40:35 +0000 (16:40 -0600)]
configure: fix test -f for rust/vendor, should be -e
Introduced with commit:
c08ec8d8b27280e2bcb066c9caa24da97e0419ee
Jason Ish [Tue, 10 Dec 2019 22:22:02 +0000 (16:22 -0600)]
github-ci: in a dist build, check that --frozen is being used
Verify that ./configure is picking up the vendored Rust sources
when building from a dist archive.
Victor Julien [Wed, 11 Dec 2019 19:57:57 +0000 (20:57 +0100)]
htp: close request only from request side
This allows the response side to keep going for just
a bit longer.
Victor Julien [Wed, 11 Dec 2019 19:57:07 +0000 (20:57 +0100)]
stream: in IDS mode, call app-layer at EOF
On stream end call app-layer with empty message in IDS mode.
Victor Julien [Tue, 10 Dec 2019 11:48:56 +0000 (12:48 +0100)]
eve: support pcap_filename for unix socket mode
Bug #3390.
Daisu [Wed, 13 Mar 2019 22:39:48 +0000 (23:39 +0100)]
doc/commandline: -i option is useable several times
Steven Hostetler [Tue, 29 Oct 2019 03:06:00 +0000 (23:06 -0400)]
doc/install: fix geoip typo
Victor Julien [Tue, 10 Dec 2019 11:26:44 +0000 (12:26 +0100)]
doc/eve: layout and formatting fixes
Jason Williams [Mon, 25 Nov 2019 23:44:57 +0000 (16:44 -0700)]
doc: update http keywords documentation
Philippe Antoine [Wed, 30 Oct 2019 08:12:42 +0000 (09:12 +0100)]
yaml: clarify comment about dump-all-headers
Logs a warning if the value is unknown
Fixes #2810
Jason Ish [Sun, 24 Nov 2019 05:35:56 +0000 (23:35 -0600)]
configure: assume cargo vendor if cargo >= 1.37
Rust/Cargo 1.37 and greater has vendor support built-in.
Victor Julien [Mon, 9 Dec 2019 16:09:20 +0000 (17:09 +0100)]
detect/parse: track negation during address parsing
Fix address negation detection not resolving variables when
looking for the negation.
This patch makes use of the actual parsing routines to relay this
information to the signature parser.
Bug #3389.
Fixes: 92f08d85aac2 ("detect/iponly: improve negation handling in parsing")
Victor Julien [Mon, 9 Dec 2019 16:08:45 +0000 (17:08 +0100)]
detect/iponly: debug output improvements
Victor Julien [Thu, 5 Dec 2019 14:31:28 +0000 (15:31 +0100)]
app-layer: optimize inspection id tracking
Increase the inspect id for a completely inspected tx in any case.
This avoids re-evaluating transactions.
Reported-by: Ilya Bakhtin
Victor Julien [Wed, 4 Dec 2019 09:22:55 +0000 (10:22 +0100)]
smb1: allow empty trans records
Victor Julien [Wed, 4 Dec 2019 09:06:01 +0000 (10:06 +0100)]
smb1: fix 'event' txs not getting closed
If the only reason we created a request side TX was to set an event,
we would not close it.
This patch always looks up the TX from the response side.
Victor Julien [Tue, 3 Dec 2019 08:27:34 +0000 (09:27 +0100)]
smb/dcerpc: close request tx sooner
Victor Julien [Tue, 3 Dec 2019 08:25:48 +0000 (09:25 +0100)]
smb: post-GAP handling update
Close all prior transactions in the direction of the GAP, except the
file xfers. Those use their own logic.
Victor Julien [Mon, 2 Dec 2019 19:57:59 +0000 (20:57 +0100)]
smb: winreg is a DCERPC facility
Victor Julien [Thu, 5 Dec 2019 14:00:40 +0000 (15:00 +0100)]
files: add call for setting inspect sizes
The inspect sizes are currently only used during file prune
house keeping for SMTP.
Victor Julien [Mon, 2 Dec 2019 10:49:18 +0000 (11:49 +0100)]
smtp: fix and clean up new file handling
Set tx id on files that were just opened.
Move logic to a small util func.
Victor Julien [Fri, 22 Nov 2019 12:45:10 +0000 (13:45 +0100)]
smtp: use FILE_USE_DETECT for raw-extract
Victor Julien [Fri, 22 Nov 2019 16:27:19 +0000 (17:27 +0100)]
files: change pruning behavior
If file prune is called inspect has already run. So if file is closed
we can just prune. No need to consider a window anymore.
When still in progress, fix the left_edge calculation.
Victor Julien [Sun, 24 Nov 2019 08:16:29 +0000 (09:16 +0100)]
files: fix FILE_USE_DETECT with --disable-detection
Don't set FILE_USE_DETECT flag if detect is disabled.
Victor Julien [Sun, 24 Nov 2019 08:16:46 +0000 (09:16 +0100)]
files: move smtp prune logic to main
Now that we call the file prune loop very regularly, we can move the
SMTP specific inspection pruning logic into this loop. Helps with
cases there we don't (often) update a files inspection trackers.
Victor Julien [Mon, 25 Nov 2019 14:17:29 +0000 (15:17 +0100)]
http/file: modernize unittests
Part of ticket #2975.
Victor Julien [Mon, 9 Dec 2019 10:30:10 +0000 (11:30 +0100)]
fastlog: apply icmp type logic to icmpv6 too
Victor Julien [Mon, 25 Nov 2019 18:09:10 +0000 (19:09 +0100)]
http/multipart: small cleanup
Victor Julien [Mon, 25 Nov 2019 16:16:56 +0000 (17:16 +0100)]
http/multipart: use wider type for boundary lengths
Use uint32_t for a local type instead of uint8_t to avoid casts.
Length should always stay under this regardless.
Victor Julien [Mon, 25 Nov 2019 16:01:59 +0000 (17:01 +0100)]
http/multipart: optimize form end search
If we already know that the boundary exists, we can start looking
there. Otherwise, we can skip trying as the boundary is a subset
of the form end marker.
Victor Julien [Mon, 25 Nov 2019 14:21:32 +0000 (15:21 +0100)]
http/multipart: process incomplete file data
Start processing multipart data as soon as it is available to
allow inspection sooner.
Jeff Lucovsky [Fri, 6 Dec 2019 00:15:13 +0000 (19:15 -0500)]
detect/analyzer: Suppress direction warnings
This commit ensures direction warnings for ICMP v4 and v6
are suppressed and corrects check so that both protocols
are checked (instead of the same protocol being checked twice).
Eric Leblond [Sat, 7 Dec 2019 09:43:28 +0000 (10:43 +0100)]
suricata: fix computing of default packet size
Update the default packet size computation to use LiveDeviceName
instead of LiveDevice as the LiveDevice list is not built when
the default packet size is built.
Jason Ish [Fri, 6 Dec 2019 21:10:23 +0000 (15:10 -0600)]
travis: remove cocci and macos builds
These tests are covered by Github actions and removing
them may speed up the Travis builds to get results sooner.
Its still worth keeping some of these builds as they test
more compile time options than the Github Actions currently
do.
Fabrice Fontaine [Sat, 26 Oct 2019 11:30:43 +0000 (13:30 +0200)]
configure.ac: remove AC_CHECK_FILE
The use of AC_CHECK_FILE and AC_CHECK_FILES cause the following error
when cross-compiling:
configure: error: cannot check for file existence when cross compiling
The solution is to check for the file directly instead of using a macro.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Ciprian [Mon, 2 Dec 2019 12:07:15 +0000 (14:07 +0200)]
configure: fixing rust/cargo cross compile command
adding --target argument to cargo command line when cross compiling
Victor Julien [Thu, 28 Nov 2019 10:48:19 +0000 (11:48 +0100)]
detect/replace: fix debug print issue
Don't print field that will likely not be 0 terminated.
Victor Julien [Mon, 2 Dec 2019 13:35:04 +0000 (14:35 +0100)]
detect/file.data: fix buffer reusing id 0
Victor Julien [Mon, 25 Nov 2019 13:03:13 +0000 (14:03 +0100)]
http/multipart: use proper progress value to test eof
jason taylor [Thu, 17 Oct 2019 01:16:52 +0000 (21:16 -0400)]
docs: update datasets examples
Signed-off-by: jason taylor <jtfas90@gmail.com>
Philippe Antoine [Wed, 30 Oct 2019 08:46:53 +0000 (09:46 +0100)]
fastlog: use icmp type and code instead of port
Fixes #3266
Philippe Antoine [Wed, 30 Oct 2019 08:33:51 +0000 (09:33 +0100)]
fastlog: move code to reduce variable scope
Philippe Antoine [Thu, 7 Nov 2019 16:10:14 +0000 (17:10 +0100)]
transform: fixes comment about compress_whitespace
Philippe Antoine [Wed, 6 Nov 2019 09:15:21 +0000 (10:15 +0100)]
transform: updates doc about compress_whitespace
And removes duplicate test from strip_whitespace
Victor Julien [Sun, 24 Nov 2019 19:13:30 +0000 (20:13 +0100)]
qa/banned-functions: remove strndup now we have a fall back
Eric Leblond [Sat, 30 Nov 2019 18:07:05 +0000 (19:07 +0100)]
qa/coccinelle: fix make distcheck
We need to use top_srcdir to know where the sources are. Relative
directory is not enough.
Eric Leblond [Sat, 30 Nov 2019 17:24:06 +0000 (18:24 +0100)]
qa/coccinelle: flag check for setter and getter
WHen adding something like
/* coccinelle: AppLayerParserStateIssetFlag():4,2:APP_LAYER_PARSER_ */
the coccinelle check will consider that AppLayerParserStateIssetFlag
is taking 4 parameters and that the second one is a flag that needs
to be checked against APP_LAYER_PARSER_.
Eric Leblond [Sat, 30 Nov 2019 16:20:44 +0000 (17:20 +0100)]
qa/coccinelle: fix false positive in setter getter
Coccinelle test was doing a false positive on the function
AppLayerParserStateSetFlag and AppLayerParserStateIssetFlag.
To address that, this patch adds a new coccinelle markup:
/* coccinelle: AppLayerParserStateSetFlag():2,2:APP_LAYER_PARSER_ */
It indicates that AppLayerParserStateSetFlag is a setter and getter
and that the checks should be disabled inside the function.
Currently this markup is only used for that but following patch will
add some checks on option value.
Eric Leblond [Sat, 30 Nov 2019 10:20:06 +0000 (11:20 +0100)]
qa/coccinelle: port struct-flags.py to Python3
Eric Leblond [Sat, 30 Nov 2019 10:17:50 +0000 (11:17 +0100)]
qa/coccinelle: reformat struct-flags.py
Eric Leblond [Thu, 21 Nov 2019 17:26:49 +0000 (18:26 +0100)]
qa: generate struct-flags.cocci at each run
EmilienCourt [Wed, 4 Dec 2019 10:07:26 +0000 (11:07 +0100)]
doc: fix typo on example
Quotes have been forgotten in the dnp3.data example, which throws an
SC_ERR_INVALID_SIGNATURE(39) if used like in the example.
Jeff Lucovsky [Sun, 1 Dec 2019 18:15:34 +0000 (13:15 -0500)]
detect/analyzer: Improved fast pattern display
When transforms are part of a rule, improve information displayed with
fast patterns to include the original buffer name and whether any
transform(s) are applied.
Jeff Lucovsky [Wed, 27 Nov 2019 19:42:20 +0000 (14:42 -0500)]
detect/analyzer: Suppress direction warnings
This commit suppresses direction warnings by the rules analyzer for ICMP
and ICMPV6 since it's not actionable.
Victor Julien [Thu, 5 Dec 2019 08:20:31 +0000 (09:20 +0100)]
stats: fix stats not always syncing in flow timeout
Jason Ish [Wed, 27 Nov 2019 18:47:01 +0000 (12:47 -0600)]
app-layer: validate TX detect flag callbacks
Check that both are set or unset.
Jason Ish [Wed, 27 Nov 2019 15:50:40 +0000 (09:50 -0600)]
enip: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:18:51 +0000 (16:18 -0600)]
dcerpc: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:08:18 +0000 (16:08 -0600)]
snmp: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:01:09 +0000 (16:01 -0600)]
modbus: add tx detect flags
Jason Ish [Thu, 21 Nov 2019 18:26:32 +0000 (12:26 -0600)]
krb5: register tx detect flags
Related ticker #3345:
https://redmine.openinfosecfoundation.org/issues/3345
Jason Ish [Tue, 26 Nov 2019 19:25:04 +0000 (13:25 -0600)]
rust: define TxDetectFlag struct and binding macros
Define a TxDetectFlag type and macros to generating C
bindings for getting and settings the tx detect
flags.
Jason Ish [Tue, 19 Nov 2019 19:44:31 +0000 (13:44 -0600)]
rust: add tx detect flags function to registration struct
Jason Ish [Tue, 19 Nov 2019 19:42:24 +0000 (13:42 -0600)]
app-layer: add tx detect functions to register struct
Jason Ish [Mon, 25 Nov 2019 22:57:06 +0000 (16:57 -0600)]
detect-engine: check for tx detect flag support
When registing a detection engine, check that the app-layer
protocol supports tx detect flags. Exit with a fatal
error if it does not as this is a code implementation
error that should be resolved during development.
Jason Ish [Mon, 25 Nov 2019 22:56:50 +0000 (16:56 -0600)]
ftpdata: add tx detect flags
Jason Ish [Mon, 25 Nov 2019 22:55:08 +0000 (16:55 -0600)]
debug: add SCReturnBool function exit macro
Jason Ish [Mon, 25 Nov 2019 22:51:44 +0000 (16:51 -0600)]
app-layer: method to see if parser supports tx detect flags
Add method to check if a parser for an app-layer protocol
supports tx detect flags.
This is a bit of a hack for now as where we need to run
this check from we do not have the IP protocol.
Jason Ish [Sun, 24 Nov 2019 05:36:48 +0000 (23:36 -0600)]
github-actions: builds for our tier one linux distributions
Example of using GitHub actions to perform builds across
CentOS, Ubuntu, Debian and the latest Fedora.
Jeff Lucovsky [Sat, 23 Nov 2019 19:47:11 +0000 (14:47 -0500)]
mpm: Fix typos and spelling errors
Jeff Lucovsky [Sat, 23 Nov 2019 19:43:41 +0000 (14:43 -0500)]
detect: Fix spelling errors
Jeff Lucovsky [Sat, 23 Nov 2019 19:35:40 +0000 (14:35 -0500)]
detect: Improve handling of variable values
When one of offset/depth/distance is from a variable, adjust the depth
by the offset as is done with scalar values at parse time.
Jeff Lucovsky [Sat, 23 Nov 2019 19:33:38 +0000 (14:33 -0500)]
detect/mpm: Improved handling of variable values
This commit removes the offset and depth if either of these values are
dependent upon a byte-extract operation.
Victor Julien [Sat, 23 Nov 2019 21:25:02 +0000 (22:25 +0100)]
http: split request/response tx id handling
When HTTP pipelining was in use, the transaction id used for events
and files could be off. If the request side was several requests ahead
of the responses, it would use the HtpState::transaction_cnt for events
and files, even though that is only incremented on complete requests.
Split request and response tx id tracking. The response is still handled
by the HtpState::transaction_cnt, but the request side is now handled by
its own logic.