]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agodetect/dataset: fix 'state' path handling 4177/head
Victor Julien [Thu, 5 Sep 2019 13:00:04 +0000 (15:00 +0200)] 
detect/dataset: fix 'state' path handling

5 years agodatasets/doc: minor fixes and clarifications
Victor Julien [Thu, 5 Sep 2019 08:59:33 +0000 (10:59 +0200)] 
datasets/doc: minor fixes and clarifications

5 years agodatarep: remove notice messages
Victor Julien [Thu, 5 Sep 2019 08:54:28 +0000 (10:54 +0200)] 
datarep: remove notice messages

5 years agodatasets: remove notice messages and improve errors
Victor Julien [Thu, 5 Sep 2019 08:47:32 +0000 (10:47 +0200)] 
datasets: remove notice messages and improve errors

5 years agodoc/dataset: initial documentation 4166/head
Victor Julien [Thu, 25 Apr 2019 14:32:29 +0000 (16:32 +0200)] 
doc/dataset: initial documentation

5 years agosuricatasc: add dataset-add command
Victor Julien [Sun, 14 Jul 2019 06:58:18 +0000 (08:58 +0200)] 
suricatasc: add dataset-add command

5 years agodatasets: unix socket dataset-add command
Victor Julien [Sun, 14 Jul 2019 05:09:12 +0000 (07:09 +0200)] 
datasets: unix socket dataset-add command

5 years agodatasets: match on lists of data
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.

5 years agothash: generalize hash table as used in flow
Victor Julien [Sun, 4 Sep 2016 19:33:45 +0000 (21:33 +0200)] 
thash: generalize hash table as used in flow

Thread safe hash table implementation based on the Flow hash, IP Pair
hash and others.

Hash is array of buckets with per bucket locking. Each bucket has a
list of elements which also individually use locking.

5 years agosuricata: expose system as global
Victor Julien [Thu, 25 Apr 2019 14:52:41 +0000 (16:52 +0200)] 
suricata: expose system as global

5 years agosuricata: --data-dir option
Victor Julien [Thu, 25 Apr 2019 13:42:46 +0000 (15:42 +0200)] 
suricata: --data-dir option

5 years agotravis: add liblzma (xz) for osx 4160/head
Victor Julien [Tue, 3 Sep 2019 09:25:43 +0000 (11:25 +0200)] 
travis: add liblzma (xz) for osx

5 years agoconfigure: bump minimum htp to 0.5.30
Victor Julien [Tue, 27 Aug 2019 09:55:11 +0000 (11:55 +0200)] 
configure: bump minimum htp to 0.5.30

5 years agolzma: make mandatory
Victor Julien [Tue, 27 Aug 2019 08:48:50 +0000 (10:48 +0200)] 
lzma: make mandatory

Libhtp is starting to use it as well, so its safe to make it mandatory
here.

Remove guards for flash file decompression code.

5 years agohttp: fixes stream flags for http tests
Philippe Antoine [Mon, 20 May 2019 10:47:35 +0000 (12:47 +0200)] 
http: fixes stream flags for http tests

5 years agohttp: wait for response line for filename
Philippe Antoine [Tue, 2 Apr 2019 14:32:43 +0000 (16:32 +0200)] 
http: wait for response line for filename

See http evader case 481

5 years agoconst: constify decoder, app-layer, detect funcs
Victor Julien [Mon, 2 Sep 2019 13:29:18 +0000 (15:29 +0200)] 
const: constify decoder, app-layer, detect funcs

5 years agoafl: fix compile warnings for decoder fuzz funcs
Victor Julien [Mon, 2 Sep 2019 13:28:36 +0000 (15:28 +0200)] 
afl: fix compile warnings for decoder fuzz funcs

5 years agotravis-ci: update for minimum Rust version of 1.33. 4141/head 4146/head
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.

5 years agorustfmt: use default rustfmt configuration
Jason Ish [Tue, 27 Aug 2019 16:19:09 +0000 (10:19 -0600)] 
rustfmt: use default rustfmt configuration

Remove our config that limited line length to 80 columns.

5 years agorust: check for minimum Rust version of 1.33.0.
Jason Ish [Tue, 27 Aug 2019 16:15:14 +0000 (10:15 -0600)] 
rust: check for minimum Rust version of 1.33.0.

Related Redmine ticket:
https://redmine.openinfosecfoundation.org/issues/2629

5 years agoinstall: install all files for events rules 4139/head
Philippe Antoine [Mon, 3 Jun 2019 09:01:18 +0000 (11:01 +0200)] 
install: install all files for events rules

