]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
11 years agoprofiling: end profiling tunnel packets inside lock 820/head
Victor Julien [Tue, 4 Feb 2014 17:18:46 +0000 (18:18 +0100)] 
profiling: end profiling tunnel packets inside lock

End profiling inside the lock for a tunnel packet as otherwise another
thread may already free the packet while the profiling code runs.

SEGV's observed and now gone.

11 years agofileext: make case insensitive
Victor Julien [Tue, 4 Feb 2014 16:26:39 +0000 (17:26 +0100)] 
fileext: make case insensitive

Change keyword to be case insensitive when matching.

Ticket #597.

11 years agoWhen setting a sequence value, check for an existing node. 818/head
Jason Ish [Tue, 10 Dec 2013 18:09:40 +0000 (12:09 -0600)] 
When setting a sequence value, check for an existing node.

This makes --set af-packet.0.threads=X do what you expect by
looking for the sequence node before setting.

11 years agoAdd a --set command line option to set/override a configuration value.
Jason Ish [Wed, 4 Dec 2013 06:00:07 +0000 (00:00 -0600)] 
Add a --set command line option to set/override a configuration value.

11 years agojson dns: fix tx logic
Victor Julien [Tue, 4 Feb 2014 13:07:10 +0000 (14:07 +0100)] 
json dns: fix tx logic

The JSON DNS logger would still have some conditions in the main
Logger function. This led to some transactions not beeing logged.

11 years agoprofiling: output log api modules separately
Victor Julien [Tue, 4 Feb 2014 11:53:00 +0000 (12:53 +0100)] 
profiling: output log api modules separately

Skip log api thread modules in the regular 'thread modules' list,
instead print them in a separate list.

11 years agoprofiling: fix percentage of detect phases
Victor Julien [Tue, 4 Feb 2014 11:52:07 +0000 (12:52 +0100)] 
profiling: fix percentage of detect phases

Use proper 'total' to calculate weigth of each detection phase.

11 years agothreading: add missing json types to TmModuleTmmIdToString
Victor Julien [Tue, 4 Feb 2014 11:15:04 +0000 (12:15 +0100)] 
threading: add missing json types to TmModuleTmmIdToString

Also, remove 'default' case from switch statement, so missing entries
will lead to a compiler warning.

11 years agooutput: add TM_FLAG_LOGAPI_TM thread module flag
Victor Julien [Tue, 4 Feb 2014 10:49:20 +0000 (11:49 +0100)] 
output: add TM_FLAG_LOGAPI_TM thread module flag

The TM_FLAG_LOGAPI_TM flag indicates that a module is run by the log
api, not by the 'regular' thread module call functions.

Set flag in all all Log API users' registration code.

Purpose of this flag is in profiling. In profiling output it will be
used to list log api thread modules separately.

11 years agoprofiling: support log api
Victor Julien [Tue, 4 Feb 2014 10:34:21 +0000 (11:34 +0100)] 
profiling: support log api

The log API calls thread modules directly, so the TMM profiling logic
can be applied to it. This patch does so.

The "Thread Module" out now again lists the individual loggers. As the
module are normally called much less frequently the numbers are hard to
compare to pre-log-api numbers.

11 years agothreading: add utility to get module id from name
Victor Julien [Tue, 4 Feb 2014 10:31:02 +0000 (11:31 +0100)] 
threading: add utility to get module id from name

Add TmModuleGetIdByName to go from module name to id directly.

11 years agoprofiling: add sample-rate yaml option
Victor Julien [Mon, 3 Feb 2014 16:40:45 +0000 (17:40 +0100)] 
profiling: add sample-rate yaml option

Add option "profiling.sample-rate":

  # Run profiling for every xth packet. The default is 1, which means we
  # profile every packet. If set to 1000, one packet is profiled for every
  # 1000 received.
  #sample-rate: 1000

This allows for configuration of the sample rate.

11 years agoprofiling: conditional rule profiling
Victor Julien [Sat, 1 Feb 2014 14:58:58 +0000 (15:58 +0100)] 
profiling: conditional rule profiling

