]> git.ipfire.org Git - people/ms/suricata.git/log
people/ms/suricata.git
7 years agoUpdate Changelog for 4.0.0-rc1 release
Victor Julien [Wed, 28 Jun 2017 10:43:44 +0000 (12:43 +0200)] 
Update Changelog for 4.0.0-rc1 release

7 years agodoc: document http-body logging
Eric Leblond [Wed, 28 Jun 2017 11:56:43 +0000 (13:56 +0200)] 
doc: document http-body logging

7 years agooutput-json-alert: fix error handling
Eric Leblond [Mon, 26 Jun 2017 16:19:39 +0000 (18:19 +0200)] 
output-json-alert: fix error handling

MemBuffer was not freed in case of allocation error.

7 years agooutput-json-alert: log http body
Eric Leblond [Mon, 26 Jun 2017 16:17:47 +0000 (18:17 +0200)] 
output-json-alert: log http body

Add support for HTTP body logging as printable or as base64.

7 years agooutput-json-http: add functions to log http body
Giuseppe Longo [Thu, 14 Apr 2016 12:26:58 +0000 (14:26 +0200)] 
output-json-http: add functions to log http body

This patch adds two functions that permits to log the http body
in printable or base64 format.

7 years agoAdd NULL-terminator to app-layer template (fix #1930)
Pierre Chifflier [Sun, 23 Oct 2016 15:20:25 +0000 (17:20 +0200)] 
Add NULL-terminator to app-layer template (fix #1930)

7 years agolog: destroy file mutex
Victor Julien [Wed, 28 Jun 2017 07:23:42 +0000 (09:23 +0200)] 
log: destroy file mutex

7 years agolog: wrap rotation and write in lock
Jason Ish [Mon, 26 Jun 2017 17:04:46 +0000 (11:04 -0600)] 
log: wrap rotation and write in lock

The application log is subject to rotation, so the check for
rotation, the actual rotation and write needs to be done under
lock to ensure the file pointer is in a consisten state
at the time of write().

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2155

7 years agorust/dns: handle multiple txt strings
Jason Ish [Tue, 27 Jun 2017 22:47:23 +0000 (16:47 -0600)] 
rust/dns: handle multiple txt strings

Fix handling of TXT records when there are multiple strings
in a single TXT record. For now, conform to the C implementation
where an answer record is created for each string in a single
txt record.

Also removes the data_len field from the answer entry. In Rust,
the length is available from actual data, which after decoding
may actually be different than the encoded data length, so just
use the length from the actual data.

7 years agorust: enable/disable yaml settings
Victor Julien [Tue, 27 Jun 2017 19:51:00 +0000 (21:51 +0200)] 
rust: enable/disable yaml settings

Based on compile time settings, enable/disable app-layers
and loggers.

7 years agoAdd NTP event rules (commented) to the default config
Pierre Chifflier [Tue, 20 Jun 2017 14:11:58 +0000 (16:11 +0200)] 
Add NTP event rules (commented) to the default config

7 years agoAdd event rules for NTP events
Pierre Chifflier [Tue, 20 Jun 2017 11:57:46 +0000 (13:57 +0200)] 
Add event rules for NTP events

7 years agoNTP: change parse function to return the number of parsed messages
Pierre Chifflier [Mon, 19 Jun 2017 11:40:42 +0000 (13:40 +0200)] 
NTP: change parse function to return the number of parsed messages

7 years agoAdd NTP parser (rust-experimental)
Pierre Chifflier [Mon, 19 Jun 2017 11:19:23 +0000 (13:19 +0200)] 
Add NTP parser (rust-experimental)

7 years agoRust gen-c-headers: keep 'const' attribute
Pierre Chifflier [Mon, 19 Jun 2017 11:20:07 +0000 (13:20 +0200)] 
Rust gen-c-headers: keep 'const' attribute

7 years agoAutotools: add switch to build experimental Rust parsers
Pierre Chifflier [Mon, 19 Jun 2017 11:17:20 +0000 (13:17 +0200)] 
Autotools: add switch to build experimental Rust parsers

7 years agopcap: fix linktype raw issues
Victor Julien [Tue, 27 Jun 2017 13:07:40 +0000 (15:07 +0200)] 
pcap: fix linktype raw issues

On OpenBSD 6.0 and 6.1 the following pcap gets a datalink type of
101 instead of our defined DLT_RAW.

    File type:           Wireshark/tcpdump/... - pcap
    File encapsulation:  Raw IP
    File timestamp precision:  microseconds (6)
    Packet size limit:   file hdr: 262144 bytes
    Number of packets:   23
    File size:           11 kB
    Data size:           11 kB
    Capture duration:    7,424945 seconds
    First packet time:   2017-05-25 21:59:31,957953
    Last packet time:    2017-05-25 21:59:39,382898
    Data byte rate:      1536 bytes/s
    Data bit rate:       12 kbps
    Average packet size: 496,00 bytes
    Average packet rate: 3 packets/s
    SHA1:                120cff9878b93ac74b68fb9216027bef3b3c018f
    RIPEMD160:           35fa287bf30d8be8b8654abfe26e8d3883262e8e
    MD5:                 13fe4bc50fe09bdd38f07739bd1ff0f0
    Strict time order:   True
    Number of interfaces in file: 1
    Interface #0 info:
                         Encapsulation = Raw IP (7/101 - rawip)
                         Capture length = 262144
                         Time precision = microseconds (6)
                         Time ticks per second = 1000000
                         Number of stat entries = 0
                         Number of packets = 23

On Linux it is 12.

On the tcpdump/libpcap site the DLT_RAW is defined as 101:
http://www.tcpdump.org/linktypes.html

Strangely, on OpenBSD the DLT_RAW macro is defined as 14 as expected.
So for some reason, libpcap on OpenBSD uses 101 which seems to match
the tcpdump/libpcap documentation.

So this patch adds support for datalink 101 as RAW.

7 years agodetect: fix crash when stream inspect runs on UDP
Victor Julien [Tue, 27 Jun 2017 07:59:48 +0000 (09:59 +0200)] 
detect: fix crash when stream inspect runs on UDP

Certain rules can apply to both TCP and UDP. For example 'alert dns'
rules are inspected against both TCP and UDP. This lead to the
stream inspect engine being called on a UDP packet.

This patch fixes the issue by exiting early from the stream inspect
engine if a) proto is not TCP or b) ssn is not available