Fixes #2786

5 years agoboyermoore: avoid one tolower call
Philippe Antoine [Mon, 3 Jun 2019 14:50:28 +0000 (16:50 +0200)] 
boyermoore: avoid one tolower call

Fixes #1218

5 years agoftp: Ensure non-zero command length with MPM init
Jeff Lucovsky [Wed, 28 Aug 2019 23:12:40 +0000 (19:12 -0400)] 
ftp: Ensure non-zero command length with MPM init

5 years agoconfigure.ac: prevent empty if block (llc check)
Jason Ish [Wed, 28 Aug 2019 18:01:14 +0000 (12:01 -0600)] 
configure.ac: prevent empty if block (llc check)

As AC_SUBST doesn't expand to anything in the shell script, this
will generate a bad script on older versions of autoconf.

Change the logic to eliminate the possibility of an empty
if or else block.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3124

5 years agoconfigure: Remove enable-rust-debug
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.

Closes redmine ticket #3054

5 years agodetect: Improve rule keyword alproto registration
Shivani Bhardwaj [Wed, 28 Aug 2019 10:11:24 +0000 (15:41 +0530)] 
detect: Improve rule keyword alproto registration

1. Set WARN_UNUSED macro on DetectSignatureSetAppProto.
2. Replace all direct 'sets' of Signature::alproto from keyword registration.

Closes redmine ticket #3006.

5 years agodoc: typo fixes 4123/head
Victor Julien [Mon, 26 Aug 2019 10:45:53 +0000 (12:45 +0200)] 
doc: typo fixes

By @espritlibre and @Zeal0us

5 years agoja3: Mention LibNSS dependency for JA3
Nick Price [Thu, 25 Apr 2019 17:16:09 +0000 (13:16 -0400)] 
ja3: Mention LibNSS dependency for JA3

5 years agofix build on m68k with uclibc
Fabrice Fontaine [Wed, 24 Apr 2019 17:14:29 +0000 (19:14 +0200)] 
fix build on m68k with uclibc

uclibc on m68k defines _POSIX_SPIN_LOCKS but does not define
pthread_spin_unlock so check for this function before using
pthread_spin_xxx functions

Fixes:
 - http://autobuild.buildroot.org/results/ed923bcc1454ce90444b8dac7c064b5f4ea4a0a5

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
5 years agoftp: address review comments
Jeff Lucovsky [Fri, 23 Aug 2019 15:34:01 +0000 (11:34 -0400)] 
ftp: address review comments

5 years agoftp: remove RUST guards
Jeff Lucovsky [Fri, 23 Aug 2019 00:12:28 +0000 (20:12 -0400)] 
ftp: remove RUST guards

5 years agoeve/ftp: Modifications for MPM-enabled command descriptor table
Jeff Lucovsky [Fri, 23 Aug 2019 00:09:03 +0000 (20:09 -0400)] 
eve/ftp: Modifications for MPM-enabled command descriptor table

5 years agoapp-layer: Invoke FTP parser cleanup function
Jeff Lucovsky [Fri, 23 Aug 2019 00:08:12 +0000 (20:08 -0400)] 
app-layer: Invoke FTP parser cleanup function

5 years agoftp: Use MPM for command lookup
Jeff Lucovsky [Fri, 23 Aug 2019 00:06:22 +0000 (20:06 -0400)] 
ftp: Use MPM for command lookup

5 years agoftp: Remove LIBJANSSON guards
Jeff Lucovsky [Wed, 21 Aug 2019 23:26:40 +0000 (19:26 -0400)] 
ftp: Remove LIBJANSSON guards

5 years agoeve/ftp: Move "get next line" into app-layer-ftp.c
Jeff Lucovsky [Sun, 21 Jul 2019 16:36:10 +0000 (12:36 -0400)] 
eve/ftp: Move "get next line" into app-layer-ftp.c

5 years agostream: support debug notice message in tfo 4122/head
Victor Julien [Fri, 23 Aug 2019 13:02:52 +0000 (15:02 +0200)] 
stream: support debug notice message in tfo

5 years agodoc: install eBPF files in share directory
Eric Leblond [Mon, 15 Jul 2019 07:29:21 +0000 (09:29 +0200)] 
doc: install eBPF files in share directory

Following proposal by Sascha Steinbiss, let's use /usr/share/suricata
to store the eBPF files.