Add support for conditional rule profiling. Currently only simple
rate limiting is supported, but hardcoded to inspecting rules for
each packet.

11 years agoprofiling: lower overhead when disabled
Victor Julien [Sat, 1 Feb 2014 11:57:01 +0000 (12:57 +0100)] 
profiling: lower overhead when disabled

Instead of a large (6k+) structure in the Packet, make the profiling
storage dynamic. To do this the Packet->profile is now a pointer.

Initial support for selective sampling, e.g. only profile every
1000th packet.

11 years agotls: fix negated match
Eric Leblond [Tue, 28 Jan 2014 15:54:51 +0000 (16:54 +0100)] 
tls: fix negated match

A negated match is matching if the tested field is NULL. But as it
is not set, nor negated nor normal test must match.

Without this patch, a rule like:
 alert tls any any -> any any (msg:"negated match"; tls.subject:!"CN=home.regit.org"; sid:1; rev:1;)
is alerting for all connections. Event if they are done on a certificate
with matching subject. This was due to the fact that tls protocol
is discovered before the handshake is complete. Thus the condition
on tls is true with a NULL tls.subject. And code was returning a
positive match in the case of a NULL subject and a signature with
a negated match.

11 years agoUpdated banned function cocci check
Victor Julien [Fri, 31 Jan 2014 11:53:26 +0000 (12:53 +0100)] 
Updated banned function cocci check

Added: strndup and strchrnul

Both are not supported on OS X 10.6. It's rather old, but it's the
only Mac QA box I have, so for now it'll have to do.

11 years agoReplace strchrnul with strchr
Victor Julien [Fri, 31 Jan 2014 11:52:36 +0000 (12:52 +0100)] 
Replace strchrnul with strchr

And add a null check then of course. strchrnul isn't supported on
all platforms.

11 years agoRemove SCStrndup
Victor Julien [Fri, 31 Jan 2014 11:25:16 +0000 (12:25 +0100)] 
Remove SCStrndup

Removed strndup wrapper as it's not available in all plaforms.

11 years agoReplace remaining SCStrndup calls
Victor Julien [Fri, 31 Jan 2014 11:23:53 +0000 (12:23 +0100)] 
Replace remaining SCStrndup calls

Replace them with BytesToString().

11 years agoIntroduce BytesToString utility
Victor Julien [Fri, 31 Jan 2014 11:21:47 +0000 (12:21 +0100)] 
Introduce BytesToString utility

Introduce a utility function to convert an array of bytes into a
null-terminated string:

 char *BytesToString(const uint8_t *bytes, size_t nbytes);

All non-printables are copied over, except for '\0', which is
turned into literal '\' '0' in the string. So the resulting string
may be bigger than the input.

11 years agojson loggers: dup bstr with bstr_util_strdup_to_c
Victor Julien [Fri, 31 Jan 2014 09:49:57 +0000 (10:49 +0100)] 
json loggers: dup bstr with bstr_util_strdup_to_c

In various places SCStrndup was used to 'dup' a bstr string, however
libhtp provides bstr_util_strdup_to_c for this. As this is a cleaner
interface, it's preferred.

11 years agostream: yaml addition for recent config options
Victor Julien [Fri, 31 Jan 2014 08:33:29 +0000 (09:33 +0100)] 
stream: yaml addition for recent config options

11 years agoutil-host-os-info: scan-build fix
Victor Julien [Thu, 30 Jan 2014 15:23:44 +0000 (16:23 +0100)] 
util-host-os-info: scan-build fix

util-host-os-info.c:202:13: warning: Potential leak of memory pointed to by 'user_data'
            SCLogError(SC_ERR_INVALID_IPV6_ADDR, "Invalid IPV6 address inside");
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-debug.h:278:35: note: expanded from macro 'SCLogError'
 #define SCLogError(err_code, ...) SCLogErr(SC_LOG_ERROR, err_code, \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-debug.h:214:82: note: expanded from macro 'SCLogErr'
                                  char _sc_log_err_msg[SC_LOG_MAX_LOG_MSG_LEN] = ""; \
                                                                                 ^~
1 warning generated.