Bug #2158.

7 years agoeve/alert: redo option parsing
Victor Julien [Mon, 26 Jun 2017 11:53:22 +0000 (13:53 +0200)] 
eve/alert: redo option parsing

Clean up option parsing. Allow options to be disabled as well as
enabled.

E.g.
    metadata: true
    flow: false

The metadata setting will enable all. Then flow is disabled.

7 years agodoc: info about new config for alert events in EVE
Eric Leblond [Thu, 22 Jun 2017 07:20:05 +0000 (09:20 +0200)] 
doc: info about new config for alert events in EVE

7 years agooutput-json-alert: rename applayer to metadata
Eric Leblond [Mon, 26 Jun 2017 08:41:11 +0000 (10:41 +0200)] 
output-json-alert: rename applayer to metadata

7 years agodoc: add app_proto to alert event
Eric Leblond [Thu, 22 Jun 2017 07:15:00 +0000 (09:15 +0200)] 
doc: add app_proto to alert event

7 years agooutput-json-alert: add app_proto or flow to events
Eric Leblond [Wed, 21 Jun 2017 17:50:11 +0000 (19:50 +0200)] 
output-json-alert: add app_proto or flow to events

This patch adds a partial flow entry in the alert event
(if applayer or flow is selected) or simply app_proto if
it is not.

app_proto is useful as filter and aggregation field. And
the partial flow entry contains more information about the
proto as well as some volumetry info.

7 years agorust: make distcheck fixes
Jason Ish [Wed, 21 Jun 2017 18:44:37 +0000 (12:44 -0600)] 
rust: make distcheck fixes

7 years agorust: for sclog*, strip nul bytes before logging
Jason Ish [Wed, 21 Jun 2017 15:06:22 +0000 (09:06 -0600)] 
rust: for sclog*, strip nul bytes before logging

7 years agorust: safe string handling in logging
Jason Ish [Tue, 20 Jun 2017 18:47:34 +0000 (12:47 -0600)] 
rust: safe string handling in logging

In logging (SCLog*), safely convert strings to cstrings instead
of blindly unwrapping them.

