]> git.ipfire.org Git - people/ms/suricata.git/log
people/ms/suricata.git
8 years agodetect-icode: implement as u8 hash prefilter
Victor Julien [Mon, 22 Aug 2016 14:29:48 +0000 (16:29 +0200)] 
detect-icode: implement as u8 hash prefilter

8 years agodetect-itype: implement as u8 hash prefilter
Victor Julien [Mon, 22 Aug 2016 13:21:55 +0000 (15:21 +0200)] 
detect-itype: implement as u8 hash prefilter

8 years agodetect-id: implement prefilter
Victor Julien [Sat, 20 Aug 2016 15:02:13 +0000 (17:02 +0200)] 
detect-id: implement prefilter

8 years agodetect-icode: implement prefilter
Victor Julien [Sat, 20 Aug 2016 14:26:37 +0000 (16:26 +0200)] 
detect-icode: implement prefilter

8 years agodetect-itype: implement prefilter
Victor Julien [Sat, 20 Aug 2016 13:59:22 +0000 (15:59 +0200)] 
detect-itype: implement prefilter

8 years agodetect-ttl: implement prefilter
Victor Julien [Sat, 20 Aug 2016 11:25:37 +0000 (13:25 +0200)] 
detect-ttl: implement prefilter

8 years agodetect-seq: implement prefilter
Victor Julien [Sat, 20 Aug 2016 11:11:01 +0000 (13:11 +0200)] 
detect-seq: implement prefilter

8 years agodetect-flow: implement prefilter
Victor Julien [Sat, 20 Aug 2016 11:05:09 +0000 (13:05 +0200)] 
detect-flow: implement prefilter

8 years agoprefilter: implement basic prefilter priority order
Victor Julien [Sat, 20 Aug 2016 11:04:22 +0000 (13:04 +0200)] 
prefilter: implement basic prefilter priority order

8 years agodetect-fragoffset: implement prefilter
Victor Julien [Sat, 20 Aug 2016 09:00:43 +0000 (11:00 +0200)] 
detect-fragoffset: implement prefilter

8 years agodetect analyzer: give minimal prefilter info
Victor Julien [Fri, 19 Aug 2016 15:04:51 +0000 (17:04 +0200)] 
detect analyzer: give minimal prefilter info

8 years agodetect-dsize: enable prefilter support
Victor Julien [Fri, 19 Aug 2016 14:34:38 +0000 (16:34 +0200)] 
detect-dsize: enable prefilter support

Enable prefilter support for the dsize keyword.

8 years agoprefilter: implement fragbits
Victor Julien [Thu, 18 Aug 2016 12:20:41 +0000 (14:20 +0200)] 
prefilter: implement fragbits

8 years agoprefilter: engine for ack rules
Victor Julien [Fri, 15 Jul 2016 13:34:06 +0000 (15:34 +0200)] 
prefilter: engine for ack rules

Rules for the 'ack' keyword are uncommon, but if used inspected
against almost every packet.

8 years agoprefilter: engine for tcp flags keyword
Victor Julien [Thu, 14 Jul 2016 15:17:31 +0000 (17:17 +0200)] 
prefilter: engine for tcp flags keyword

If there are many rules for TCP flags these rules would be inspected
against each TCP packet. Even though the flags check is not expensive,
the combined cost of inspecting multiple rules against each and every
packet is high.

This patch implements a prefilter engine for flags. If a rule group
has rules looking for specific flags and engine for that flag or
flags combination is set up. This way those rules are only inspected
if the flag is actually present in the packet.

8 years agoprofiling: support prefilter engines
Victor Julien [Sat, 20 Aug 2016 12:54:37 +0000 (14:54 +0200)] 
profiling: support prefilter engines

8 years agoprefilter: intro common engine for u8 matches
Victor Julien [Mon, 22 Aug 2016 13:21:19 +0000 (15:21 +0200)] 
prefilter: intro common engine for u8 matches

8 years agoprefilter: common funcs for packet header prefilters
Victor Julien [Fri, 19 Aug 2016 08:03:21 +0000 (10:03 +0200)] 
prefilter: common funcs for packet header prefilters

8 years agoprefilter: show prefilter capability in --list-keywords
Victor Julien [Thu, 1 Sep 2016 13:07:31 +0000 (15:07 +0200)] 
prefilter: show prefilter capability in --list-keywords

8 years agoprefilter: implement prefilter keyword
Victor Julien [Thu, 14 Jul 2016 15:10:00 +0000 (17:10 +0200)] 
prefilter: implement prefilter keyword

Introduce prefilter keyword to force a keyword to be used as prefilter.

