]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
7 years agosmb1: add OPEN_ANDX command name for logging 3286/head
Victor Julien [Wed, 14 Mar 2018 12:47:07 +0000 (13:47 +0100)] 
smb1: add OPEN_ANDX command name for logging

7 years agosmb2: don't log/track each READ/WRITE/etc
Victor Julien [Wed, 14 Mar 2018 12:16:38 +0000 (13:16 +0100)] 
smb2: don't log/track each READ/WRITE/etc

7 years agosmb: log file FID/GUID as fuid
Victor Julien [Wed, 14 Mar 2018 09:26:40 +0000 (10:26 +0100)] 
smb: log file FID/GUID as fuid

7 years agosmb: add smb records to fileinfo
Victor Julien [Wed, 14 Mar 2018 08:05:12 +0000 (09:05 +0100)] 
smb: add smb records to fileinfo

7 years agosmb1: improve non nt-status handling 3284/head
Victor Julien [Tue, 13 Mar 2018 16:34:00 +0000 (17:34 +0100)] 
smb1: improve non nt-status handling

Support SRV error, with a couple of codes.
Rename statux field to status_code.

7 years agosmb1: ignore tree_id in session setup
Victor Julien [Tue, 13 Mar 2018 15:36:45 +0000 (16:36 +0100)] 
smb1: ignore tree_id in session setup

7 years agosmb: improve nbss/smb record detection
Victor Julien [Tue, 13 Mar 2018 12:44:35 +0000 (13:44 +0100)] 
smb: improve nbss/smb record detection

7 years agorust/smb: implement minimal record parsing in probing
Victor Julien [Tue, 13 Mar 2018 12:36:19 +0000 (13:36 +0100)] 
rust/smb: implement minimal record parsing in probing

7 years agorust/smb: improve protocol detection
Victor Julien [Tue, 13 Mar 2018 12:24:45 +0000 (13:24 +0100)] 
rust/smb: improve protocol detection

Register both pattern based detection and probing parsers.

7 years agosmb: add smb to default eve-log config
Victor Julien [Tue, 13 Mar 2018 12:10:42 +0000 (13:10 +0100)] 
smb: add smb to default eve-log config

7 years agosmb2: break out ioctl handling
Victor Julien [Tue, 13 Mar 2018 07:05:03 +0000 (08:05 +0100)] 
smb2: break out ioctl handling

7 years agosmb2: parse async records
Victor Julien [Mon, 12 Mar 2018 20:05:07 +0000 (21:05 +0100)] 
smb2: parse async records

7 years agosmb2: add ioctl transactions to log the funcs
Victor Julien [Mon, 12 Mar 2018 20:04:54 +0000 (21:04 +0100)] 
smb2: add ioctl transactions to log the funcs

7 years agosmb2: map ioctl funcs to names
Victor Julien [Mon, 12 Mar 2018 17:09:12 +0000 (18:09 +0100)] 
smb2: map ioctl funcs to names

List is based on Wireshark's list.

7 years agosmb: use formal MS names for disposition
Victor Julien [Mon, 12 Mar 2018 13:32:08 +0000 (14:32 +0100)] 
smb: use formal MS names for disposition

7 years agosmb: disable debug output
Victor Julien [Mon, 12 Mar 2018 13:31:49 +0000 (14:31 +0100)] 
smb: disable debug output

7 years agosmb1: extract server guid from negotiate
Victor Julien [Mon, 12 Mar 2018 08:56:12 +0000 (09:56 +0100)] 
smb1: extract server guid from negotiate

7 years agosmb2: log client and server guid from negotiate
Victor Julien [Mon, 12 Mar 2018 08:32:17 +0000 (09:32 +0100)] 
smb2: log client and server guid from negotiate

7 years agosmb2: log share type
Victor Julien [Mon, 12 Mar 2018 07:28:21 +0000 (08:28 +0100)] 
smb2: log share type

7 years agosmb: log create empty filename as '<share_root>' like Bro does
Victor Julien [Mon, 12 Mar 2018 06:57:06 +0000 (07:57 +0100)] 
smb: log create empty filename as '<share_root>' like Bro does