11 years agoutil-host-os-info: scan build fixes
Victor Julien [Thu, 30 Jan 2014 15:08:20 +0000 (16:08 +0100)] 
util-host-os-info: scan build fixes

util-host-os-info.c:200:13: warning: Potential leak of memory pointed to by 'ip_str'
            SCLogError(SC_ERR_INVALID_IPV6_ADDR, "Invalid IPV6 address inside");
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-debug.h:278:35: note: expanded from macro 'SCLogError'
 #define SCLogError(err_code, ...) SCLogErr(SC_LOG_ERROR, err_code, \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-debug.h:214:82: note: expanded from macro 'SCLogErr'
                                  char _sc_log_err_msg[SC_LOG_MAX_LOG_MSG_LEN] = ""; \
                                                                                 ^~
util-host-os-info.c:200:13: warning: Potential leak of memory pointed to by 'user_data'
            SCLogError(SC_ERR_INVALID_IPV6_ADDR, "Invalid IPV6 address inside");
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-debug.h:278:35: note: expanded from macro 'SCLogError'
 #define SCLogError(err_code, ...) SCLogErr(SC_LOG_ERROR, err_code, \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-debug.h:214:82: note: expanded from macro 'SCLogErr'
                                  char _sc_log_err_msg[SC_LOG_MAX_LOG_MSG_LEN] = ""; \
                                                                                 ^~
2 warnings generated.

11 years agoFix util-debug scan-build warnings
Victor Julien [Thu, 30 Jan 2014 15:02:17 +0000 (16:02 +0100)] 
Fix util-debug scan-build warnings

util-debug.c:461:12: warning: Potential leak of memory pointed to by 'substr'
    return SC_ERR_SPRINTF;
           ^~~~~~~~~~~~~~
util-debug.c:856:31: warning: Potential leak of memory pointed to by 's'
                op_ifaces_ctx = SCLogInitFileOPIface(s, NULL, SC_LOG_LEVEL_MAX);
                ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util-debug.c:1349:9: warning: Potential leak of memory pointed to by 's'
    if (log_level >= 0 && log_level < SC_LOG_LEVEL_MAX)
        ^~~~~~~~~
3 warnings generated.

11 years agojson file: separate http params 810/head
Eric Leblond [Fri, 31 Jan 2014 11:05:48 +0000 (12:05 +0100)] 
json file: separate http params

This patch separates http keys from file to have a different value
list:

{
 "time":"01\/31\/2014-12:04:52.837245","event_type":"file","src_ip":"5.3.1.1","src_port":80,"dest_ip":"1.8.1.9","dest_port":9539,"proto":"TCP",
 "http":{"url":"/foo/","hostname":"bar.com","http_refer":"http:\/\/bar.org","http_user_agent":"Mozilla\/5.0"},
 "file":{"filename":"bar","magic":"unknown","state":"CLOSED","stored":false,"size":21}
}

One interest of this modification is that it is possible to use the
same key as the one used in http events. Thus correlating both type
of events is trivial. On code side, this will permit to factorize
the code by simply asking the underlying protocol to output its
info in a json object.

Second interest is that adding file extraction for a new protocol
will result in only changing the protocol specific json list.

11 years agojson: add event_type key
Eric Leblond [Fri, 31 Jan 2014 10:54:19 +0000 (11:54 +0100)] 
json: add event_type key

This patch adds an event_type key to the generated events. Current
value is one of "dns", "alert, "file", "tls", "http", "drop". It is
then easy to differentiate in log analysis tools the events based on
source inside Suricata.

11 years agojson dns: do not use array to output answer
Eric Leblond [Fri, 31 Jan 2014 09:58:35 +0000 (10:58 +0100)] 
json dns: do not use array to output answer

Without this patch DNS answers for a single query are stored in a
single json event. The result is an array in the object like this one:
 {"type":"answer","id":45084,"rrname":"s-static.ak.facebook.com","rrtype":"CNAME","ttl":734},
 {"type":"answer","id":45084,"rrname":"s-static.ak.facebook.com.edgekey.net","rrtype":"CNAME","ttl":1710},