e.g.
alert tcp any any -> any any (content:"A"; flags:R; prefilter; sid:1;)
alert tcp any any -> any any (content:"A"; flags:R; sid:2;)
alert tcp any any -> any any (content:"A"; dsize:1; prefilter; sid:3;)
alert tcp any any -> any any (content:"A"; dsize:1; sid:4;)

In sid 2 and 4 the content keyword is used in the MPM engine.
In sid 1 and 3 the flags and dsize keywords will be used.

8 years agodetect cleanup: remove sgh mpm_ctx pointers
Victor Julien [Sun, 10 Jul 2016 09:33:27 +0000 (11:33 +0200)] 
detect cleanup: remove sgh mpm_ctx pointers

8 years agosgh: remove unused flags
Victor Julien [Sat, 9 Jul 2016 07:16:24 +0000 (09:16 +0200)] 
sgh: remove unused flags

8 years agotls: mpm prefilter engines
Victor Julien [Sat, 9 Jul 2016 07:05:58 +0000 (09:05 +0200)] 
tls: mpm prefilter engines

8 years agosmtp file_data: mpm prefilter engine
Victor Julien [Sat, 9 Jul 2016 06:47:45 +0000 (08:47 +0200)] 
smtp file_data: mpm prefilter engine

8 years agohttp_raw_header: mpm prefilter engine
Victor Julien [Sat, 9 Jul 2016 06:27:56 +0000 (08:27 +0200)] 
http_raw_header: mpm prefilter engine

Register for both regular headers and trailer.

8 years agohttp_server_body / file_data: mpm prefilter engine
Victor Julien [Sat, 9 Jul 2016 06:11:31 +0000 (08:11 +0200)] 
http_server_body / file_data: mpm prefilter engine

8 years agohttp_client_body: mpm prefilter engine
Victor Julien [Sat, 9 Jul 2016 05:59:29 +0000 (07:59 +0200)] 
http_client_body: mpm prefilter engine

8 years agohttp_headers: mpm prefilter engines
Victor Julien [Sat, 9 Jul 2016 05:16:58 +0000 (07:16 +0200)] 
http_headers: mpm prefilter engines

Register for both regular headers and trailers.

8 years agohttp_stat_code: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 17:35:13 +0000 (19:35 +0200)] 
http_stat_code: mpm prefilter engine

8 years agohttp_stat_msg: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 17:28:46 +0000 (19:28 +0200)] 
http_stat_msg: mpm prefilter engine

8 years agohttp_raw_host: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 16:48:54 +0000 (18:48 +0200)] 
http_raw_host: mpm prefilter engine

8 years agohttp_host: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 16:38:33 +0000 (18:38 +0200)] 
http_host: mpm prefilter engine

8 years agohttp_user_agent: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 16:27:36 +0000 (18:27 +0200)] 
http_user_agent: mpm prefilter engine

8 years agohttp_cookie: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 15:01:48 +0000 (17:01 +0200)] 
http_cookie: mpm prefilter engine

8 years agohttp_raw_uri: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 11:07:52 +0000 (13:07 +0200)] 
http_raw_uri: mpm prefilter engine

8 years agodns_query: mpm prefilter engine
Victor Julien [Fri, 8 Jul 2016 08:15:20 +0000 (10:15 +0200)] 
dns_query: mpm prefilter engine

8 years agopacket/stream: mpm prefilter engine
Victor Julien [Thu, 7 Jul 2016 17:25:10 +0000 (19:25 +0200)] 
packet/stream: mpm prefilter engine

8 years agohttp_method: mpm prefilter engine
Victor Julien [Thu, 7 Jul 2016 16:56:20 +0000 (18:56 +0200)] 
http_method: mpm prefilter engine

8 years agohttp_uri: mpm prefilter engine
Victor Julien [Thu, 7 Jul 2016 11:22:20 +0000 (13:22 +0200)] 
http_uri: mpm prefilter engine

Inspect partial request line as well.

8 years agoprefilter: introduce prefilter engines
Victor Julien [Wed, 6 Jul 2016 19:45:47 +0000 (21:45 +0200)] 
prefilter: introduce prefilter engines

Introduce abstraction layer for prefilter engines.

8 years agodetect: rename SignatureNonMpmStore
Victor Julien [Thu, 14 Jul 2016 13:02:43 +0000 (15:02 +0200)] 
detect: rename SignatureNonMpmStore

New name is SignatureNonPrefilterStore to reflect that it's not just
about MPM anymore.

8 years agodetect: rename non_mpm lists/vars to non_pf
Victor Julien [Thu, 14 Jul 2016 11:37:34 +0000 (13:37 +0200)] 
detect: rename non_mpm lists/vars to non_pf