7 years agosmb1: log create 'service' fields
Victor Julien [Mon, 12 Mar 2018 06:56:29 +0000 (07:56 +0100)] 
smb1: log create 'service' fields

7 years agosmb1: use generic string parsing for trans
Victor Julien [Sat, 10 Mar 2018 11:52:56 +0000 (12:52 +0100)] 
smb1: use generic string parsing for trans

7 years agosmb1: generic smb string parse func
Victor Julien [Sat, 10 Mar 2018 10:18:48 +0000 (11:18 +0100)] 
smb1: generic smb string parse func

7 years agosmb1: more exact tree connect record parsing
Victor Julien [Sat, 10 Mar 2018 10:10:25 +0000 (11:10 +0100)] 
smb1: more exact tree connect record parsing

7 years agosmb: move common parsing funcs into own file
Victor Julien [Sat, 10 Mar 2018 08:57:44 +0000 (09:57 +0100)] 
smb: move common parsing funcs into own file

7 years agosmb: make string parsing functions public
Victor Julien [Sat, 10 Mar 2018 08:42:55 +0000 (09:42 +0100)] 
smb: make string parsing functions public

7 years agosmb1: set event on empty/malformed dialect
Victor Julien [Fri, 9 Mar 2018 16:09:23 +0000 (17:09 +0100)] 
smb1: set event on empty/malformed dialect

7 years agosmb: rename file to filename in output
Victor Julien [Fri, 9 Mar 2018 15:05:17 +0000 (16:05 +0100)] 
smb: rename file to filename in output

7 years agosmb1: parse and log timestamps in CREATE
Victor Julien [Fri, 9 Mar 2018 15:04:22 +0000 (16:04 +0100)] 
smb1: parse and log timestamps in CREATE

7 years agosmb2: parse and log timestamps in CREATE
Victor Julien [Fri, 9 Mar 2018 09:27:13 +0000 (10:27 +0100)] 
smb2: parse and log timestamps in CREATE

7 years agosmb1: disable 'generic tx's for common commands
Victor Julien [Wed, 7 Mar 2018 17:23:17 +0000 (18:23 +0100)] 
smb1: disable 'generic tx's for common commands

Don't create a generic TX for each READ, WRITE, TRANS, TRANS2,
except if they cause events to trigger.

7 years agosmb: generic event per trans/read/write for tx events
Victor Julien [Wed, 7 Mar 2018 14:29:49 +0000 (15:29 +0100)] 
smb: generic event per trans/read/write for tx events

7 years agosmb: fix event handling when no tx is available
Victor Julien [Wed, 7 Mar 2018 10:32:04 +0000 (11:32 +0100)] 
smb: fix event handling when no tx is available

7 years agosmb: small cleanups, fixes and optimizations
Victor Julien [Tue, 6 Mar 2018 09:13:40 +0000 (10:13 +0100)] 
smb: small cleanups, fixes and optimizations

7 years agosmb: update to der-parser 0.5.1
Victor Julien [Fri, 2 Mar 2018 16:19:18 +0000 (17:19 +0100)] 
smb: update to der-parser 0.5.1

7 years agosmb: remove unused dialects from state
Victor Julien [Thu, 1 Mar 2018 11:47:49 +0000 (12:47 +0100)] 
smb: remove unused dialects from state

7 years agosmb1: minor debug improvment
Victor Julien [Thu, 1 Mar 2018 11:39:15 +0000 (12:39 +0100)] 
smb1: minor debug improvment

7 years agosmb: redo gap catch up handling
Victor Julien [Thu, 1 Mar 2018 11:38:53 +0000 (12:38 +0100)] 
smb: redo gap catch up handling

7 years agosmb1: parser cleanups
Victor Julien [Thu, 1 Mar 2018 09:55:21 +0000 (10:55 +0100)] 
smb1: parser cleanups

7 years agosmb: cleaner server component parsing
Victor Julien [Thu, 1 Mar 2018 09:37:06 +0000 (10:37 +0100)] 
smb: cleaner server component parsing

7 years agosmb2: improve write error handling
Victor Julien [Thu, 1 Mar 2018 09:31:07 +0000 (10:31 +0100)] 
smb2: improve write error handling