Also implement a simple rust logger if the Suricata C context
is not available.

7 years agorust/dns: cargo unit test prototype
Jason Ish [Tue, 20 Jun 2017 16:30:35 +0000 (10:30 -0600)] 
rust/dns: cargo unit test prototype

Do remove compiler warning when building without unit tests.

7 years agorust: save cargo and CARGO_HOME to variables
Jason Ish [Tue, 20 Jun 2017 16:17:54 +0000 (10:17 -0600)] 
rust: save cargo and CARGO_HOME to variables

During configure, substitute the path of cargo, as well as the
value of CARGO_HOME as variables. This fixes the case where a
user might do:
  make
  sudo make install
Which will cause the cargo bits to be rebuilt, including
re-downloading external crates.

By saving these to variables we can be sure that the same
values are used during make install as were used during
make which prevents the Rust artifacts from being rebuild
during "sudo make install".

7 years agooutput-json-alert: fallback to payload if stream is void
Eric Leblond [Thu, 22 Jun 2017 15:48:00 +0000 (17:48 +0200)] 
output-json-alert: fallback to payload if stream is void

If stream logging results in no data then we fallback to payload
data to get somethingi that could be interesting  instead of
nothing.

7 years agosuricata.yaml: add some port variables
Eric Leblond [Tue, 20 Jun 2017 17:00:22 +0000 (19:00 +0200)] 
suricata.yaml: add some port variables

These variables are used by Talos ruleset and defining them allow
to get almost all rules of ruleset loaded.

7 years agodetect-asn1: fix memory leak
Eric Leblond [Mon, 19 Jun 2017 20:54:17 +0000 (22:54 +0200)] 
detect-asn1: fix memory leak

7 years agoutil-print: add 0 at end of buffer
Eric Leblond [Mon, 19 Jun 2017 18:16:01 +0000 (20:16 +0200)] 
util-print: add 0 at end of buffer

Add a 0 at the end of the printed buffer to be sure we terminate
with a 0 to avoid problem when calling strlen().

7 years agotunnel: refactor tunnel verdict handling
Victor Julien [Tue, 20 Jun 2017 10:13:14 +0000 (12:13 +0200)] 
tunnel: refactor tunnel verdict handling

Observed:

STARTTLS creates 2 pseudo packets which are tied to a real packet.
TPR (tunnel packet ref) counter increased to 2.

Pseudo 1: goes through 'verdict', increments 'ready to verdict' to 1.
Packet pool return code frees this packet and decrements TPR in root
to 1. RTV counter not changed. So both are now 1.

Pseudo 2: verdict code sees RTV == TPR, so verdict is set based on
pseudo packet. This is too soon. Packet pool return code frees this
packet and decrements TPR in root to 0.

Real packet: TRP is 0 so set verdict on this packet. As verdict was
already set, NFQ reports an issue.

The decrementing of TPR doesn't seem to make sense as RTV is not
updated.

Solution:

This patch refactors the ref count and verdict count logic. The beef
is now handled in the generic function TmqhOutputPacketpool(). NFQ
and IPFW call a utility function VerdictTunnelPacket to see if they
need to verdict a packet.

Remove some unused macro's for managing these counters.

7 years agonfs: log number of chunks that xfer'd a file
Victor Julien [Mon, 19 Jun 2017 07:52:16 +0000 (09:52 +0200)] 
nfs: log number of chunks that xfer'd a file

7 years agonfs: add nfs to alerts
Victor Julien [Sat, 17 Jun 2017 08:39:24 +0000 (10:39 +0200)] 
nfs: add nfs to alerts

Also add a single 'applayer' option for alert augmentation that
applies to all app-layers.

7 years agonfs: add to fileinfo events
Victor Julien [Fri, 16 Jun 2017 18:35:33 +0000 (20:35 +0200)] 
nfs: add to fileinfo events

7 years agorust/nfs: add (file)handle to log as crc32
Victor Julien [Fri, 16 Jun 2017 14:09:18 +0000 (16:09 +0200)] 
rust/nfs: add (file)handle to log as crc32

7 years agotravis: set dist to trusty (Ubuntu 14.04).
Jason Ish [Fri, 16 Jun 2017 14:54:38 +0000 (08:54 -0600)] 
travis: set dist to trusty (Ubuntu 14.04).