5 years agobypass: fix build on Windows
Eric Leblond [Sat, 13 Jul 2019 08:47:40 +0000 (10:47 +0200)] 
bypass: fix build on Windows

For the sake of unittests, we need to build capture bypass so we
end up with a Windows build of flow bypass.

5 years agodoc: fix English and some typos
Eric Leblond [Wed, 10 Jul 2019 14:00:23 +0000 (16:00 +0200)] 
doc: fix English and some typos

5 years agodoc: pointer to bpfctrl
Eric Leblond [Sat, 6 Jul 2019 14:30:43 +0000 (16:30 +0200)] 
doc: pointer to bpfctrl

As bpfctrl is currently the easiest way to manage pinned maps,
let's point to it. We will switch doc to suricatacl once support
has been added.

5 years agodoc: improve doc on compiling with eBPF support
Eric Leblond [Sun, 23 Jun 2019 14:58:09 +0000 (16:58 +0200)] 
doc: improve doc on compiling with eBPF support

5 years agodoc: improve XDP cpu redirect documentation
Eric Leblond [Sat, 22 Jun 2019 06:58:36 +0000 (08:58 +0200)] 
doc: improve XDP cpu redirect documentation

5 years agoebpf: add tunnel aware load balancing
Eric Leblond [Sun, 23 Jun 2019 13:07:51 +0000 (15:07 +0200)] 
ebpf: add tunnel aware load balancing

This patch decapsulates GRE tunnel in xdp_lb

5 years agoebpf: add XDP load balancing code
Eric Leblond [Sat, 22 Jun 2019 06:32:15 +0000 (08:32 +0200)] 
ebpf: add XDP load balancing code

This patch uses CPU redirect map to do load balancing. This is a
simplified version of xdp_filter that includes code for bypass.

5 years agodoc: only balance by ip pair
Eric Leblond [Fri, 21 Jun 2019 21:01:33 +0000 (23:01 +0200)] 
doc: only balance by ip pair

As there is some issue with defrag, let's recommend to only do
IP pair load-balacing for RSS

5 years agodoc: document filter.bpf changes
Eric Leblond [Fri, 21 Jun 2019 18:22:47 +0000 (20:22 +0200)] 
doc: document filter.bpf changes

Also adds some info to explain maps.

5 years agobypass: introduce CAPTURE_OFFLOAD
Eric Leblond [Thu, 20 Jun 2019 11:08:44 +0000 (13:08 +0200)] 
bypass: introduce CAPTURE_OFFLOAD

This define is used to remove reference to capture bypass in case
no capture method implementing this is active.

This patch also introduces CAPTURE_OFFLOAD_MANAGER that is defined
if we need the flow bypass manager code.

5 years agoflow-hash: generalize function
Eric Leblond [Thu, 20 Jun 2019 11:02:51 +0000 (13:02 +0200)] 
flow-hash: generalize function

THis patch generalizes the function to get a flow by its flowkey
by removing the call setting it to capture bypassed state.

5 years agoebpf: improve parsing in filter.bpf
Eric Leblond [Wed, 19 Jun 2019 07:57:38 +0000 (09:57 +0200)] 
ebpf: improve parsing in filter.bpf

Parse VLAN and only filter on IPv4. This patch also change the type
of the counter to get a per CPU hash.

5 years agodetect: fix FP on ICMP unreachable errors 4115/head
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.

Bug #2769.

5 years agomain: fix typo in output
Jeff Lucovsky [Thu, 15 Aug 2019 22:56:21 +0000 (18:56 -0400)] 
main: fix typo in output

5 years agostream/tcp: correct spelling typos
Jeff Lucovsky [Wed, 14 Aug 2019 23:20:21 +0000 (19:20 -0400)] 
stream/tcp: correct spelling typos

5 years agostream/tcp: support TCP fast open
Victor Julien [Sat, 1 Sep 2018 16:54:40 +0000 (18:54 +0200)] 
stream/tcp: support TCP fast open

5 years agodecode/tcp: TCP fast open option decoding
Victor Julien [Sat, 1 Sep 2018 08:22:41 +0000 (10:22 +0200)] 
decode/tcp: TCP fast open option decoding

Support both regular TFO and TFO as part of the experimental
options support.

5 years agosignature: fixes leak with duplicate signatures 4113/head
Philippe Antoine [Wed, 22 May 2019 15:31:14 +0000 (17:31 +0200)] 
signature: fixes leak with duplicate signatures