This type of output is not well supported in logstash. It is
displayed as it is written above and it is not possible to
query the fields.

I think the reason is that this is not logical if we consider search
query. For example if we search for "rrname" equal "s-static.ak.facebook.com"
we got one entry with two values in it. That's against the logic
of event. Furthermore, if we want to get a complete query, we can
used the id.

This patch splits the answer part in mulitple message. The result
is then accepted by logstash and fields can be queried easily.

11 years agojson-dns: sync field names with draft rfc2629
Eric Leblond [Fri, 31 Jan 2014 08:43:31 +0000 (09:43 +0100)] 
json-dns: sync field names with draft rfc2629

This patch updates DNS field name to be in sync with RFC 2629:
 https://github.com/adulau/pdns-qof
This will allow to easily use Suricata with other passive DNS tools.

11 years agojson: sync key name with CIM
Eric Leblond [Thu, 30 Jan 2014 22:33:45 +0000 (23:33 +0100)] 
json: sync key name with CIM

This patch is synchronizing key name with Common Information Model.
It updates key name following what is proposed in:
 http://docs.splunk.com/Documentation/PCI/2.0/DataSource/CommonInformationModelFieldReference
The interest of these modifications is that using the same key name
as other software will provide an easy to correlate and improve
data. For example, geoip setting in logstash can be applied on
all src_ip fields allowing geoip tagging of data.

11 years agoVarious fixes for scan-build warnings 807/head
Victor Julien [Thu, 30 Jan 2014 14:22:55 +0000 (15:22 +0100)] 
Various fixes for scan-build warnings

11 years agooutput: cleanups 806/head
Victor Julien [Thu, 30 Jan 2014 13:38:03 +0000 (14:38 +0100)] 
output: cleanups

Preparation of making output type for json logs configurable.

11 years agojson tls log: rename to output-json-tls
Victor Julien [Thu, 30 Jan 2014 12:58:28 +0000 (13:58 +0100)] 
json tls log: rename to output-json-tls

11 years agooutput: check for multiple instances of drop and tls
Victor Julien [Thu, 30 Jan 2014 12:49:42 +0000 (13:49 +0100)] 
output: check for multiple instances of drop and tls

Both the drop and tls logs are currently not designed to have multiple
instances running. So until that is changed, error out if more than one
instance is started.

11 years agojson drop log: rename to output-json-drop
Victor Julien [Thu, 30 Jan 2014 12:34:45 +0000 (13:34 +0100)] 
json drop log: rename to output-json-drop

11 years agojson dns: rename output-dnslog -> output-json-dns
Victor Julien [Thu, 30 Jan 2014 12:29:36 +0000 (13:29 +0100)] 
json dns: rename output-dnslog -> output-json-dns

11 years agojson: rename output-httplog -> output-json-http
Victor Julien [Thu, 30 Jan 2014 12:26:59 +0000 (13:26 +0100)] 
json: rename output-httplog -> output-json-http

11 years agojson outputs: cleanups 805/head
Victor Julien [Thu, 30 Jan 2014 12:20:47 +0000 (13:20 +0100)] 
json outputs: cleanups

Clean up header files and improve memory handling.

11 years agojansson file log: make file log module
Victor Julien [Thu, 30 Jan 2014 11:26:01 +0000 (12:26 +0100)] 
jansson file log: make file log module

Turn the libjansson based file logger into a file module, as a child
of eve-log.

11 years agotls json: turn into packet logger
Victor Julien [Thu, 30 Jan 2014 10:45:30 +0000 (11:45 +0100)] 
tls json: turn into packet logger

Like log-tls, turn the json tls logger into a packet logger as the
protocol parser is not tx aware.

Make it a child of eve-log as well.

11 years agooutput: simple name space support for sub modules
Victor Julien [Thu, 30 Jan 2014 09:59:51 +0000 (10:59 +0100)] 
output: simple name space support for sub modules

To avoid module name clashes, a submode abc of parent xyz, will now
register itself as xyz.abc.

11 years agodrop-json: make child of eve-log
Victor Julien [Thu, 30 Jan 2014 09:50:38 +0000 (10:50 +0100)] 
drop-json: make child of eve-log