7 years agosmb3: parse transform records
Victor Julien [Thu, 1 Mar 2018 09:30:02 +0000 (10:30 +0100)] 
smb3: parse transform records

7 years agosmb2: add missing commands and improve ioctl err handling
Victor Julien [Thu, 1 Mar 2018 07:50:36 +0000 (08:50 +0100)] 
smb2: add missing commands and improve ioctl err handling

7 years agosmb1: improve error handling
Victor Julien [Thu, 1 Mar 2018 07:50:04 +0000 (08:50 +0100)] 
smb1: improve error handling

7 years agosmb: add status
Victor Julien [Wed, 28 Feb 2018 20:19:20 +0000 (21:19 +0100)] 
smb: add status

7 years agosmb1: implement WRITE_AND_CLOSE
Victor Julien [Wed, 28 Feb 2018 17:38:33 +0000 (18:38 +0100)] 
smb1: implement WRITE_AND_CLOSE

7 years agosmb1: locking andx may have no response
Victor Julien [Wed, 28 Feb 2018 16:56:01 +0000 (17:56 +0100)] 
smb1: locking andx may have no response

7 years agosmb/nbss: work around bad traffic
Victor Julien [Wed, 28 Feb 2018 16:25:08 +0000 (17:25 +0100)] 
smb/nbss: work around bad traffic

7 years agosmb: session setup improvements
Victor Julien [Tue, 27 Feb 2018 17:12:07 +0000 (18:12 +0100)] 
smb: session setup improvements

Improve ntlmssp version extraction and logging, make its data structures
optional. Extract native os/lm from smb1 ssn setup.

Move session setup handling into their own files.

Only log auth data for the session setup tx.

7 years agorust/smb: initial support
Victor Julien [Mon, 26 Feb 2018 12:39:42 +0000 (13:39 +0100)] 
rust/smb: initial support

Implement SMB app-layer parser for SMB1/2/3. Features:
- file extraction
- eve logging
- existing dce keyword support
- smb_share/smb_named_pipe keyword support (stickybuffers)
- auth meta data extraction (ntlmssp, kerberos5)

7 years agoeve: log pcap filename
Victor Julien [Mon, 19 Feb 2018 16:30:36 +0000 (17:30 +0100)] 
eve: log pcap filename

7 years agodetect: fix tx iterator logic in detect 3273/head
Victor Julien [Thu, 8 Mar 2018 07:35:16 +0000 (08:35 +0100)] 
detect: fix tx iterator logic in detect

The 'tx_id' variable was used to be passed into the IterFunc as a
minumum tx to return. The IterFunc could then return either the tx
for that id, or a later one if that turned out to be the first available
tx.

The tx_id however, was still used for some things as if it was the
current tx id. Most importantly for setting the tx id for alert
ammending. So this could lead to alerts with missing or wrong
applayer records.

7 years agomingw: fix compile error
Victor Julien [Thu, 8 Mar 2018 07:48:39 +0000 (08:48 +0100)] 
mingw: fix compile error

7 years agooutput/lua: better lua output setup error handling 3272/head
Richard Sailer [Thu, 22 Feb 2018 00:53:16 +0000 (01:53 +0100)] 
output/lua: better lua output setup error handling

If suricata was started with --init-errors-fatal and an error occured
during setup of lua output (like if lua scripts configured in the conf file
don't exist or are not readable) suricata continued, which did not reflect
"init errors fatal" very well.

This fix makes the suricata initialization abort and send an error message
in such cases.

For details see:
https://redmine.openinfosecfoundation.org/issues/1503

7 years agooutput/lua: remove unnecessary detect.h include
Richard Sailer [Thu, 22 Feb 2018 00:27:59 +0000 (01:27 +0100)] 
output/lua: remove unnecessary detect.h include

output-lua.c contained an include of detect.h.

Since we don't (and shouldn't) call any functions from detect.c in output-lua.c
and such coupling is generally unwanted this patch removes that include.

7 years agoRust: add 'debug' feature
Pierre Chifflier [Tue, 6 Mar 2018 20:33:33 +0000 (21:33 +0100)] 
Rust: add 'debug' feature