The default is still 12.04 which is EOL.

7 years agorust/dns: pass byte arrays directly to rust/json
Jason Ish [Fri, 16 Jun 2017 05:40:50 +0000 (23:40 -0600)] 
rust/dns: pass byte arrays directly to rust/json

Using the json.set_string_from_bytes which will
safely convert the bytes printable ascii string
before logging.

7 years agorust/lua: use lua_pushlstring for strings
Jason Ish [Fri, 16 Jun 2017 05:39:26 +0000 (23:39 -0600)] 
rust/lua: use lua_pushlstring for strings

Lua strings can contain NULLs, and Rust strings are UTF8 which
can also contain NULLs. Use pushlstring so a NULL containing
string can be pushed.

7 years agorust/json: only output printable characters
Jason Ish [Fri, 16 Jun 2017 05:38:04 +0000 (23:38 -0600)] 
rust/json: only output printable characters

Rust strings are UTF8 and we cannot yet rely on jansson
having json_stringn on all supported OS distributions yet
so sanitize strings to ascii before printing.

Also add set_string_from_bytes which is like set_string, but
accepts a byte array as input.

7 years agorust/nfs: fix style warning
Victor Julien [Fri, 16 Jun 2017 10:02:14 +0000 (12:02 +0200)] 
rust/nfs: fix style warning

7 years agonfs: nfs_version keyword
Victor Julien [Fri, 16 Jun 2017 08:25:18 +0000 (10:25 +0200)] 
nfs: nfs_version keyword

Store nfs version in tx and add keyword to match on it.

7 years agoeve/nfs: log nfs version
Victor Julien [Fri, 16 Jun 2017 06:09:48 +0000 (08:09 +0200)] 
eve/nfs: log nfs version

7 years agonfs: rename nfs3 to nfs
Victor Julien [Thu, 15 Jun 2017 13:00:12 +0000 (15:00 +0200)] 
nfs: rename nfs3 to nfs

Since the parser now also does nfs2, the name nfs3 became confusing.
As it's still in beta, we can rename so this patch renames all 'nfs3'
logic to simply 'nfs'.

7 years agonfs3: create file tx for read on request
Victor Julien [Wed, 14 Jun 2017 14:34:00 +0000 (16:34 +0200)] 
nfs3: create file tx for read on request

This is done so that we can add creds to it.

7 years agonfs3: add readdirplus path
Victor Julien [Wed, 14 Jun 2017 12:17:58 +0000 (14:17 +0200)] 
nfs3: add readdirplus path

7 years agonfs: log more rpc
Victor Julien [Wed, 14 Jun 2017 10:41:49 +0000 (12:41 +0200)] 
nfs: log more rpc

7 years agonfs: split record parsers into different files
Victor Julien [Wed, 14 Jun 2017 08:22:08 +0000 (10:22 +0200)] 
nfs: split record parsers into different files

7 years agonfs3: fill bytes corner case
Victor Julien [Tue, 13 Jun 2017 06:39:16 +0000 (08:39 +0200)] 
nfs3: fill bytes corner case

7 years agonfs: fix rust data type declaration
Victor Julien [Mon, 12 Jun 2017 21:15:42 +0000 (23:15 +0200)] 
nfs: fix rust data type declaration

7 years agonfs2: basic record parsing and tracking
Victor Julien [Mon, 12 Jun 2017 07:41:31 +0000 (09:41 +0200)] 
nfs2: basic record parsing and tracking

7 years agonfs3: support NFS over UDP
Victor Julien [Sat, 10 Jun 2017 21:19:29 +0000 (23:19 +0200)] 
nfs3: support NFS over UDP

7 years agonfs3: probing parsers in both directions
Victor Julien [Sat, 10 Jun 2017 20:31:40 +0000 (22:31 +0200)] 
nfs3: probing parsers in both directions

7 years agonfs3: search for next record if needed after GAP
Victor Julien [Sat, 10 Jun 2017 12:58:06 +0000 (14:58 +0200)] 
nfs3: search for next record if needed after GAP

7 years agorust/nfs: handle GAPs
Victor Julien [Thu, 8 Jun 2017 13:13:49 +0000 (15:13 +0200)] 
rust/nfs: handle GAPs