Make drop json child of eve-log.

11 years agojson drop log: move into packet module
Victor Julien [Thu, 30 Jan 2014 09:15:59 +0000 (10:15 +0100)] 
json drop log: move into packet module

Move JSON drop log into a full packet module.

11 years agolog api: use AppProto instead of uint16_t
Victor Julien [Thu, 30 Jan 2014 08:18:12 +0000 (09:18 +0100)] 
log api: use AppProto instead of uint16_t

11 years agolog api: convert all names to const
Victor Julien [Thu, 30 Jan 2014 08:14:59 +0000 (09:14 +0100)] 
log api: convert all names to const

Instead of strdupping all names w/o a need, use const ptrs.

11 years agoalert json: make child of eve-log
Victor Julien [Wed, 29 Jan 2014 18:42:46 +0000 (19:42 +0100)] 
alert json: make child of eve-log

Enable alert json for eve-log by registering the module as a sub-
module of eve-log.

11 years agoalert-json: make full module out of json alert
Victor Julien [Wed, 29 Jan 2014 17:50:32 +0000 (18:50 +0100)] 
alert-json: make full module out of json alert

Make a full module out of the json alert code in output-json-alert.[ch].

11 years agooutput: sub-module support for other log api's
Victor Julien [Wed, 29 Jan 2014 17:19:27 +0000 (18:19 +0100)] 
output: sub-module support for other log api's

Packets:
void OutputRegisterPacketSubModule(const char *parent_name, char *name, char *conf_name,
    OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
    PacketLogger LogFunc, PacketLogCondition ConditionFunc);

Files:
void OutputRegisterFileSubModule(const char *parent_name, char *name, char *conf_name,
    OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *), FileLogger FileLogFunc);

Filedata:
void OutputRegisterFiledataSubModule(const char *parent_name, char *name, char *conf_name,
    OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *), FiledataLogger FiledataLogFunc);

11 years agooutput: introduce concept of sub-modules
Victor Julien [Wed, 29 Jan 2014 16:38:04 +0000 (17:38 +0100)] 
output: introduce concept of sub-modules

To support the 'eve-log' idea, we need to be able to force all log
modules to be enabled by the master eve-log module, and need to be
able to make all logs go into a single file. This didn't fit the
API so far, so added the sub-module concept.

A sub-module is a regular module, that registers itself as a sub-
module of another module:

    OutputRegisterTxSubModule("eve-log", "JsonHttpLog", "http",
            OutputHttpLogInitSub, ALPROTO_HTTP, JsonHttpLogger);

The first argument is the name of the parent. The 4th argument is
the OutputCtx init function. It differs slightly from the non-sub
one. The different is that in addition to it's ConfNode, it gets
the OutputCtx from the parent. This way it can set the parents
LogFileCtx in it's own OutputCtx.

The runmode setup code will take care of all the extra setup. It's
possible to register a module both as a normal module and as a sub-
module, which can operate at the same time.

Only the TxLogger API is handled in this patch, the rest will be
updated later.

11 years agodns-json: turn logger to tx api
Victor Julien [Wed, 29 Jan 2014 14:29:15 +0000 (15:29 +0100)] 
dns-json: turn logger to tx api

Convert Json DNS logger into a Tx Logger API logger.

11 years agohttp-json: separate module using tx api
Victor Julien [Wed, 29 Jan 2014 13:36:22 +0000 (14:36 +0100)] 
http-json: separate module using tx api

Turn HTTP json logger into a Tx Logger API logger.

11 years agoVarious compile fixes after rebase with master
Victor Julien [Wed, 29 Jan 2014 10:32:10 +0000 (11:32 +0100)] 
Various compile fixes after rebase with master

11 years agojson: rebase fixes
Tom DeCanio [Fri, 17 Jan 2014 00:18:54 +0000 (16:18 -0800)] 
json: rebase fixes

- restore json output-file.[ch] as output-json-file.[ch] after rebase conflict
- fix Makefile.am after merge conflict
- some dev-log-api-v4.0 rebase json fallout cleanup