Rename to non_pf: non prefilter.

8 years agoprefilter: rename PatternMatcherQueue datatype
Victor Julien [Thu, 14 Jul 2016 11:15:31 +0000 (13:15 +0200)] 
prefilter: rename PatternMatcherQueue datatype

In preparation of the introduction of more general purpose prefilter
engines, rename PatternMatcherQueue to PrefilterRuleStore. The new
engines will fill this structure a similar way to the current mpm
prefilters.

8 years agompm: remove Cleanup API call
Victor Julien [Sun, 10 Jul 2016 09:40:19 +0000 (11:40 +0200)] 
mpm: remove Cleanup API call

It's unused by all of the implementations.

8 years agodetect-fragoffset: minor cleanup
Victor Julien [Fri, 15 Jul 2016 14:09:03 +0000 (16:09 +0200)] 
detect-fragoffset: minor cleanup

8 years agouricontent: remove left over func decl
Victor Julien [Thu, 7 Jul 2016 08:48:04 +0000 (10:48 +0200)] 
uricontent: remove left over func decl

8 years agompm tls: remove unused function args
Victor Julien [Thu, 7 Jul 2016 08:33:28 +0000 (10:33 +0200)] 
mpm tls: remove unused function args

8 years agompm dns query: remove unused function args
Victor Julien [Thu, 7 Jul 2016 08:30:47 +0000 (10:30 +0200)] 
mpm dns query: remove unused function args

8 years agompm stat code: remove unused function args
Victor Julien [Thu, 7 Jul 2016 08:25:52 +0000 (10:25 +0200)] 
mpm stat code: remove unused function args

8 years agompm stat msg: remove unused function args
Victor Julien [Thu, 7 Jul 2016 08:24:19 +0000 (10:24 +0200)] 
mpm stat msg: remove unused function args

8 years agompm ua: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:45:19 +0000 (09:45 +0200)] 
mpm ua: remove unused function args

8 years agompm cookie: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:42:52 +0000 (09:42 +0200)] 
mpm cookie: remove unused function args

8 years agompm raw host: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:37:30 +0000 (09:37 +0200)] 
mpm raw host: remove unused function args

8 years agompm host: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:34:43 +0000 (09:34 +0200)] 
mpm host: remove unused function args

8 years agompm method: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:29:36 +0000 (09:29 +0200)] 
mpm method: remove unused function args

8 years agompm raw uri: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:25:48 +0000 (09:25 +0200)] 
mpm raw uri: remove unused function args

8 years agompm uri: remove unused function args
Victor Julien [Thu, 7 Jul 2016 07:24:00 +0000 (09:24 +0200)] 
mpm uri: remove unused function args

8 years agodetect-parse: add new func to get last sigmatch
Victor Julien [Thu, 18 Aug 2016 07:59:22 +0000 (09:59 +0200)] 
detect-parse: add new func to get last sigmatch

Add SigMatchGetLastSM which simply returns the very last SM added
to the signature.

Minor cleanups.

8 years agodoc: reorganize hyperscan guide
Victor Julien [Wed, 28 Sep 2016 19:11:14 +0000 (21:11 +0200)] 
doc: reorganize hyperscan guide

8 years agodoc: improve tuning/perf docs
Victor Julien [Wed, 28 Sep 2016 19:01:58 +0000 (21:01 +0200)] 
doc: improve tuning/perf docs

8 years agodoc: fix ET example URL
Victor Julien [Wed, 28 Sep 2016 18:44:30 +0000 (20:44 +0200)] 
doc: fix ET example URL

8 years agodoc: improve commandline options
Victor Julien [Wed, 28 Sep 2016 18:44:17 +0000 (20:44 +0200)] 
doc: improve commandline options

8 years agooutput-json-flow: display bypass method
Eric Leblond [Wed, 28 Sep 2016 11:50:01 +0000 (13:50 +0200)] 
output-json-flow: display bypass method

In the case of a bypassed flow we add a 'bypass' key that can
be 'local' or 'capture'. This will allow the user to know if
capture bypass method is failing by looking at the 'bypass' key.

8 years agoflow: add timeout for local bypass
Giuseppe Longo [Mon, 26 Sep 2016 14:45:15 +0000 (16:45 +0200)] 
flow: add timeout for local bypass

This adds a new timeout value for local bypassed state. For user
simplication it is called only `bypassed`. The patch also adds
a emergency value so we can clean bypassed flows a bit faster.

8 years agoflow: discard packets belonging to bypassed flows
Eric Leblond [Mon, 26 Sep 2016 11:35:44 +0000 (13:35 +0200)] 
flow: discard packets belonging to bypassed flows