In normal records it will try to continue parsing.

GAP 'data' will be passed to file api as '0's. New call is used
so that the file API does know it is dealing with a GAP. Such
files are flagged as truncated at the end of the file and no
checksums are calculated.

7 years agonfs3: parse mkdir and rmdir request records
Victor Julien [Sun, 11 Jun 2017 09:27:31 +0000 (11:27 +0200)] 
nfs3: parse mkdir and rmdir request records

7 years agoapp-layer: remove checks
Victor Julien [Thu, 15 Jun 2017 09:41:12 +0000 (11:41 +0200)] 
app-layer: remove checks

Now that app-layer parser registrations are validated at startup,
a number of runtime checks are no longer necessary. So remove them.

7 years agoapp-layer: detect state registrations are mandatory
Victor Julien [Thu, 15 Jun 2017 09:34:25 +0000 (11:34 +0200)] 
app-layer: detect state registrations are mandatory

7 years agoapp-layer: validate registration
Victor Julien [Thu, 15 Jun 2017 09:32:13 +0000 (11:32 +0200)] 
app-layer: validate registration

7 years agodcerpc/udp: add missing tx support
Victor Julien [Thu, 15 Jun 2017 09:29:55 +0000 (11:29 +0200)] 
dcerpc/udp: add missing tx support

7 years agopython: use python path found during configure
Jason Ish [Thu, 15 Jun 2017 04:59:39 +0000 (22:59 -0600)] 
python: use python path found during configure

Also look for Python under more names. For example, on OpenBSD
if you just install Python 2, you will only get a python2.7
executable.

7 years agoFixed small typo: double sudo
Selivanov Pavel [Tue, 6 Jun 2017 12:28:11 +0000 (15:28 +0300)] 
Fixed small typo: double sudo

7 years agostream: don't do protocol detection on gap
Jason Ish [Mon, 12 Jun 2017 13:04:56 +0000 (07:04 -0600)] 
stream: don't do protocol detection on gap

A gap notification has no data.

Also, break out the gap handling into its own code block to
simplify the conditional statements.

7 years agohyperscan: unittests compiler warning fixes
Victor Julien [Tue, 13 Jun 2017 12:35:34 +0000 (14:35 +0200)] 
hyperscan: unittests compiler warning fixes

7 years agorust/dns: fix panic on rrnames with bad chars
Jason Ish [Wed, 14 Jun 2017 19:28:12 +0000 (13:28 -0600)] 
rust/dns: fix panic on rrnames with bad chars

Check for erros in the UTF-8 conversion, on error, print the
the printable chars as chars, and print non printable chars
as \xHEX.

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

7 years agorust/dns: fix tcp message length verification
Jason Ish [Wed, 14 Jun 2017 16:42:26 +0000 (10:42 -0600)] 
rust/dns: fix tcp message length verification

And add Rust unit tests to check length validation.

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

7 years agobypass: add explicit flag in stream engine
Eric Leblond [Tue, 13 Jun 2017 20:32:50 +0000 (22:32 +0200)] 
bypass: add explicit flag in stream engine

TCP reassembly is now deactivated more frequently and triggering a
bypass on it is resulting in missing some alerts due forgetting
about packet based signature.

So this patch is introducing a dedicated flag that can be set in
the app layer and transmitted in the streaming to trigger bypass.

It is currently used by the SSL app layer to trigger bypass when
the stream becomes encrypted.

7 years agorust/dns: support gaps in TCP DNS
Jason Ish [Fri, 9 Jun 2017 17:12:19 +0000 (11:12 -0600)] 
rust/dns: support gaps in TCP DNS

7 years agotravis: add rust 1.7.0 build
Jason Ish [Thu, 8 Jun 2017 19:32:40 +0000 (13:32 -0600)] 
travis: add rust 1.7.0 build

One build with Rust 1.7.0, our oldest that we'll support as its
whats bundled with Ubuntu 16.04. Create another build that will use
the latest stable.

7 years agorust/dns: fix unit tests on Rust 1.7.0
Jason Ish [Thu, 8 Jun 2017 19:59:09 +0000 (13:59 -0600)] 
rust/dns: fix unit tests on Rust 1.7.0