5 years agoboyermoore: optimization with one alloc less
Philippe Antoine [Tue, 4 Jun 2019 09:46:01 +0000 (11:46 +0200)] 
boyermoore: optimization with one alloc less

Fixes #1220

5 years agodetectproto: adding missing probing parsers
Philippe Antoine [Thu, 1 Aug 2019 12:12:54 +0000 (14:12 +0200)] 
detectproto: adding missing probing parsers

In direction TO_CLIENT for symetric protocols

5 years agodetect-geoip: add info for list keywords
Eric Leblond [Fri, 2 Aug 2019 07:57:42 +0000 (09:57 +0200)] 
detect-geoip: add info for list keywords

5 years agodoc: fix typos in geoip doc
Eric Leblond [Fri, 2 Aug 2019 07:32:08 +0000 (09:32 +0200)] 
doc: fix typos in geoip doc

5 years agodoc: fix display of icmp code and type array
Eric Leblond [Thu, 1 Aug 2019 08:33:44 +0000 (10:33 +0200)] 
doc: fix display of icmp code and type array

5 years agodoc: use a table to list direction filter in geoip
Eric Leblond [Thu, 1 Aug 2019 07:49:17 +0000 (09:49 +0200)] 
doc: use a table to list direction filter in geoip

5 years agodoc: fix geoip syntax
Eric Leblond [Wed, 31 Jul 2019 22:02:30 +0000 (00:02 +0200)] 
doc: fix geoip syntax

Spaces are not allowed before country code.

5 years agounix/socket: Add rev date to version info
Shivani Bhardwaj [Wed, 24 Jul 2019 15:48:38 +0000 (21:18 +0530)] 
unix/socket: Add rev date to version info

5 years agoDocumenting base64_decode and base64_content
Vinjar Hillestad [Fri, 21 Jun 2019 14:09:28 +0000 (14:09 +0000)] 
Documenting base64_decode and base64_content

base64 doc changes based on #4027 pull feedback

5 years agoAdd documentation for --with-clang parameter 4112/head
Hilko Bengen [Wed, 24 Jul 2019 09:36:53 +0000 (11:36 +0200)] 
Add documentation for --with-clang parameter

5 years agoebpf: Use $(CLANG) to build eBPF programs
Hilko Bengen [Thu, 21 Feb 2019 08:34:41 +0000 (09:34 +0100)] 
ebpf: Use $(CLANG) to build eBPF programs

This change makes it possible to generate the eBPF programs even if
Suricata itself is built a different C compiler. It also simplifies
how the correct llc program is detected.

Implements Feature https://redmine.openinfosecfoundation.org/issues/2789

5 years agoconfigure: Introduce CLANG variable
Hilko Bengen [Tue, 22 Jan 2019 17:10:47 +0000 (18:10 +0100)] 
configure: Introduce CLANG variable

5 years agocleanup: eliminate warnings/errors with debug build on macos
Jeff Lucovsky [Fri, 26 Jul 2019 22:44:27 +0000 (15:44 -0700)] 
cleanup: eliminate warnings/errors with debug build on macos

5 years agouserguide: remove old reference to rule-reload option
Andreas Herz [Mon, 12 Aug 2019 20:05:40 +0000 (22:05 +0200)] 
userguide: remove old reference to rule-reload option

5 years agosrc/detect: check DetectBufferSetActiveList return code
Shivani Bhardwaj [Sat, 10 Aug 2019 18:05:04 +0000 (23:35 +0530)] 
src/detect: check DetectBufferSetActiveList return code

Make sure to always check the return codes of DetectBufferSetActiveList.
Also, force this warning on function prototype.

Closes redmine ticket #3005.

5 years agosignature: avoids overflow from VariableNameHash
Philippe Antoine [Thu, 1 Aug 2019 13:27:39 +0000 (15:27 +0200)] 
signature: avoids overflow from VariableNameHash

5 years agodetect/analyzer: remove HAVE_LIBJANSSON cpp guards 4108/head
Jeff Lucovsky [Sun, 18 Aug 2019 22:06:01 +0000 (18:06 -0400)] 
detect/analyzer: remove HAVE_LIBJANSSON cpp guards

5 years agospelling: correct spelling typo
Jeff Lucovsky [Sun, 18 Aug 2019 22:04:58 +0000 (18:04 -0400)] 
spelling: correct spelling typo

5 years agodetect/analyzer: add support for http_content_type
Jeff Lucovsky [Sun, 18 Aug 2019 22:03:01 +0000 (18:03 -0400)] 
detect/analyzer: add support for http_content_type