8 years agoflow: downgrade to local bypass if we see packets
Eric Leblond [Mon, 26 Sep 2016 11:22:34 +0000 (13:22 +0200)] 
flow: downgrade to local bypass if we see packets

If we see packets for a capture bypassed flow after some times, it
means that the capture method is not handling correctly the bypass
so it is better to switch to local bypass method.

8 years agoflow: update lastts in FlowHandlePacketUpdate
Eric Leblond [Mon, 26 Sep 2016 11:17:01 +0000 (13:17 +0200)] 
flow: update lastts in FlowHandlePacketUpdate

This allows to make it conditional to the state of packet and
then trigger modified behavior.

8 years agofilestore: avoid conflict with bypass keyword
Giuseppe Longo [Mon, 8 Feb 2016 12:21:54 +0000 (13:21 +0100)] 
filestore: avoid conflict with bypass keyword

If a packet triggers a rule which contains both
bypass and filestore keywords,
it won't be stored since it's not inspected.

To avoid that, when a rule containing filestore keyword
we make sure that also bypass keyword is present.

8 years agodetect: add bypass keyword
Giuseppe Longo [Tue, 2 Feb 2016 10:37:23 +0000 (11:37 +0100)] 
detect: add bypass keyword

This adds a new keyword which permits to call the
bypass callback when a sig is matched.

The callback must be called when the match of the sig
is complete.

8 years agoflow: bypass encrypted and after stream depth flow
Eric Leblond [Thu, 28 Jan 2016 20:41:24 +0000 (21:41 +0100)] 
flow: bypass encrypted and after stream depth flow

This patch activates bypass for encrypted flow and for flow
that have reached stream depth on both side.

For encrypted flow , suricata is stopping the inspection so
we can just get it out via bypass. The same logic apply
for flow that have reached the stream depth.

For a basic test of feature, use the following ruleset:

```
table ip filter {
chain output {
type filter hook output priority 0; policy accept;
ct mark 0x1 counter accept
oif lo counter queue num 0
}

chain connmark_save {
type filter hook output priority 1; policy accept;
mark 0x1 ct mark set mark counter
ct mark 0x1 counter
}
}
```

And use bypass mark and mask of 1 in nfq configuration. Then you
can test the system by scp big file to 127.0.0.1. You can also
use iperf to measure the performance on localhost. It is recommended
to lower the MTU to 1500 to get something more realistic by increasing
the number of packets..

8 years agostream-tcp: enable bypass setting
Giuseppe Longo [Mon, 23 May 2016 07:53:08 +0000 (09:53 +0200)] 
stream-tcp: enable bypass setting

This permits to enable/disable in suricata.yaml
and the bypass function will be called
when stream.depth is reached.

8 years agonfq: introduce bypass function
Giuseppe Longo [Mon, 23 May 2016 07:31:12 +0000 (09:31 +0200)] 
nfq: introduce bypass function

8 years agodecode: implement bypass function
Eric Leblond [Mon, 19 Sep 2016 14:21:55 +0000 (16:21 +0200)] 
decode: implement bypass function

Call the packet bypass callback if necessary and update the flow
state. In case of failure we switch to local bypassed state and set
capture bypassed state if the callback is successful.

8 years agoflow: force reassembly for bypassed flows
Eric Leblond [Sun, 25 Sep 2016 23:25:52 +0000 (01:25 +0200)] 
flow: force reassembly for bypassed flows

As capture method like nfq will cut both side of the flow instantly
we will not get the hack for most data which have been received. So
it is better to force reassembly to be sure to get the timeout of
the entry.

8 years agoflow: get bypass info in get used flow function
Eric Leblond [Sun, 25 Sep 2016 23:25:32 +0000 (01:25 +0200)] 
flow: get bypass info in get used flow function

8 years agoflow: add pruned bypassed flow counter
Eric Leblond [Sat, 24 Sep 2016 10:12:09 +0000 (12:12 +0200)] 
flow: add pruned bypassed flow counter

8 years agoflow: display info about bypass in log
Eric Leblond [Thu, 15 Sep 2016 22:49:35 +0000 (00:49 +0200)] 
flow: display info about bypass in log

8 years agoflow: add bypassed states
Eric Leblond [Sat, 17 Sep 2016 08:18:08 +0000 (10:18 +0200)] 
flow: add bypassed states

This patch adds two new states to the flow:
* local bypass: for suricata only bypass, packets belonging to
a flow in this state will be discard fast
* capture bypass: capture method is handling the bypass and suricata
will discard packets that are currently queued