7 years agorust/dns: support txt records
Jason Ish [Thu, 8 Jun 2017 19:26:37 +0000 (13:26 -0600)] 
rust/dns: support txt records

7 years agorust/dns: copy over dns unit tests
Jason Ish [Wed, 7 Jun 2017 20:06:44 +0000 (14:06 -0600)] 
rust/dns: copy over dns unit tests

Only the tests that make sense were copied over, those testing
correlation of responses to requests were not.

Also, remove compiler warning when not built with
unit tests.

7 years agorust: don't fail distcheck if cargo-vendor not found
Jason Ish [Wed, 7 Jun 2017 19:25:16 +0000 (13:25 -0600)] 
rust: don't fail distcheck if cargo-vendor not found

Allow distcheck to pass if cargo vendor is not found by not
failing out. It is not required to successfully build a dist
tarball, the Rust sources will just not be vendored in.

Also don't fail out make dist if Python is not installed. A build
will still be successful is Python is available on the end
build system.

7 years agooutput-json-alert: don't decref used object
Eric Leblond [Mon, 12 Jun 2017 12:04:38 +0000 (14:04 +0200)] 
output-json-alert: don't decref used object

In the unlikely case of a allocation error we will still use the
existing object so it should not be decref and freed.

7 years agodoc: some more info about alert format
Eric Leblond [Tue, 6 Jun 2017 16:45:52 +0000 (18:45 +0200)] 
doc: some more info about alert format

7 years agodoc: document target keyword
Eric Leblond [Tue, 6 Jun 2017 16:35:48 +0000 (18:35 +0200)] 
doc: document target keyword

7 years agoalert-prelude: correctly set Source and Target
Eric Leblond [Sun, 25 Dec 2016 22:04:31 +0000 (23:04 +0100)] 
alert-prelude: correctly set Source and Target

IDMEF alert contains two entities named Source and Target that are
defined using common language:
* "The Source class contains information about the possible source(s) of
   the event(s) that generated an alert."
* "The Target class contains information about the possible target(s) of
   the event(s) that generated an alert."

Previous alerts event were not following that so we can updated the code
when we know the direction thanks to the metadata field.

7 years agoalert-prelude: fix warnings on callback type
Eric Leblond [Sun, 23 Apr 2017 08:24:05 +0000 (10:24 +0200)] 
alert-prelude: fix warnings on callback type

7 years agooutput-json-alert: output source and target
Eric Leblond [Sat, 17 Dec 2016 09:40:11 +0000 (10:40 +0100)] 
output-json-alert: output source and target

Use metadata provided information to output the Source and Target
in the definition of IDMEF.

