Giuseppe Longo [Mon, 28 Jan 2019 15:15:22 +0000 (16:15 +0100)]
app-layer-htp: use stream depth with filestore
This permits to use stream-depth value set for file-store.
Currently if a file is being stored and hits a limit,
such as request or response body, it will be truncated
although file-store.stream-depth is enabled but the file should be
closed and not truncated.
Two unit tests have been added to verify that:
- a file is stored correctly
- chunk's length computation doesn’t cause an underflow
Jack Mott [Mon, 19 Aug 2019 19:36:30 +0000 (13:36 -0600)]
classification: add command-and-control classtype
Added new classtype 'command-and-control' to be used with more
general TROJAN/MALWARE categories to designate traffic between
infected machine and c2 server.
Up until now, suricatactl would delete any directory that is provided as
an argument on command line. This patch adds a basic test for the
directories `tmp`, `00` and `ff` in order to justify that the provided
directory is actually a filestore directory.
Additionally, some code has been broken up and made more readable and
pythonic.
Jason Ish [Fri, 6 Sep 2019 15:39:29 +0000 (09:39 -0600)]
ftp: removing uninitialized variable warning
output-json-ftp.c: In function ‘JsonFTPLogger’:
output-json-ftp.c:129:9: warning: ‘js_respcode_list’ may be used uninitialized in this function [-Wmaybe-uninitialized]
129 | json_object_set_new(cjs, "completion_code", js_respcode_list);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
output-json-ftp.c:74:13: note: ‘js_respcode_list’ was declared here
74 | json_t *js_respcode_list;
| ^~~~~~~~~~~~~~~~
output-json-ftp.c:128:9: warning: ‘js_resplist’ may be used uninitialized in this function [-Wmaybe-uninitialized]
128 | json_object_set_new(cjs, "reply", js_resplist);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
output-json-ftp.c:73:13: note: ‘js_resplist’ was declared here
73 | json_t *js_resplist;
| ^~~~~~~~~~~
Jason Ish [Mon, 2 Sep 2019 17:02:47 +0000 (11:02 -0600)]
rules: no longer install rules to /etc/suricata/rules
Stop falling back to the old method of installing rules into
/etc/suricata/rules if Suricata-Update is not available.
The goal here is to move away from the behaviour of installing
rules to /etc/suricata/rules as part of the default install
process. The engine provided rules are already installed to
/usr/share/suricata/rules, which can then be used as input
to rule management tools such as Suricata-Update.
This does not change the behaviour for Suricata release users
with the bundled Suricata-Update.
Also removes Oinkmaster and PulledPork suggestion for rule
management.
Jason Ish [Tue, 20 Aug 2019 15:20:53 +0000 (09:20 -0600)]
doc: use describe instead of option for old Sphinx
Older versions of Sphinx will generate duplicate IDs when you have
options like:
.. option:: some-option
.. option:: some-other-option
The version of Sphinx provided on CentOS 7 has this issue, newer
versions of Sphinx do not. As CentOS 7 is still a popular
distribution, change ".. option" to ".. describe" which has the
same visual output, but does not generate links.
Victor Julien [Mon, 20 Nov 2017 10:22:57 +0000 (11:22 +0100)]
datasets: match on lists of data
Datasets are sets/lists of data that can be accessed or added from
the rule language.
This patch implements 3 data types:
1. string (or buffer)
2. md5
3. sha256
The patch also implements 2 new rule keywords:
1. dataset
2. datarep
The dataset keyword allows matching against a list of values to see if
it exists or not. It can also add the value to the set. The set can
optionally be stored to disk on exit.
The datarep support matching/lookups only. With each item in the set a
reputation value is stored and this value can be matched against. The
reputation value is unsigned 16 bit, so values can be between 0 and 65535.
Datasets can be registered in 2 ways:
1. through the yaml
2. through the rules
The goal of this rules based approach is that rule writers can start using
this without the need for config changes.
A dataset is implemented using a thash hash table. Each dataset is its own
separate thash.
Jason Ish [Tue, 27 Aug 2019 16:52:59 +0000 (10:52 -0600)]
travis-ci: update for minimum Rust version of 1.33.
Plus:
- Set latest known working stable Rust to 1.37.0.
- Remove test for --disable-rust, as that as option is
not respected anymore.
- Add test for old/unsupported version of Rust to make
sure ./configure fails.
- Other minor cleanups.
Shivani Bhardwaj [Thu, 20 Jun 2019 11:19:25 +0000 (16:49 +0530)]
configure: Remove enable-rust-debug
Get rid of enable-rust-debug flag and use enable-debug for acheiving the
desired functionality. From now, adding `--enable-debug` to `configure`
shall create an [unoptimitized + debuginfo] target. Rest behavior stays
the same.
Victor Julien [Thu, 22 Aug 2019 09:28:36 +0000 (11:28 +0200)]
detect: fix FP on ICMP unreachable errors
ICMP unreachable errors are linked to the flow they send an error for.
This would lead to the detection engine calling the TX inspection
engines on them.
The stream inspect engine would default to a match for non-UDP
and non-TCP as for ICMP we're not expected to use a TX inspect engine
for stream data.
This all would lead to a false positive match.
This patch fixes this by making sure the TX engines are not called if
the packet protocol and flow protocol are not the same.