A bypassed state to flow that will be set on flow when a bypass
decision is taken. In the case of capture bypass this will allow
to remove faster the flow entry from the flow table instead of
waiting for the "established" timeout.

8 years agopacket: add API for bypass
Giuseppe Longo [Wed, 20 Jul 2016 09:46:00 +0000 (11:46 +0200)] 
packet: add API for bypass

8 years agodoc: remove/cleanup 'guides'
Victor Julien [Wed, 28 Sep 2016 13:14:00 +0000 (15:14 +0200)] 
doc: remove/cleanup 'guides'

8 years agodoc: fix lua keyword name
Victor Julien [Wed, 28 Sep 2016 12:47:23 +0000 (14:47 +0200)] 
doc: fix lua keyword name

8 years agodoc: update what is suricata section
Victor Julien [Wed, 28 Sep 2016 12:10:56 +0000 (14:10 +0200)] 
doc: update what is suricata section

8 years agodoc: commandline improvements
Victor Julien [Wed, 28 Sep 2016 11:45:55 +0000 (13:45 +0200)] 
doc: commandline improvements

8 years agodoc: move drop privs into configuration
Victor Julien [Wed, 28 Sep 2016 11:33:46 +0000 (13:33 +0200)] 
doc: move drop privs into configuration

8 years agodoc: bundle pre-built man page in distribution
Jason Ish [Wed, 21 Sep 2016 03:16:05 +0000 (21:16 -0600)] 
doc: bundle pre-built man page in distribution

8 years agodoc: rename to 'Suricata User Guide'
Victor Julien [Wed, 21 Sep 2016 05:39:09 +0000 (07:39 +0200)] 
doc: rename to 'Suricata User Guide'

8 years agodoc: move snort compat to rule chapter
Victor Julien [Wed, 21 Sep 2016 05:38:45 +0000 (07:38 +0200)] 
doc: move snort compat to rule chapter

8 years agodoc: make target for pdf, and suricata.1 shortcut
Jason Ish [Tue, 20 Sep 2016 23:07:15 +0000 (17:07 -0600)] 
doc: make target for pdf, and suricata.1 shortcut

8 years agodoc: shorten some paths to satisfy distcheck
Jason Ish [Tue, 20 Sep 2016 16:48:14 +0000 (10:48 -0600)] 
doc: shorten some paths to satisfy distcheck

Long paths were being dropped from the source package.

8 years agodoc: list files/directories in EXTRA_DIST
Jason Ish [Tue, 20 Sep 2016 16:37:51 +0000 (10:37 -0600)] 
doc: list files/directories in EXTRA_DIST

So files get included in the distribution and pass
make distcheck.

8 years agodoc: get Suricata version from autoconf vars
Jason Ish [Tue, 20 Sep 2016 15:57:36 +0000 (09:57 -0600)] 
doc: get Suricata version from autoconf vars

8 years agodoc: use - instead of _ in filenames for consistency
Jason Ish [Tue, 20 Sep 2016 15:29:17 +0000 (09:29 -0600)] 
doc: use - instead of _ in filenames for consistency

8 years agodoc: link up hyperscan and packet capture
Jason Ish [Tue, 20 Sep 2016 15:28:09 +0000 (09:28 -0600)] 
doc: link up hyperscan and packet capture

8 years agodoc: expose variables for substition in docs
Jason Ish [Mon, 7 Mar 2016 19:11:01 +0000 (13:11 -0600)] 
doc: expose variables for substition in docs

8 years agodoc: minimal man page: suricata.1
Jason Ish [Fri, 26 Feb 2016 23:30:15 +0000 (17:30 -0600)] 
doc: minimal man page: suricata.1

8 years agodoc: hook sphinx into build
Jason Ish [Thu, 18 Feb 2016 21:50:13 +0000 (15:50 -0600)] 
doc: hook sphinx into build

8 years agodoc: packet capture: sync up with wiki
Jason Ish [Tue, 20 Sep 2016 14:59:26 +0000 (08:59 -0600)] 
doc: packet capture: sync up with wiki

8 years agodoc: dns: sync up with wiki
Jason Ish [Tue, 20 Sep 2016 14:59:10 +0000 (08:59 -0600)] 
doc: dns: sync up with wiki

8 years agodoc: flow:not_established not supported
Jason Ish [Fri, 19 Aug 2016 16:20:49 +0000 (10:20 -0600)] 
doc: flow:not_established not supported

8 years agodocs: sync up to recent redmine
Andreas Herz [Wed, 13 Jul 2016 20:51:05 +0000 (22:51 +0200)] 
docs: sync up to recent redmine