The 'debug' feature is enabled if suricata was configured with the
--enabled-debug' flag.
If enabled, the SCLogDebug format and calls the logging function as
usual. Otherwise, this macro is a no-op (similarly to the C code).

7 years agoprofiling: suppress debug statements 3271/head
Victor Julien [Mon, 5 Mar 2018 17:37:17 +0000 (18:37 +0100)] 
profiling: suppress debug statements

7 years agoprelude: add protocol information through JSON
Thomas Andrejak [Thu, 8 Jun 2017 12:56:26 +0000 (14:56 +0200)] 
prelude: add protocol information through JSON

7 years agounified2: fix xff extra-data output (Bug #2305)
Daniel Humphries [Mon, 4 Dec 2017 19:53:27 +0000 (19:53 +0000)] 
unified2: fix xff extra-data output (Bug #2305)

In extra-data mode, suricata does not output xff data without
undocumented conditions (including enabling packet output). This
behaviour has been fixed to remove the hidden requirements. Fix
included removing previous xff data output implementation and adding a
new function for outputting xff that is called after outputting each
event.

IPv6 XFF entries were also being recorded incorrectly as if they were
IPv4 and this has been fixed.

7 years agodoc: update eve json output for DNS and HTTP
Pascal Delalande [Thu, 22 Feb 2018 21:28:56 +0000 (22:28 +0100)] 
doc: update eve json output for DNS and HTTP

7 years agoder/afl: free data during fuzzing
Victor Julien [Mon, 5 Mar 2018 08:11:30 +0000 (09:11 +0100)] 
der/afl: free data during fuzzing

7 years agooutput: fix logging wrong direction in tls upgrade 3263/head
Victor Julien [Fri, 2 Mar 2018 12:44:43 +0000 (13:44 +0100)] 
output: fix logging wrong direction in tls upgrade

When upgrading to TLS from HTTP logging of the final HTTP tx could
have the wrong direction. This was due to the original packet triggering/
finalizing the upgrade would be used as the base for both the toserver
and toclient pseudo packet meaning it was wrong in one direction.

This patch creates a pseudo packet in the same way as the flow timeout
code does, so it no longer takes the raw original packet in.

Bug #2430

7 years agooutput/json: update callers to use explicit directions
Victor Julien [Fri, 2 Mar 2018 11:15:11 +0000 (12:15 +0100)] 
output/json: update callers to use explicit directions

7 years agooutput/json: make log direction explicit
Victor Julien [Fri, 2 Mar 2018 10:53:12 +0000 (11:53 +0100)] 
output/json: make log direction explicit

Introduce enum OutputJsonLogDirection to make logging direction
explicit.

7 years agooutput/json: clean up CreateJSONHeader calls
Victor Julien [Fri, 2 Mar 2018 10:36:36 +0000 (11:36 +0100)] 
output/json: clean up CreateJSONHeader calls

7 years agotravis: redirect unittest output to file in all builds
Jason Ish [Thu, 1 Mar 2018 13:42:09 +0000 (07:42 -0600)] 
travis: redirect unittest output to file in all builds

On error, print the last 500 lines of output then exit 1.

Shoud allow us to see why a build fail on the debug tests,
when the error was burried in an output file we weren't
making visible.

7 years agorust/json: add array_append_string
Victor Julien [Mon, 26 Feb 2018 12:35:28 +0000 (13:35 +0100)] 
rust/json: add array_append_string

7 years agorust/dns: fix nom verbose error mode
Victor Julien [Mon, 19 Feb 2018 17:24:14 +0000 (18:24 +0100)] 
rust/dns: fix nom verbose error mode

7 years agodoc: use standard spelling of daemon
Brandon Sterne [Tue, 27 Feb 2018 21:28:45 +0000 (13:28 -0800)] 
doc: use standard spelling of daemon

7 years agosource-pcap-file: Directory mode may miss files (bug #2394)
Danny Browning [Thu, 21 Dec 2017 21:09:08 +0000 (14:09 -0700)] 
source-pcap-file: Directory mode may miss files (bug #2394)

https://redmine.openinfosecfoundation.org/issues/2394

Certain parameters of delay and poll interval could cause newly added
files in a directory to be missed. Cleaned up how time is handled for
files in a directory and fix which time is used for future directory
traversals. Add a mutex to make sure processing time is not optimized
away.

7 years agoebpf: remove vlan_hdr alignement
Eric Leblond [Mon, 12 Feb 2018 23:04:05 +0000 (00:04 +0100)] 
ebpf: remove vlan_hdr alignement

If we align the vlan_hdr then we increase its size and the parsing
of packets with VLAN tag is broken.

7 years agoepf: improving the ebpf makefile
Jesper Dangaard Brouer [Wed, 7 Feb 2018 22:21:24 +0000 (23:21 +0100)] 
epf: improving the ebpf makefile

The current ebpf/Makefile.am have the problem that clang compile
errors still result in an ELF .bpf output file.  This is obviously
problematic as the problem is first seen runtime when loading
the bpf-prog.  This is caused by the uses of a pipe from
clang to llc.

To address this problem, split up the clang and llc invocations
up into two separate commands, to get proper reaction based on
the compiler exit code. The clang compiler is used as a
frontend (+ optimizer) and instructed (via -S -emit-llvm) to
generate LLVM IR (Intermediate Representation) with suffix .ll.
The LLVM llc command is used as a compiler backend taking IR and
producing BPF machine bytecode, and storing this into a ELF
object.  In the last step the IR .ll suffix code it removed.

The official documentation of the IR language:
 http://llvm.org/docs/LangRef.html

Also fix the previous make portability warning:
 '%-style pattern rules are a GNU make extension'
I instead use some static pattern rules:
 https://www.gnu.org/software/make/manual/html_node/Static-Usage.html

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
7 years agoebpf: compile with clang -target bpf
Jesper Dangaard Brouer [Wed, 7 Feb 2018 22:21:19 +0000 (23:21 +0100)] 
ebpf: compile with clang -target bpf

Enable compiling eBPF programs with clang -target bpf.

This is mostly to workaround a bug in libbpf, where clang > ver 4.0.0
generates some ELF sections (.eh_frame) when -target bpf is NOT specified,
and libbpf fails loading such files.

Notice libbpf is provided by the kernel, and in kernel v4.16 the library
will contain the needed function for attaching to the XDP hook.

Kernel commit 949abbe88436 ("libbpf: add function to setup XDP")
 https://git.kernel.org/torvalds/c/949abbe88436

The library fix has reached kernel v4.16 but the workaround for Suricata
is interesting anyway in case people use a kernel v4.15.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
7 years agoebpf: take clang -target bpf include issue of stdint.h into account
Jesper Dangaard Brouer [Wed, 7 Feb 2018 22:21:14 +0000 (23:21 +0100)] 
ebpf: take clang -target bpf include issue of stdint.h into account

This patch prepares code before enabling the clang -target bpf.

The clang compiler does not like #include <stdint.h> when
using '-target bpf' it will fail with:

 fatal error: 'gnu/stubs-32.h' file not found

This is because using clang -target bpf, then clang will have '__bpf__'
defined instead of '__x86_64__' hence the gnu/stubs-32.h include
attempt as /usr/include/gnu/stubs.h contains, on x86_64:

  #if !defined __x86_64__
  # include <gnu/stubs-32.h>
  #endif
  #if defined __x86_64__ && defined __LP64__
  # include <gnu/stubs-64.h>
  #endif
  #if defined __x86_64__ && defined __ILP32__
  # include <gnu/stubs-x32.h>
  #endif

This can be worked around by installing the 32-bit version of
glibc-devel.i686 on your distribution.

But the BPF programs does not really need to include stdint.h,
if converting:
  uint64_t -> __u64
  uint32_t -> __u32
  uint16_t -> __u16
  uint8_t  -> __u8

This patch does this type syntax conversion.

The build of a ebpf files had an issue for system like Debian
because they don't have a asm/types.h in the include path if the
architecture is not defined which is the case due to target bpf.

This results in:

 clang-5.0 -Wall -Iinclude -O2 \
         -D__KERNEL__ -D__ASM_SYSREG_H \
         -target bpf -S -emit-llvm vlan_filter.c -o vlan_filter.ll
 In file included from vlan_filter.c:19:
 In file included from include/linux/bpf.h:11:
 /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not
 found
 #include <asm/types.h>
          ^~~~~~~~~~~~~
 1 error generated.
 Makefile:523: recipe for target 'vlan_filter.bpf' failed

This patch fixes the issue by adding a include path setting the
architecture to the one of the builder.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
Sidned-off-by: Eric Leblond <eric@regit.org>
7 years agofile: fix files not getting pruned 3247/head
Victor Julien [Tue, 13 Feb 2018 12:42:39 +0000 (13:42 +0100)] 
file: fix files not getting pruned

When the filedata logger is enabled (file extraction), but a file is not
stored due to no rules matching to force this, the file would never be
freed.

This was caused by a check in the file pruning logic that only freed a
file when the FILE_STORED flag was set. However files can also have the
FILE_NOSTORE flag set which indicates that a file won't be stored.

This patch makes sure that both conditions lead to file pruning.

7 years agostream: inform app layer of depth reached
Victor Julien [Mon, 12 Feb 2018 17:31:14 +0000 (18:31 +0100)] 
stream: inform app layer of depth reached

7 years agoflash: code cleanups 3246/head
Victor Julien [Fri, 2 Feb 2018 14:45:47 +0000 (15:45 +0100)] 
flash: code cleanups

7 years agodetect/bsize: tests for http_request_line
Victor Julien [Tue, 19 Dec 2017 17:00:38 +0000 (18:00 +0100)] 
detect/bsize: tests for http_request_line

7 years agodetect: bsize keyword
Victor Julien [Sun, 10 Dec 2017 20:39:50 +0000 (21:39 +0100)] 
detect: bsize keyword

Allows matching on stickybuffers. Like dsize, it allows matching on
exact values, greater than and less than, and ranges.

For streaming buffers, such as HTTP bodies, the final size of the
body is only known at the end of the transaction.

7 years agorule analyzer: simple rules to json dumper
Victor Julien [Fri, 3 Nov 2017 11:33:53 +0000 (12:33 +0100)] 
rule analyzer: simple rules to json dumper

7 years agodetect/content: pass START/END flags to inspection
Victor Julien [Mon, 18 Dec 2017 16:11:15 +0000 (17:11 +0100)] 
detect/content: pass START/END flags to inspection

7 years agodetect: set implied flow direction based on keywords
Victor Julien [Fri, 3 Nov 2017 11:29:49 +0000 (12:29 +0100)] 
detect: set implied flow direction based on keywords

7 years agodetect/dns_query: move to API v2. Supports transforms.
Victor Julien [Wed, 1 Nov 2017 07:33:37 +0000 (08:33 +0100)] 
detect/dns_query: move to API v2. Supports transforms.

7 years agofile_data: update to API v2
Victor Julien [Wed, 1 Nov 2017 07:33:09 +0000 (08:33 +0100)] 
file_data: update to API v2

As we can have multiple files per TX we use the multi inspect
buffer support.

By using this API file_data supports transforms.

Redo part of the flash decompression as a hard coded built-in sort
of transform.

7 years agodetect/http_request_line: convert to inspect api v2
Victor Julien [Wed, 1 Nov 2017 07:32:31 +0000 (08:32 +0100)] 
detect/http_request_line: convert to inspect api v2

7 years agodetect/transform: initial to_sha256 implementation
Victor Julien [Thu, 26 Oct 2017 06:14:14 +0000 (08:14 +0200)] 
detect/transform: initial to_sha256 implementation

Takes input buffer and replaces it with hash value for that buffer.
Hash value is in raw bytes.

7 years agodetect/transform: initial compress_whitespace implementation
Victor Julien [Wed, 25 Oct 2017 07:27:02 +0000 (09:27 +0200)] 
detect/transform: initial compress_whitespace implementation

7 years agodetect/transform: initial strip_whitespace implementation
Victor Julien [Thu, 26 Oct 2017 08:20:07 +0000 (10:20 +0200)] 
detect/transform: initial strip_whitespace implementation

7 years agodetect/prefilter: move hash into detect engine ctx
Victor Julien [Tue, 31 Oct 2017 12:49:42 +0000 (13:49 +0100)] 
detect/prefilter: move hash into detect engine ctx

7 years agodetect/prefilter: add de_ctx to registration
Victor Julien [Tue, 31 Oct 2017 11:20:20 +0000 (12:20 +0100)] 
detect/prefilter: add de_ctx to registration

7 years agodetect: move mpm engines into detect engine ctx
Victor Julien [Mon, 30 Oct 2017 21:37:42 +0000 (22:37 +0100)] 
detect: move mpm engines into detect engine ctx

This allows safe registration at runtime.

7 years agodetect/inspect engines: copy to detect engine ctx
Victor Julien [Mon, 30 Oct 2017 18:42:35 +0000 (19:42 +0100)] 
detect/inspect engines: copy to detect engine ctx

Register rule-time engines in the detect engine. This is necessary
now that rule parsing can create new buffers.

7 years agodetect: register dynamic buffers into de_ctx
Victor Julien [Mon, 30 Oct 2017 16:14:34 +0000 (17:14 +0100)] 
detect: register dynamic buffers into de_ctx

Register buffers that are created during rule parsing. Currently
this means an existing buffer with one or more transformations.

7 years agocontent inspection: support transforms
Victor Julien [Mon, 23 Oct 2017 11:27:32 +0000 (13:27 +0200)] 
content inspection: support transforms

Make sure content is applied to the transformed version of a buffer.

Support content with its modifiers, and also isdataat, pcre, bytetest
and bytejump.

7 years agodetect: move buffer type map into detect ctx
Victor Julien [Mon, 30 Oct 2017 08:43:42 +0000 (09:43 +0100)] 
detect: move buffer type map into detect ctx

Move previously global table into detect engine ctx. Now that we
can register buffers at rule loading time we need to take concurrency
into account.

Move DetectBufferType to detect.h and update DetectBufferCtx API calls
to include a detect engine ctx reference.

7 years agodetect: prefilter/inspect API v2, with transforms
Victor Julien [Tue, 23 Jan 2018 11:25:33 +0000 (12:25 +0100)] 
detect: prefilter/inspect API v2, with transforms

Introduce InspectionBuffer a structure for passing data between
prefilters, transforms and inspection engines.

At rule parsing time, we'll register new unique 'DetectBufferType's
for a 'parent' buffer (e.g. pure file_data) with its transformations.
Each unique combination of buffer with transformations gets it's
own buffer id.

Similarly, mpm registration and inspect engine registration will be
copied from the 'parent' (again, e.g. pure file_data) to the new id's.

The transforms are called from within the prefilter engines themselves.

Provide generic MPM matching and setup callbacks. Can be used by
keywords to avoid needless code duplication. Supports transformations.

Use unique name for profiling, to distinguish between pure buffers
and buffers with transformation.

Add new registration calls for mpm/prefilters and inspect engines.

Inspect engine api v2: Pass engine to itself. Add generic engine that
uses GetData callback and other registered settings.

The generic engine should be usable for every 'simple' case where
there is just a single non-streaming buffer. For example HTTP uri.

The v2 API assumes that registered MPM implements transformations.

Add util func to set new transform in rule and add util funcs for rule
parsing.

7 years agodetect: prep for dynamic smlists arrays in sigs
Victor Julien [Mon, 23 Oct 2017 10:08:47 +0000 (12:08 +0200)] 
detect: prep for dynamic smlists arrays in sigs

Initialize Signature::init_data::smlists like normal, but before use
expand them if needed.

7 years agodocs: remove many outdated and old install docs
Andreas Herz [Tue, 13 Feb 2018 22:41:47 +0000 (23:41 +0100)] 
docs: remove many outdated and old install docs

7 years agodocs: replace redmine links and enforce https on oisf urls
Andreas Herz [Tue, 13 Feb 2018 21:06:33 +0000 (22:06 +0100)] 
docs: replace redmine links and enforce https on oisf urls

7 years agoapp-layer: remove has events callback - not used
Jason Ish [Mon, 12 Feb 2018 19:43:59 +0000 (13:43 -0600)] 
app-layer: remove has events callback - not used