5 years agorust: Fix deprecation warnings
Shivani Bhardwaj [Fri, 26 Jul 2019 17:52:34 +0000 (23:22 +0530)] 
rust: Fix deprecation warnings

Fix the following warnings by compiler,
(1) warning: use of deprecated item 'take_until_s': Please use `take_until` instead
(2) warning: `...` range patterns are deprecated

For the second warning, the builtin lint
"ellipsis_inclusive_range_pattern" has been added which causes the
following warning to show up with rustc 1.24.

warning: unknown lint: `ellipsis_inclusive_range_patterns`
  --> /home/travis/build/OISF/suricata/suricata-5.0.0-dev/rust/src/lib.rs:18:10
   |
18 | #![allow(ellipsis_inclusive_range_patterns)]
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(unknown_lints)] on by default

Since there is no other way to fix this, the above warning shall stay.
We need to take care of modifying this if and when the support for 1.24
as MSRV is dropped.

5 years agoapplayer: fix typo in debug output
jason taylor [Fri, 16 Aug 2019 17:54:41 +0000 (13:54 -0400)] 
applayer: fix typo in debug output

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agorule-reload: enable rule-reload for -s and -S run as well 4099/head
Andreas Herz [Mon, 12 Aug 2019 20:19:14 +0000 (22:19 +0200)] 
rule-reload: enable rule-reload for -s and -S run as well

6 years agopcap: fix breakloop error handling 4067/head
Victor Julien [Wed, 5 Jun 2019 20:06:08 +0000 (22:06 +0200)] 
pcap: fix breakloop error handling

Ticket #3004

6 years agonetmap: suppress format truncation warning 4062/head
Victor Julien [Fri, 19 Jul 2019 20:16:33 +0000 (22:16 +0200)] 
netmap: suppress format truncation warning

  CC       source-netmap.o
source-netmap.c: In function ‘NetmapOpen’:
source-netmap.c:327:56: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 10 and 57 [-Werror=format-truncation=]
         snprintf(devname, sizeof(devname), "netmap:%s%s%s",
                                                        ^~
                 ns->iface, strlen(optstr) ? "/" : "", optstr);
                                                       ~~~~~~
source-netmap.c:327:9: note: ‘snprintf’ output 8 or more bytes (assuming 70) into a destination of size 64
         snprintf(devname, sizeof(devname), "netmap:%s%s%s",
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 ns->iface, strlen(optstr) ? "/" : "", optstr);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source-netmap.c:330:59: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 8 and 55 [-Werror=format-truncation=]
         snprintf(devname, sizeof(devname), "netmap:%s-%d%s%s",
                                                           ^~
                 ns->iface, ring, strlen(optstr) ? "/" : "", optstr);
                                                             ~~~~~~