The output is now the following:

  "alert": {
    "action": "allowed",
    "gid": 1,
    "signature_id": 1,
    "rev": 1,
    "signature": "connection to home",
    "category": "",
    "severity": 3,
    "source": {
      "ip": "2001:31d0:000a:f68a:0000:0000:0000:0001",
      "port": 80
    },
    "target": {
      "ip": "2a01:0e34:ee97:b130:c685:08ff:dab3:c9c8",
      "port": 48390
    }

7 years agodetect-target: introduce new keyword
Eric Leblond [Fri, 16 Dec 2016 18:26:58 +0000 (19:26 +0100)] 
detect-target: introduce new keyword

The target keyword allows rules writer to specify information about
target of the attack. Using this keyword in a signature causes
some fields to be added in the EVE output. It also fixes ambiguity
in the Prelude output.

7 years agogithub: add pull request template
Victor Julien [Mon, 12 Jun 2017 16:45:36 +0000 (18:45 +0200)] 
github: add pull request template

7 years agogithub: add contributing doc
Victor Julien [Mon, 12 Jun 2017 16:38:42 +0000 (18:38 +0200)] 
github: add contributing doc

7 years agocommon: sync PROG_VER version with configure.ac
Victor Julien [Wed, 7 Jun 2017 15:01:44 +0000 (17:01 +0200)] 
common: sync PROG_VER version with configure.ac

7 years agochangelog: update for 4.0.0-beta1
Victor Julien [Wed, 7 Jun 2017 14:43:27 +0000 (16:43 +0200)] 
changelog: update for 4.0.0-beta1

7 years agorust dns: fixup for nom 3.0
Jason Ish [Tue, 6 Jun 2017 23:02:14 +0000 (17:02 -0600)] 
rust dns: fixup for nom 3.0

7 years agorust: build fixes and nom update
Jason Ish [Tue, 6 Jun 2017 23:19:02 +0000 (17:19 -0600)] 
rust: build fixes and nom update

Update nom to ~3.0.

Prefix dependencies with ~, which will allow for newer patch
versions only. Minor version updates should get a test before
using.

Remove Cargo.lock from the repo, but still generate as part
of the vendoring process for release builds. This will ensure
that all users of a particular distribution tarball will be
linking against the same Rust dependencies.

7 years agorust: add to features
Victor Julien [Tue, 6 Jun 2017 19:31:23 +0000 (21:31 +0200)] 
rust: add to features

7 years agorust: make clear it's experimental
Victor Julien [Tue, 6 Jun 2017 19:29:57 +0000 (21:29 +0200)] 
rust: make clear it's experimental

7 years agolog: fix mem leak in error path (CID1404888)
Victor Julien [Tue, 6 Jun 2017 17:09:18 +0000 (19:09 +0200)] 
log: fix mem leak in error path (CID1404888)

7 years agodoc: document drop-invalid option.
Eric Leblond [Mon, 5 Jun 2017 14:41:47 +0000 (16:41 +0200)] 
doc: document drop-invalid option.

7 years agoqa: update struct-flags coccinelle test
Eric Leblond [Mon, 5 Jun 2017 11:46:08 +0000 (13:46 +0200)] 
qa: update struct-flags coccinelle test

7 years agostream-tcp: use flags field to store inline info
Eric Leblond [Fri, 12 May 2017 18:22:35 +0000 (20:22 +0200)] 
stream-tcp: use flags field to store inline info

7 years agostream-tcp: use flags field to store bypass info
Eric Leblond [Fri, 12 May 2017 17:53:49 +0000 (19:53 +0200)] 
stream-tcp: use flags field to store bypass info

7 years agoaf-packet: warn when tpacket_v3 is used in IPS
Eric Leblond [Tue, 9 May 2017 21:35:03 +0000 (23:35 +0200)] 
af-packet: warn when tpacket_v3 is used in IPS

Update yaml and add an error message.

7 years agostream-tcp: add option to accept invalid packets
Eric Leblond [Mon, 24 Apr 2017 13:00:20 +0000 (15:00 +0200)] 
stream-tcp: add option to accept invalid packets

Suricata was inconditionaly dropping packets that are invalid with
respect to the streaming engine. In some corner case like asymetric
trafic capture, this was leading to dropping some legitimate trafic.

The async-oneside option did help but this was not perfect in some
real life case. So this patch introduces an option that allow the
user to tell Suricata not to drop packet that are invalid with
respect to streaming.

7 years agodoc: document filestore update
Eric Leblond [Mon, 5 Jun 2017 14:06:04 +0000 (16:06 +0200)] 
doc: document filestore update

7 years agofilestore: avoid open write close sequence
Eric Leblond [Wed, 31 May 2017 16:14:29 +0000 (18:14 +0200)] 
filestore: avoid open write close sequence

Current file storing approach is using a open file, write data,
close file logic. If this technic is fixing the problem of getting
too much open files in Suricata it is not optimal.

Test on a loop shows that open, write, close on a single file is
two time slower than a single open, loop of write, close.

This patch updates the logic by storing the fd in the File structure.
This is done for a certain number of files. If this amount is exceeded
then the previous logic is used.

This patch also adds two counters. First is the number of
currently open files. The second one is the number of time
the open, write, close sequence has been used due to too much
open files.

In EVE, the entries are:
 stats {file_store: {"open_files_max_hit":0,"open_files":5}}

7 years agofilestore: add option to disable meta file writing
Eric Leblond [Thu, 1 Jun 2017 11:21:13 +0000 (13:21 +0200)] 
filestore: add option to disable meta file writing

As the fileinfo entry is containing the file_id it is enough to
have this entry to link the extracted file with metadata.

7 years agorust/nfs/files: no longer Option/Box
Victor Julien [Tue, 23 May 2017 09:26:56 +0000 (11:26 +0200)] 
rust/nfs/files: no longer Option/Box