11 years agoRemaining JSON output pull request comment edits
Tom DeCanio [Tue, 19 Nov 2013 20:58:47 +0000 (12:58 -0800)] 
Remaining JSON output pull request comment edits

11 years agoaddress most initial JSON pull request comments
Tom DeCanio [Mon, 18 Nov 2013 22:36:52 +0000 (14:36 -0800)] 
address most initial JSON pull request comments

11 years agoadd "united" drop JSON log
Tom DeCanio [Thu, 14 Nov 2013 03:33:00 +0000 (19:33 -0800)] 
add "united" drop JSON log

11 years agoAdd "united" JSON files output
Tom DeCanio [Wed, 13 Nov 2013 19:17:03 +0000 (11:17 -0800)] 
Add "united" JSON files output

11 years agoFirst cut at "united" file log output in JSON
Tom DeCanio [Wed, 13 Nov 2013 06:43:19 +0000 (22:43 -0800)] 
First cut at "united" file log output in JSON

11 years agoJSON output cleanup
Tom DeCanio [Wed, 13 Nov 2013 02:48:37 +0000 (18:48 -0800)] 
JSON output cleanup

11 years agoremove unused http JSON code
Tom DeCanio [Wed, 13 Nov 2013 02:13:43 +0000 (18:13 -0800)] 
remove unused http JSON code

11 years agomore output JSON cleanup
Tom DeCanio [Wed, 13 Nov 2013 02:09:01 +0000 (18:09 -0800)] 
more output JSON cleanup

11 years agoremove dead JSON DNS output code
Tom DeCanio [Wed, 13 Nov 2013 01:45:56 +0000 (17:45 -0800)] 
remove dead JSON DNS output code

11 years agoJSON output cleanup
Tom DeCanio [Wed, 13 Nov 2013 01:43:00 +0000 (17:43 -0800)] 
JSON output cleanup

11 years agorename alert-json.[ch] output-json.[ch]
Tom DeCanio [Wed, 13 Nov 2013 01:28:16 +0000 (17:28 -0800)] 
rename alert-json.[ch] output-json.[ch]

11 years agofix compile errors w/o libjansson
Tom DeCanio [Wed, 13 Nov 2013 00:56:48 +0000 (16:56 -0800)] 
fix compile errors w/o libjansson

11 years agoremove unused JSON TMM_*JSON enumerations
Tom DeCanio [Tue, 12 Nov 2013 23:41:50 +0000 (15:41 -0800)] 
remove unused JSON TMM_*JSON enumerations

11 years agoAdd support for JSON output to syslog/unix_stream/unix_dgram
Tom DeCanio [Fri, 8 Nov 2013 19:39:49 +0000 (11:39 -0800)] 
Add support for JSON output to syslog/unix_stream/unix_dgram

11 years agoAdd "united" log to suricata.yaml.in
Tom DeCanio [Fri, 8 Nov 2013 19:27:52 +0000 (11:27 -0800)] 
Add "united" log to suricata.yaml.in

11 years agoJSON output cleanup
Tom DeCanio [Fri, 8 Nov 2013 19:24:18 +0000 (11:24 -0800)] 
JSON output cleanup

11 years agoadd united TLS JSON logging
Tom DeCanio [Wed, 6 Nov 2013 23:12:43 +0000 (15:12 -0800)] 
add united TLS JSON logging

11 years agoadd ICMP type and code support to JSON log
Tom DeCanio [Wed, 6 Nov 2013 02:45:11 +0000 (18:45 -0800)] 
add ICMP type and code support to JSON log

11 years agoSupport for configuration of JSON http output module
Tom DeCanio [Tue, 5 Nov 2013 22:48:39 +0000 (14:48 -0800)] 
Support for configuration of JSON http output module

11 years agoAdd vlan and pcap_cnt to JSON logs
Tom DeCanio [Tue, 5 Nov 2013 17:50:47 +0000 (09:50 -0800)] 
Add vlan and pcap_cnt to JSON logs

11 years agoFirst cut at united .yaml configuration
Tom DeCanio [Tue, 5 Nov 2013 04:33:51 +0000 (20:33 -0800)] 
First cut at united .yaml configuration