source-netmap.c:330:9: note: ‘snprintf’ output 10 or more bytes (assuming 72) into a destination of size 64
         snprintf(devname, sizeof(devname), "netmap:%s-%d%s%s",
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 ns->iface, ring, strlen(optstr) ? "/" : "", optstr);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source-netmap.c:316:54: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
         snprintf(devname, sizeof(devname), "%s}%d%s%s",
                                                      ^
source-netmap.c:316:9: note: ‘snprintf’ output 3 or more bytes (assuming 65) into a destination of size 64
         snprintf(devname, sizeof(devname), "%s}%d%s%s",
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 ns->iface, ring, strlen(optstr) ? "/" : "", optstr);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Gcc 8 with -Wformat-truncation=1

6 years agodetect/mpm: put transform into 'profile name'
Victor Julien [Fri, 19 Jul 2019 14:05:30 +0000 (16:05 +0200)] 
detect/mpm: put transform into 'profile name'

So that profiling gives more info about cost of the mpm
engines when they use transforms.

6 years agodetect/dns: register correct profile name
Victor Julien [Fri, 19 Jul 2019 14:10:05 +0000 (16:10 +0200)] 
detect/dns: register correct profile name

6 years agostring: making shortening function global
Victor Julien [Fri, 19 Jul 2019 13:07:46 +0000 (15:07 +0200)] 
string: making shortening function global

6 years agodevice: break string shortening out of device shortening
Victor Julien [Fri, 19 Jul 2019 13:03:09 +0000 (15:03 +0200)] 
device: break string shortening out of device shortening

6 years agodevice: remove duplicate length check
Victor Julien [Fri, 19 Jul 2019 13:02:10 +0000 (15:02 +0200)] 
device: remove duplicate length check

Shorten code handles all cases correctly.

6 years agodetect: move includes/declarations closer to use
Victor Julien [Fri, 19 Jul 2019 11:48:33 +0000 (13:48 +0200)] 
detect: move includes/declarations closer to use

6 years agodetect: fix inaccurate comments
Victor Julien [Fri, 19 Jul 2019 11:48:15 +0000 (13:48 +0200)] 
detect: fix inaccurate comments

6 years agopfring: Fix kernel version in comment
Max Fillinger [Thu, 18 Jul 2019 11:03:32 +0000 (13:03 +0200)] 
pfring: Fix kernel version in comment

6 years agoaf-packet: fix build on recent Linux kernels
Eric Leblond [Wed, 17 Jul 2019 10:35:12 +0000 (12:35 +0200)] 
af-packet: fix build on recent Linux kernels

6 years agorust: fix compiler warning
Shivani Bhardwaj [Tue, 16 Jul 2019 08:39:13 +0000 (14:09 +0530)] 
rust: fix compiler warning

rustc 1.36 introduced:

error: variable does not need to be mutable
   --> src/dhcp/parser.rs:202:17
    |
202 |             let mut malformed_options = false;
    |                 ----^^^^^^^^^^^^^^^^^
    |                 |
    |                 help: remove this `mut`
    |
note: lint level defined here
   --> src/lib.rs:18:38
    |
18  | #![cfg_attr(feature = "strict", deny(warnings))]
    |                                      ^^^^^^^^
    = note: #[deny(unused_mut)] implied by #[deny(warnings)]

error: aborting due to previous error

error: Could not compile `suricata`.

Ticket #3072.

6 years agossl: register probing for port 443 if no config
Philippe Antoine [Wed, 10 Jul 2019 19:02:09 +0000 (21:02 +0200)] 
ssl: register probing for port 443 if no config

6 years agoconfigure: Add date with rev information
Shivani Bhardwaj [Wed, 17 Jul 2019 13:34:36 +0000 (19:04 +0530)] 
configure: Add date with rev information

Date makes it even clearer that when was the last commit for the build
that one is running. Add this info alongwith rev. Change inspired by
rustc.

Before
```
$ suricata -V
This is Suricata version 5.0.0-dev (rev 2d217e666)
```

After
```
This is Suricata version 5.0.0-dev (2d217e666 2019-07-12)
```

Closes redmine ticket #3092

6 years agooutput/json: Refactor output buffer size macro
Jeff Lucovsky [Sat, 6 Jul 2019 13:42:10 +0000 (09:42 -0400)] 
output/json: Refactor output buffer size macro

6 years agoeve/json: Break multiline FTP responses into array
Jeff Lucovsky [Tue, 18 Jun 2019 23:06:59 +0000 (19:06 -0400)] 
eve/json: Break multiline FTP responses into array

This changeset breaks multi-line FTP responses into separate array
entries. Multi-line responses are those with "text-1\r\ntext-2[...]".
Each of \r\n delimited text segments is reported in the `reply` array;
each text segment _may_ include a completion code; completion codes are
reported in the `completion_code` array.

6 years agoeve/ftp: Refactor and reduce logging functions
Jeff Lucovsky [Sat, 15 Jun 2019 14:05:20 +0000 (10:05 -0400)] 
eve/ftp: Refactor and reduce logging functions

6 years agoftp: Generalize prelim positive reply
Jeff Lucovsky [Sat, 15 Jun 2019 14:03:23 +0000 (10:03 -0400)] 
ftp: Generalize prelim positive reply

Extend special case for reply code 150 to handle all preliminary
positive reply -- reply codes with `1xy`.

6 years agoftp: reply code 150 doesn't end tx
Victor Julien [Tue, 11 Jun 2019 11:33:49 +0000 (13:33 +0200)] 
ftp: reply code 150 doesn't end tx

6 years agoftp: fix reply without request
Victor Julien [Tue, 11 Jun 2019 10:57:19 +0000 (12:57 +0200)] 
ftp: fix reply without request

Permit picking up any reply w/o a request. Observed unsolicited server
messages before connection termination.

Previously the code assumed that this could only happen on connection
start when there was no previously recorded command.

6 years agoftp: implement progress tracking
Victor Julien [Tue, 11 Jun 2019 10:09:38 +0000 (12:09 +0200)] 
ftp: implement progress tracking

Make sure FTP_STATE_FINISHED is returned for transactions that
are marked 'done'.

This is necessary for timely logging and inspection.