]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Sat, 24 Dec 2016 09:43:36 +0000 (10:43 +0100)]
detect: add and use util func for alproto sets
Victor Julien [Wed, 21 Dec 2016 10:39:58 +0000 (11:39 +0100)]
doc: update for unix socket hostbits
Victor Julien [Thu, 15 Dec 2016 16:40:28 +0000 (17:40 +0100)]
flowvar: shrink flowvar type by using padded space
Victor Julien [Sun, 6 Nov 2016 21:43:41 +0000 (16:43 -0500)]
lua: support key/value flowvars in lua
Victor Julien [Thu, 15 Dec 2016 16:09:46 +0000 (17:09 +0100)]
flowvar: remove unused DETECT_VAR_TYPE_ALWAYS
Victor Julien [Thu, 15 Dec 2016 14:10:30 +0000 (15:10 +0100)]
doc: update unix socket
Victor Julien [Thu, 15 Dec 2016 13:49:40 +0000 (14:49 +0100)]
suricatasc: add/list/remove hostbit commands
Syntax:
add-hostbit <ip> <bit name> <expire>
Example:
add-hostbit 1.2.3.4 blacklist 3600
Syntax:
remove-hostbit <ip> <bit name>
Example:
remove-hostbit 1.2.3.4 blacklist
Syntax:
list-hostbit <ip>
Example:
list-hostbit 1.2.3.4
Victor Julien [Thu, 15 Dec 2016 13:49:17 +0000 (14:49 +0100)]
unix-socket: add/list/remove hostbit commands
add-hostbit adds a named hostbit with an expire time in seconds.
remove-hostbit removes hostbit by name.
add-hostbit, remove-hostbit return success or failure.
list-hostbit returns a json array of hostbits with their name and
expire time:
{
"message": {
"count": 1,
"hostbits":
[{
"expire": 3222,
"name": "firefox-users"
}]
},
"return": "OK"
}
Victor Julien [Wed, 21 Dec 2016 10:16:41 +0000 (11:16 +0100)]
hostbits: add list API
Victor Julien [Sat, 5 Nov 2016 13:02:39 +0000 (09:02 -0400)]
pktvars: same name pktvars, key-value vars
Victor Julien [Fri, 28 Oct 2016 21:12:43 +0000 (23:12 +0200)]
outputs: vars log
EVE addition called 'vars' that logs pkt/flow vars for each packet/flow.
Victor Julien [Fri, 21 Oct 2016 10:55:32 +0000 (12:55 +0200)]
eve: log pktvars/flowvars/bits/ints
Optionally logs 'vars' into alerts
Victor Julien [Fri, 28 Oct 2016 10:27:35 +0000 (12:27 +0200)]
pcre: new way of specifying var names
Until now the way to specify a var name in pcre substring capture
into pkt and flow vars was to use the pcre named substring support:
e.g. /(?P<pkt_somename>.*)/
This had 2 drawbacks:
1. limitations of the name. The name could be max 32 chars, only have
alphanumeric and the underscore characters. This imposed limitations
that are not present in flowbits/ints.
2. we didn't actually use the named substrings in pcre through the
API. We parsed the names separately. So putting the names in pcre
would actually be wasteful.
This patch introduces a new way of mapping captures with names:
pcre:"/(.*)/, pkt:somename";
pcre:"/([A-z]+) ([0-9]+)/, pkt:somename,flow:anothername";
The order of the captures and the order of the names are mapped 1 on 1.
This method is no longer limited by the pcre API's naming limits. The
'flow:' and 'pkt:' prefixes indicate what the type of variable is. It's
mandatory to specify one.
The old method is still supported as well.
Victor Julien [Thu, 27 Oct 2016 15:41:38 +0000 (17:41 +0200)]
pkt-var: abuse flowvar postmatch logic for pktvars
Flowvars were already using a temporary store in the detect thread
ctx.
Use the same facility for pktvars. The reasons are:
1. packet is not always available, e.g. when running pcre on http
buffers.
2. setting of vars should be done post match. Until now it was also
possible that it is done on a partial match.
Victor Julien [Thu, 27 Oct 2016 13:41:10 +0000 (15:41 +0200)]
pkt-var: use id instead of name pointer
Victor Julien [Wed, 26 Oct 2016 14:55:34 +0000 (16:55 +0200)]
pcre: support multiple captures
Support up to 8 substring captures into pkt or flow vars.
Victor Julien [Wed, 26 Oct 2016 12:35:26 +0000 (14:35 +0200)]
detect-pcre: small cleanups
Victor Julien [Fri, 21 Oct 2016 16:47:48 +0000 (18:47 +0200)]
alert-debug: print flowvar/int names
Victor Julien [Fri, 21 Oct 2016 16:19:14 +0000 (18:19 +0200)]
alert-debug: print flowbit names from VarNameStore
Victor Julien [Thu, 20 Oct 2016 12:38:33 +0000 (14:38 +0200)]
var-names: expose outside of detect engine
Until now variable names, such as flowbit names, were local to a detect
engine. This made sense as they were only ever used in that context.
For the purpose of logging these names, this needs a different approach.
The loggers live outside of the detect engine. Also, in the case of
reloads and multi-tenancy, there are even multiple detect engines, so
it would be even more tricky to access them from the outside.
This patch brings a new approach. A any time, there is a single active
hash table mapping the variable names and their id's. For multiple
tenants the table is shared between tenants.
The table is set up in a 'staging' area, where locking makes sure that
multiple loading threads don't mess things up. Then when the preparing
of a detection engine is ready, but before the detect threads are made
aware of the new detect engine, the active varname hash is swapped with
the staging instance.
For this to work, all the mappings from the 'current' or active mapping
are added to the staging table.
After the threads have reloaded and the new detection engine is active,
the old table can be freed.
For multi tenancy things are similar. The staging area is used for
setting up until the new detection engines / tenants are applied to
the system.
This patch also changes the variable 'id'/'idx' field to uint32_t. Due
to data structure padding and alignment, this should have no practical
drawback while allowing for a lot more vars.
Victor Julien [Wed, 26 Oct 2016 11:44:53 +0000 (13:44 +0200)]
detect: use engine version instead of id
Use engine version based on global detect engine master. This is
incremented between reloads.
Victor Julien [Fri, 23 Dec 2016 16:18:10 +0000 (17:18 +0100)]
detect: ssh_software sticky buffer
Victor Julien [Fri, 23 Dec 2016 16:10:18 +0000 (17:10 +0100)]
detect: ssh_proto stickybuffer
Victor Julien [Fri, 23 Dec 2016 15:03:08 +0000 (16:03 +0100)]
detect: remove unused SIGMATCH_PAYLOAD flag
Victor Julien [Fri, 23 Dec 2016 14:17:19 +0000 (15:17 +0100)]
detect: remove unused state file flag
Victor Julien [Fri, 23 Dec 2016 13:45:08 +0000 (14:45 +0100)]
detect: small API cleanup
Victor Julien [Fri, 23 Dec 2016 12:59:25 +0000 (13:59 +0100)]
detect: move file hash common code
Victor Julien [Fri, 23 Dec 2016 12:57:12 +0000 (13:57 +0100)]
detect: unify FileMatch API with other calls
Victor Julien [Thu, 22 Dec 2016 22:56:48 +0000 (23:56 +0100)]
detect: remove DMATCH list
Victor Julien [Thu, 22 Dec 2016 19:49:32 +0000 (20:49 +0100)]
flow: remove unused Flow::de_state
Victor Julien [Thu, 22 Dec 2016 19:31:38 +0000 (20:31 +0100)]
detect: remove the AMATCH list
Victor Julien [Thu, 22 Dec 2016 19:17:49 +0000 (20:17 +0100)]
detect: remove AppLayerMatch API call
Victor Julien [Thu, 22 Dec 2016 19:05:17 +0000 (20:05 +0100)]
dce: dynamic lists
Victor Julien [Thu, 22 Dec 2016 18:03:44 +0000 (19:03 +0100)]
smb/dcerpc: use tx api
Victor Julien [Thu, 22 Dec 2016 15:55:43 +0000 (16:55 +0100)]
dcerpc: simplify common detect code
Victor Julien [Thu, 22 Dec 2016 14:21:32 +0000 (15:21 +0100)]
ftp: parser and ftpbounce update
Convert parser to TX API.
Convert ftpbounce keyword to use that.
Victor Julien [Thu, 22 Dec 2016 13:48:53 +0000 (14:48 +0100)]
detect: move lua smtp support to dynamic list
Victor Julien [Thu, 22 Dec 2016 12:29:07 +0000 (13:29 +0100)]
lua: convert lua output to be tx aware
Victor Julien [Thu, 22 Dec 2016 12:07:06 +0000 (13:07 +0100)]
detect: make ssh detection use dynamic list
Victor Julien [Thu, 22 Dec 2016 11:48:59 +0000 (12:48 +0100)]
ssh: remove single logger limit
Victor Julien [Thu, 22 Dec 2016 11:45:17 +0000 (12:45 +0100)]
ssh: convert app-layer parser to be tx aware
Like with SSL, there is only a single 'tx'.
Victor Julien [Thu, 22 Dec 2016 09:35:44 +0000 (10:35 +0100)]
lua: use tls_generic list for ssl/tls
Victor Julien [Thu, 22 Dec 2016 09:32:00 +0000 (10:32 +0100)]
detect ssl/tls: use dynamic lists
Victor Julien [Thu, 22 Dec 2016 09:09:34 +0000 (10:09 +0100)]
ssl/tls: clean up keywords
Victor Julien [Wed, 21 Dec 2016 20:27:56 +0000 (21:27 +0100)]
detect: convert old tls keywords to dynamic list
Victor Julien [Wed, 21 Dec 2016 18:53:00 +0000 (19:53 +0100)]
tls.store: convert to postmatch
Victor Julien [Wed, 21 Dec 2016 18:43:25 +0000 (19:43 +0100)]
tls.store: cleanup
Victor Julien [Wed, 21 Dec 2016 16:58:26 +0000 (17:58 +0100)]
app-layer-events: remove unused API options
Victor Julien [Tue, 20 Dec 2016 13:04:55 +0000 (14:04 +0100)]
detect: http_start sticky buffer
Matches on the start of a HTTP request or response.
Uses a buffer constructed from the request line and normalized request
headers, including the Cookie header.
Or for the response side, it uses the response line plus the
normalized response headers, including the Set-Cookie header.
Both buffers are terminated by an extra \r\n.
Victor Julien [Mon, 19 Dec 2016 22:41:40 +0000 (23:41 +0100)]
detect: add http_protocol sticky buffer
Matches on protocol field in HTTP.
Victor Julien [Mon, 19 Dec 2016 16:06:11 +0000 (17:06 +0100)]
http_header: convert to use common code
Victor Julien [Mon, 19 Dec 2016 14:45:12 +0000 (15:45 +0100)]
http_header: common detection code
Victor Julien [Mon, 19 Dec 2016 13:43:59 +0000 (14:43 +0100)]
http_header: remove old files
Victor Julien [Mon, 19 Dec 2016 13:38:27 +0000 (14:38 +0100)]
http_header: move all code into keyword files
Victor Julien [Mon, 19 Dec 2016 10:25:58 +0000 (11:25 +0100)]
detect: http_header_names sticky buffer keyword
A sticky buffer that allows content inspection on a contructed buffer
of HTTP header names. The buffer starts with \r\n, the names are
separated by \r\n and the end of the buffer contains an extra \r\n.
E.g. \r\nHost\r\nUser-Agent\r\n\r\n
The leading \r\n is to make sure one can match on a full name in all
cases.
Victor Julien [Mon, 19 Dec 2016 10:25:27 +0000 (11:25 +0100)]
detect: global registery for keyword thread data
Some keywords need a scratch space where they can do store the results
of expensive operations that remain valid for the time of a packets
journey through the detection engine.
An example is the reconstructed 'http_header' field, that is needed
in MPM, and then for each rule that manually inspects it. Storing this
data in the flow is a waste, and reconstructing multiple times on
demand as well.
This API allows for registering a keyword with an init and free function.
It it mean to be used an initialization time, when the keyword is
registered.
Victor Julien [Thu, 15 Dec 2016 10:18:44 +0000 (11:18 +0100)]
profiling: output all sort options for rules
Limit the default number of sids to 10.
Victor Julien [Thu, 15 Dec 2016 10:17:13 +0000 (11:17 +0100)]
profiling: honor limit in json rule output
Victor Julien [Thu, 15 Dec 2016 09:12:21 +0000 (10:12 +0100)]
profiling: fix keyword profiling
Victor Julien [Wed, 14 Dec 2016 12:08:39 +0000 (13:08 +0100)]
detect-engine-mpm: api cleanup
Victor Julien [Mon, 12 Dec 2016 19:00:26 +0000 (20:00 +0100)]
detect: detect engine registration cleanup
Victor Julien [Mon, 12 Dec 2016 11:20:46 +0000 (12:20 +0100)]
detect: cleanup built-in list id's
Victor Julien [Mon, 12 Dec 2016 11:03:46 +0000 (12:03 +0100)]
template: dynamic buffer
Victor Julien [Sun, 11 Dec 2016 08:59:31 +0000 (09:59 +0100)]
app-layer-events: dynamic list
Victor Julien [Sat, 10 Dec 2016 21:03:46 +0000 (22:03 +0100)]
files: use dynamic list
Victor Julien [Sat, 10 Dec 2016 20:55:51 +0000 (21:55 +0100)]
cip/enip: dynamic buffer
Victor Julien [Sat, 10 Dec 2016 13:36:06 +0000 (14:36 +0100)]
modbus: dynamic buffer
Victor Julien [Sat, 10 Dec 2016 13:04:50 +0000 (14:04 +0100)]
dnp3: dynamic buffers/lists
Victor Julien [Sat, 10 Dec 2016 10:36:06 +0000 (11:36 +0100)]
tls: dynamic buffers
Victor Julien [Sat, 10 Dec 2016 09:49:51 +0000 (10:49 +0100)]
dns: use dynamic buffers
Victor Julien [Fri, 9 Dec 2016 18:01:01 +0000 (19:01 +0100)]
detect-parse: content modifier cleanup
Victor Julien [Fri, 9 Dec 2016 17:29:44 +0000 (18:29 +0100)]
http_raw_uri: dynamic buffer
Victor Julien [Fri, 9 Dec 2016 17:09:48 +0000 (18:09 +0100)]
http_client_body: dynamic buffer
Victor Julien [Fri, 9 Dec 2016 14:27:51 +0000 (15:27 +0100)]
http_header / http_raw_header: dynamic buffers
Victor Julien [Fri, 9 Dec 2016 13:46:05 +0000 (14:46 +0100)]
http_stat_msg: dynamic buffer
Victor Julien [Fri, 9 Dec 2016 13:00:48 +0000 (14:00 +0100)]
http_stat_code: dynamic buffer
Victor Julien [Fri, 9 Dec 2016 12:47:14 +0000 (13:47 +0100)]
http_raw_host: dynamic buffer
Victor Julien [Fri, 9 Dec 2016 11:07:03 +0000 (12:07 +0100)]
http_host: dynamic buffer
Victor Julien [Thu, 8 Dec 2016 10:40:08 +0000 (11:40 +0100)]
http_cookie: dynamic buffer
Victor Julien [Thu, 8 Dec 2016 10:05:51 +0000 (11:05 +0100)]
http_user_agent: dynamic buffer
Victor Julien [Thu, 8 Dec 2016 09:33:15 +0000 (10:33 +0100)]
http_response_line: dynamic buffer
Victor Julien [Thu, 8 Dec 2016 08:19:34 +0000 (09:19 +0100)]
http_uri: dynamic buffer
Clean up tests
Victor Julien [Wed, 7 Dec 2016 17:02:37 +0000 (18:02 +0100)]
http_method: make list dynamic
Victor Julien [Wed, 14 Dec 2016 10:42:58 +0000 (11:42 +0100)]
file_data: dynamic buffer
Victor Julien [Mon, 17 Oct 2016 22:50:26 +0000 (00:50 +0200)]
http_request_line: dynamic buffer
Victor Julien [Wed, 14 Dec 2016 11:39:13 +0000 (12:39 +0100)]
detect: remove hardcoded sm_list logic from setup
Introduce utility functions to aid this.
Victor Julien [Wed, 14 Dec 2016 11:38:58 +0000 (12:38 +0100)]
detect: buffer type API
To replace the hardcoded SigMatch list id's, use this API to register
and query lists by name.
Also allow for registering descriptions and whether mpm is supported.
Registration is only allowed at startup.
Victor Julien [Mon, 17 Oct 2016 22:42:26 +0000 (00:42 +0200)]
detect: inspect engine setup cleanup
Victor Julien [Sun, 16 Oct 2016 09:02:50 +0000 (11:02 +0200)]
detect: dce test fixes and improvements
Victor Julien [Sun, 16 Oct 2016 08:44:33 +0000 (10:44 +0200)]
detect-csum: redo tests
Victor Julien [Mon, 17 Oct 2016 14:54:40 +0000 (16:54 +0200)]
detect: move init only Signature members to init_data
Victor Julien [Mon, 17 Oct 2016 14:08:02 +0000 (16:08 +0200)]
detect: shrink Signature::sm_arrays
Signature::sm_arrays now only contains 'built-in' lists, and so is
sized appropriately.
Victor Julien [Mon, 17 Oct 2016 12:17:55 +0000 (14:17 +0200)]
detect: reorganize id's in prep of dynamic lists
Victor Julien [Sun, 16 Oct 2016 19:12:32 +0000 (21:12 +0200)]
threshold: fix and redo tests
Victor Julien [Sun, 16 Oct 2016 19:29:34 +0000 (21:29 +0200)]
detect: improve memory handling & comments
Victor Julien [Sun, 16 Oct 2016 13:30:22 +0000 (15:30 +0200)]
detect: get rid of Signature::sm_lists
Instead use the lists in init_data during setup and the SigMatchData
arrays during runtime.
Victor Julien [Sat, 15 Oct 2016 22:07:48 +0000 (00:07 +0200)]
detect: use detect list passed to generic funcs
Until now the GenericList users used hardcoded list id's.
Victor Julien [Sat, 15 Oct 2016 20:37:07 +0000 (22:37 +0200)]
detect: pass SigMatchData to inspect functions
Victor Julien [Sat, 15 Oct 2016 17:26:48 +0000 (19:26 +0200)]
detect: template list in engine
Victor Julien [Sat, 15 Oct 2016 17:24:35 +0000 (19:24 +0200)]
detect: enip/cip list in engine