11 years agobeginning of JSON config alignment
Tom DeCanio [Mon, 4 Nov 2013 20:54:36 +0000 (12:54 -0800)] 
beginning of JSON config alignment

11 years agomove some JSON alert work outside of lock
Tom DeCanio [Mon, 4 Nov 2013 19:57:03 +0000 (11:57 -0800)] 
move some JSON alert work outside of lock

11 years agoJSON cleanup
Tom DeCanio [Mon, 4 Nov 2013 19:41:56 +0000 (11:41 -0800)] 
JSON cleanup

11 years agoAlert/HTTP/DNS JSON output working with Logstash
Tom DeCanio [Mon, 4 Nov 2013 16:22:51 +0000 (08:22 -0800)] 
Alert/HTTP/DNS JSON output working with Logstash

11 years agonested json alert output
Tom DeCanio [Sun, 27 Oct 2013 09:23:59 +0000 (02:23 -0700)] 
nested json alert output

11 years agocleanup fallout from upstream merge with alert json work
Tom DeCanio [Tue, 22 Oct 2013 11:52:39 +0000 (04:52 -0700)] 
cleanup fallout from upstream merge with alert json work

11 years agoChange JSON alert syslog level to INFO
Tom DeCanio [Tue, 25 Jun 2013 19:40:16 +0000 (12:40 -0700)] 
Change JSON alert syslog level to INFO

11 years agofix NULL string into JSON in alert-json
Tom DeCanio [Wed, 12 Jun 2013 18:04:11 +0000 (11:04 -0700)] 
fix NULL string into JSON in alert-json

11 years agochange srcport->sp dstport->dp
Tom DeCanio [Wed, 5 Jun 2013 16:25:06 +0000 (09:25 -0700)] 
change srcport->sp dstport->dp

11 years agoAdd JSON formatted alert output
Tom DeCanio [Thu, 30 May 2013 21:04:34 +0000 (14:04 -0700)] 
Add JSON formatted alert output

11 years agostream: add performance output for stream pools
Victor Julien [Tue, 28 Jan 2014 22:00:28 +0000 (23:00 +0100)] 
stream: add performance output for stream pools

Add info messages at shutdown that give an indication of pool use
for the various segment and chunk pools.

11 years agostream: configurable stream chunk prealloc 801/head
Victor Julien [Tue, 28 Jan 2014 16:13:05 +0000 (17:13 +0100)] 
stream: configurable stream chunk prealloc

The stream chunk pool contains preallocating stream chunks (StreamMsg).
These are used for raw reassembly, used in raw content inspection by
the detection engine. The default setting so far has been 250, which
was hardcoded. This meant that in setups that needed more, allocs and
frees would be happen constantly.

This patch introduces a yaml option to set the 'prealloc' value in the
pool. The default is still 250.

stream.reassembly.chunk-prealloc

Related to feature #1093.

11 years agostream: silence stream.reassembly.raw message
Victor Julien [Tue, 28 Jan 2014 16:12:38 +0000 (17:12 +0100)] 
stream: silence stream.reassembly.raw message

11 years agostream: configurable segment pools
Victor Julien [Tue, 28 Jan 2014 12:48:26 +0000 (13:48 +0100)] 
stream: configurable segment pools

The stream reassembly engine uses a set of pools in which preallocated
segments are stored. There are various pools each with different packet
sizes. The goal is to lower memory presure. Until now, these pools were
hardcoded.

This patch introduces the ability to configure them fully from the yaml.
There can be at max 256 of these pools.

Yaml layout is as follows:

stream:
  reassemble:
    segments:
      - size: 2048
        prealloc: 3000
      - size: 4
        prealloc: 1000
      - size: 1024
        prealloc: 2000

The size is the packet size. The prealloc value indicates how many
segments are set up at startup.

The pools have no limit wrt how many segments can be used of a certain
size. If the engine needs more than the prealloc size, segments are
malloc'd and free'd. The only limit here is the stream.reassemble.memcap.

If the yaml part if omitted, the default values are the same as before.

Feature #1093

