Commit Graph

38 Commits (7bec54158fc09a772457c52448cfc4fc6cc743f6)

Author SHA1 Message Date
Jason Ish 790ce3743b eve: flow: global metadata config 7 years ago
Jason Ish 00e6cd4ced output: introduce init return type
The new OutputInitResult is a struct return type that allows
logger init functions to return a NULL context without
raising error.

Instead of returning NULL to signal error, the "ok" field will
be set to false. If ok, but the ctx is NULL, then silently
move on to the next logger.

Use case: multiple versions of a specific logger, and one
implementation decides the configuration is not for that
implemenation. It can return NULL, ok.
7 years ago
Jason Ish 1587772b90 eve.flow: removed unused http parameters 7 years ago
Jason Ish ecf9eda340 eve.flow: remove "hi" log message 7 years ago
Eric Leblond da9005c404 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.
8 years ago
Victor Julien 9c071d1724 eve.flow: log original and expected app_protocols
Log protocols if they are available.
8 years ago
Victor Julien ab1200fbd7 compiler: more strict compiler warnings
Set flags by default:

    -Wmissing-prototypes
    -Wmissing-declarations
    -Wstrict-prototypes
    -Wwrite-strings
    -Wcast-align
    -Wbad-function-cast
    -Wformat-security
    -Wno-format-nonliteral
    -Wmissing-format-attribute
    -funsigned-char

Fix minor compiler warnings for these new flags on gcc and clang.
8 years ago
Mats Klepsland a2659ed7ec output-json-flow: add has_alerts field
Add has_alerts field to flow eve-log to indicate if a flow has
any alerts or not.
8 years ago
Victor Julien d893bc55e0 eve-flow: fix -Wshadow warning 8 years ago
Victor Julien c28d9d0538 eve: print app_proto_ts/app_proto_tc 9 years ago
Jason Ish 3fab684f97 logging: don't log that json is disabled in each logger
A warning log is already emitted if eve-log is enabled in the
configuration but json support is not built so the logger
registration functions can be silent.
9 years ago
Eric Leblond 3ca663d7ff 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.
9 years ago
Eric Leblond 745dad9809 flow: display info about bypass in log 9 years ago
Jason Ish 1b4ba4496c logging: rename registration functions to not have tmm
As the logging modules are no longer threading modules, rename
them so they don't look like they are being registered as
threading modules.

Also, move the registration to the output.c which will handle
registration of the loggers.
9 years ago
Jason Ish fa27a76462 logging: add profiling back for non-tmm loggers
The loggers moved away from a TMM required a new
profiling support.
9 years ago
Jason Ish 983a619ff0 logging: convert json flow output to non-thread module 9 years ago
maxtors 06d74b5775 Module specific error code for init ctx error. 9 years ago
maxtors 69863f7b1c Corrected and unified debugmessages for init data errors in *ThreadInit. 9 years ago
Victor Julien 8394b38941 cppcheck: work around snprintf warning
Cppcheck 1.72 gives a warning on the following code pattern:

    char blah[32] = "";
    snprintf(blah, sizeof(blah), "something");

The warning is:

    (error) Buffer is accessed out of bounds.

While this appears to be a FP, in most cases the initialization to ""
was unnecessary as the snprintf statement immediately follows the
variable declaration.
9 years ago
Victor Julien c446abeb47 jansson: include in suricata-common.h 9 years ago
Victor Julien 8bb1cf08ef eve: fix mishandling of big messages
When the string representation of a JSON message grew bigger than
64k, the JSON record would just be truncated. This lead to errors
in the parser(s) of the JSON stream.

This patch changes the buffer logic to grow the buffer on demand.
9 years ago
Eric Leblond 538f37bd38 output-json: add app_proto key in root
By adding the key in the root of *flow and fileinfo  events it
will be possible to get all events for one application layer by
using a 'event_type:proto OR app_proto:proto' filter. This will
permit to the analyst to get a good view of events related to
one protocol.

This patch also fixes a regression in file logging where app_proto
was available before 94dbd303e4 create
the regression.
9 years ago
Jason Ish b512580bbe logging: integrate rotation into SCConfLogOpenGeneric.
Addresses issue 1492, and will make it harder to omit
rotation on new outputs.
10 years ago
Eric Leblond 39d667ff56 output-json: fix type of data parameter
The cast of data to AlertJsonThread was not correct as the real
type of the void pointer is a OutputJsonCtx. This was working by
luck because they both have a file_ctx as first element.
10 years ago
Victor Julien 4816dcc3d3 flow json log: add 'shutdown' as flow end reason
When engine shuts down all flows in the hash are logged out. They
may not have timed out yet. So they are forced. Log the reason to
be 'shutdown'.
11 years ago
Ken Steele 8f1d75039a Enforce function coding standard
Functions should be defined as:

int foo(void)
{
}

Rather than:
int food(void) {
}

All functions where changed by a script to match this standard.
11 years ago
Victor Julien f1185d051c flow id: quick and dirty first stab at a flow id
Add a 'flow_id' that is the same for all records produced for packets
belonging to the same flow.

This patch simply takes the flow's memory address.
11 years ago
Victor Julien 9f55ca0057 flow: add flow_end_flags field, add logging
The flow end flags field is filled by the flow manager or the flow
hash (in case of forced timeout of a flow) to record the timeout
conditions in the flow:
- emergency mode
- state
- reason (timed out or forced)

Add logging to the flow logger.
11 years ago
Victor Julien e6ed6731b1 flow log: log TCP state
Log the TCP state at timeout.
11 years ago
Victor Julien 6f9a2fcd58 flow: log individual tcp flags
Log the tcp flags.
11 years ago
Victor Julien 07b7f66f3c flow-log: log TCP flags per direction
In addition to flags for the entire session, also log out TCP flags
for both directions separately.
11 years ago
Victor Julien bd490736c2 flow: take flow pkt & byte count out of debug
Until now the flow packet and byte counters were only available in
DEBUG mode. For logging purposes they are now available always.
11 years ago
Victor Julien 7acea2c66d flow: track lastts in struct timeval
Track full timestamp for lastts in flows to be able to log it.
11 years ago
Victor Julien c66a29b67d flow: track bytes per direction
Track bytes in both flow directions for logging purposes.
11 years ago
Victor Julien f828793f8f flow log: log start/end times
Log time of first packet (flow creation) and of the last packet.
11 years ago
Victor Julien 672f6523a7 flow-log: log TCP flags seen
Log TCP flags seen during the life time of a flow/session.
11 years ago
Victor Julien ec7d446f16 flow-log: log pkts, bytes
Only in DEBUG currently.
11 years ago
Victor Julien 3c7af02067 flow-json-log: stub
Stub for JSON flow logger.
11 years ago