11 years agolog-filestore: convert to FiledataLog API 797/head
Victor Julien [Thu, 16 Jan 2014 14:23:03 +0000 (15:23 +0100)] 
log-filestore: convert to FiledataLog API

This patch converts the log-filestore module to use the new
FiledataLog API.

11 years agoIntroduce Filedata Logger API
Victor Julien [Thu, 16 Jan 2014 14:20:09 +0000 (15:20 +0100)] 
Introduce Filedata Logger API

A new logger API for registering file storage handlers. Where the
FileLog handler is called once per file, this handler will be called
for each data chunk so that storing the entire file is possible.

The logger call in the API is as follows:
    typedef int (*FiledataLogger)(ThreadVars *, void *thread_data,
        const Packet *, const File *, const FileData *, uint8_t flags);

All data is const, thus should be read only. The final flags field
is used to indicate to the caller that the file is new, or if it's
being closed.

Files use an internal unique id 'file_id' which can be used by the
loggers to create unique file names. This id can use the 'waldo'
feature of the log-filestore module. This patch moves that waldo
loading and storing logic to this API's implementation. A new
configuration directive 'file-store-waldo: <filename>' is added,
but the existing waldo settings will also continue to work.

11 years agolog-filestore: cleanups
Victor Julien [Wed, 15 Jan 2014 15:24:25 +0000 (16:24 +0100)] 
log-filestore: cleanups

Remove unused code.
Make functions static.
Move registration to the bottom.

11 years agolog-filestore: tag truncated files as such
Victor Julien [Wed, 15 Jan 2014 15:17:15 +0000 (16:17 +0100)] 
log-filestore: tag truncated files as such

Tag truncated files as truncated in the same way log-file does.

11 years agotx-logger: speed up
Victor Julien [Wed, 15 Jan 2014 13:25:32 +0000 (14:25 +0100)] 
tx-logger: speed up

By bailing out early in case no logger is enabled for the protocol,
a significant speed up is reached.

11 years agoapp-layer: add logger check to API
Victor Julien [Wed, 15 Jan 2014 13:23:16 +0000 (14:23 +0100)] 
app-layer: add logger check to API

The new API call:
    int AppLayerParserProtocolHasLogger(uint8_t ipproto,
                                        AppProto alproto)

Returns TRUE if a logger is registered on the ip/alproto pair, and
FALSE otherwise.

11 years agoprofiling: add logger api labels
Victor Julien [Wed, 15 Jan 2014 13:14:01 +0000 (14:14 +0100)] 
profiling: add logger api labels

11 years agolog-file: convert to file-logger API
Victor Julien [Wed, 15 Jan 2014 12:28:43 +0000 (13:28 +0100)] 
log-file: convert to file-logger API

Use file logger API.

Also, check if the protocol is HTTP before getting the HTTP
fields.

11 years agoIntroduce 'file' logging API
Victor Julien [Wed, 15 Jan 2014 12:22:47 +0000 (13:22 +0100)] 
Introduce 'file' logging API

This patch introduces a new logging API for logging extracted file info.
It allows for registration of a callback that is called once per file:
when it's considered 'closed'.

Users of this API register their Log Function through:
    OutputRegisterFileModule()

The API uses a magic settings globally. This might be changed later.

11 years agolog-file: cleanups
Victor Julien [Wed, 15 Jan 2014 09:59:15 +0000 (10:59 +0100)] 
log-file: cleanups

Make all functions static.
Move registration to the bottom.

11 years agoprelude: convert to packet logger API
Victor Julien [Tue, 14 Jan 2014 16:14:27 +0000 (17:14 +0100)] 
prelude: convert to packet logger API

Convert prelude logger to use the packet logger API.

11 years agoprelude: fix configure and cleanup
Victor Julien [Tue, 14 Jan 2014 16:02:33 +0000 (17:02 +0100)] 
prelude: fix configure and cleanup

Fixes configure enabling of prelude. CFLAGS is reset, so the previous
adding of -DPRELUDE was nixed. Using AC_DEFINE now.

Cleanups:
- make functions static
- simplify handling of no prelude support
- move registration to the bottom