]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Fri, 15 Aug 2014 12:04:44 +0000 (14:04 +0200)]
lua: export packet keywords to detect scripts
Set packet pointer, so it's available to the lua keywords that
require it.
Victor Julien [Thu, 14 Aug 2014 14:37:37 +0000 (16:37 +0200)]
detect-lua: register all 'output' keywords as well
Register all keywords available to output scripts to the detect
scripts as well.
Victor Julien [Thu, 14 Aug 2014 14:33:37 +0000 (16:33 +0200)]
detect-lua: set tx ptr
Set tx ptr so it can be used later by other keywords.
Victor Julien [Thu, 14 Aug 2014 14:21:38 +0000 (16:21 +0200)]
detect: track current tx_id in det_ctx
When using the inspection engines, track the current tx_id in the
thread storage the detect thread uses. As 0 is a valid tx_id, add
a simple bool that indicates if the tx_id field is set.
Victor Julien [Tue, 5 Aug 2014 07:58:48 +0000 (09:58 +0200)]
lua: move lua output code to generic lua file
So that other Lua scripts (detect) can also start using it.
Victor Julien [Tue, 5 Aug 2014 07:26:59 +0000 (09:26 +0200)]
lua: remove LogLua prefix and replace it with Lua
Preparing making code available to more than just output.
Victor Julien [Mon, 4 Aug 2014 15:47:47 +0000 (17:47 +0200)]
lua: move output http funcs to generic util file
Move output Http functions to util-lua-http.c so that detect can use
it later.
Victor Julien [Fri, 1 Aug 2014 14:29:53 +0000 (16:29 +0200)]
Rename Lua code to just Lua
As we support regular Lua as well as LuaJIT, it makes more sense to call
it all Lua.
Victor Julien [Fri, 1 Aug 2014 13:34:37 +0000 (15:34 +0200)]
lua: use LuaPushStringBuffer in more places
Replace existing workarounds with LuaPushStringBuffer
Victor Julien [Fri, 1 Aug 2014 10:41:17 +0000 (12:41 +0200)]
lua: LuaPushStringBuffer optimization
Only use a temp buffer when really necessary, which is when the
buffer size is not a multiple of 4.
Victor Julien [Fri, 1 Aug 2014 10:32:38 +0000 (12:32 +0200)]
lua: move LuaPushStringBuffer to the generic util-lua.c
Victor Julien [Fri, 1 Aug 2014 10:29:17 +0000 (12:29 +0200)]
lua: rename LuaReturnStringBuffer to LuaPushStringBuffer
LuaPushStringBuffer is a wrapper for lua_pushlstring, so the new name
better reflects it's function.
Victor Julien [Thu, 31 Jul 2014 16:02:40 +0000 (18:02 +0200)]
output-lua: add SCFlowStats
SCFlowStats gets the packet and byte counts per flow:
tscnt, tsbytes, tccnt, tcbytes = SCFlowStats()
Victor Julien [Tue, 29 Jul 2014 15:36:42 +0000 (17:36 +0200)]
output lua: expose flow logging api
Allow use of the Flow Logging API through Lua scripts.
Minimal script:
function init (args)
local needs = {}
needs["type"] = "flow"
return needs
end
function setup (args)
end
function log(args)
startts = SCFlowTimeString()
ipver, srcip, dstip, proto, sp, dp = SCFlowTuple()
print ("Flow IPv" .. ipver .. " src " .. srcip .. " dst " .. dstip ..
" proto " .. proto .. " sp " .. sp .. " dp " .. dp)
end
function deinit (args)
end
Victor Julien [Wed, 25 Jun 2014 13:25:53 +0000 (15:25 +0200)]
lua-output: add SCStreamingBuffer
Add SCStreamingBuffer lua function to retrieve the data passed
to the script per streaming API invocation.
Example:
function log(args)
data = SCStreamingBuffer()
hex_dump(data)
end
Victor Julien [Tue, 24 Jun 2014 20:40:33 +0000 (22:40 +0200)]
output-lua: add support for streaming api
Add support to lua output for the streaming api. This allows for a
script to subscribe itself to streaming tcp data and http body data.
Victor Julien [Wed, 2 Apr 2014 22:09:57 +0000 (00:09 +0200)]
output-lua: give access to packet payload
Add SCPacketPayload()
Example:
function log(args)
p = SCPacketPayload()
print(p)
end
Victor Julien [Mon, 31 Mar 2014 13:05:15 +0000 (15:05 +0200)]
output-lua: expose http body data
Make normalized body data available to the script through
HttpGetRequestBody and HttpGetResponseBody.
There no guarantees that all of the body will be availble.
Example:
function log(args)
a, o, e = HttpGetResponseBody();
--print("offset " .. o .. " end " .. e)
for n, v in ipairs(a) do
print(v)
end
end
Victor Julien [Fri, 28 Mar 2014 16:24:22 +0000 (17:24 +0100)]
output-lua: add HttpGetRequestHost callback
Get the host from libhtp's tx->request_hostname, which can either be
the host portion of the url or the host portion of the Host header.
Example:
http_host = HttpGetRequestHost()
if http_host == nil then
http_host = "<hostname unknown>"
end
Victor Julien [Fri, 21 Mar 2014 21:26:28 +0000 (22:26 +0100)]
output-lua: http alproto check
Victor Julien [Fri, 21 Mar 2014 21:26:37 +0000 (22:26 +0100)]
output-lua: clean up flow lock handling
Victor Julien [Fri, 21 Mar 2014 13:25:04 +0000 (14:25 +0100)]
output-lua: alproto string callback
SCFlowAppLayerProto: get alproto as string from the flow. If alproto
is not (yet) known, it returns "unknown".
function log(args)
alproto = SCFlowAppLayerProto()
if alproto ~= nil then
print (alproto)
end
end
Victor Julien [Fri, 21 Mar 2014 08:40:54 +0000 (09:40 +0100)]
output-lua: expose thread info
A new callback to give access to thread id, name and group name:
SCThreadInfo. It gives: tid (integer), tname (string), tgroup (string)
function log(args)
tid, tname, tgroup = SCThreadInfo()
Victor Julien [Wed, 19 Mar 2014 17:38:29 +0000 (18:38 +0100)]
output-lua: expose flow start time string
SCFlowTimeString: returns string form of start time of a flow
Example:
function log(args)
startts = SCFlowTimeString()
ts = SCPacketTimeString()
if ts == startts then
print("new flow")
end
Victor Julien [Wed, 19 Mar 2014 15:13:38 +0000 (16:13 +0100)]
output-lua: add file callbacks
SCFileInfo: returns fileid (number), txid (number), name (string),
size (number), magic (string), md5 in hex (string)
Example:
function log(args)
fileid, txid, name, size, magic, md5 = SCFileInfo()
SCFileState: returns state (string), stored (bool)
Example:
function log(args)
state, stored = SCFileState()
Victor Julien [Wed, 19 Mar 2014 11:36:01 +0000 (12:36 +0100)]
output-lua: add SCPacketTimeString
Add SCPacketTimeString to get the packets time string in the format:
11/24/2009-18:57:25.179869
Example use:
function log(args)
ts = SCPacketTimeString()
Victor Julien [Mon, 17 Mar 2014 17:44:09 +0000 (18:44 +0100)]
output-lua: rule info callback
SCRuleIds(): returns sid, rev, gid:
function log(args)
sid, rev, gid = SCRuleIds()
SCRuleMsg(): returns msg
function log(args)
msg = SCRuleMsg()
SCRuleClass(): returns class msg and prio:
function log(args)
class, prio = SCRuleClass()
if class == nil then
class = "unknown"
end
Victor Julien [Fri, 14 Mar 2014 13:16:47 +0000 (14:16 +0100)]
lua: add SCFlowTuple lua function
Like SCPacketTuple, only retrieves Tuple from the flow.
Minimal log function:
function log(args)
ipver, srcip, dstip, proto, sp, dp = SCFlowTuple()
print ("Flow IPv" .. ipver .. " src " .. srcip .. " dst " .. dstip ..
" proto " .. proto .. " sp " .. sp .. " dp " .. dp)
end
Victor Julien [Mon, 3 Mar 2014 13:11:00 +0000 (14:11 +0100)]
detect-lua: convert extensions to use flow wrappers
Use the new flow wrapper functions in the lua flowvar and flowint
extensions.
Victor Julien [Mon, 3 Mar 2014 13:09:18 +0000 (14:09 +0100)]
lua: add flow store and retrieval wrappers
Add flow store and retrieval wrappers for accessing the flow through
Lua's lightuserdata method.
The flow functions store/retrieve a lock hint as well.
Victor Julien [Fri, 28 Feb 2014 15:18:48 +0000 (16:18 +0100)]
lua: introduce util-lua.[ch]
Shared functions for all lua parts of the engine.
Victor Julien [Mon, 24 Feb 2014 16:08:44 +0000 (17:08 +0100)]
output-lua: add all packets logging support
If the script needing a packet doesn't specify a filter, it will
be run against all packets. This patch adds the support for this
mode. It is a packet logger with a condition function that always
returns true.
Victor Julien [Mon, 24 Feb 2014 15:41:27 +0000 (16:41 +0100)]
output-lua: improve error checking for init()
If init doesn't properly init the script, skip the script and error
out.
Victor Julien [Fri, 21 Feb 2014 11:20:46 +0000 (12:20 +0100)]
output-log: expose SCLog functions to lua scripts
The lua scripts can use SCLogDebug, SCLogInfo, SCLogNotice, SCLogWarning,
SCLogError. The latter 2 won't be able to add an error code though.
Victor Julien [Fri, 21 Feb 2014 09:17:16 +0000 (10:17 +0100)]
output-lua: make packet ptr available to all scripts
TxLogger and Packet logger need it to be able to use the Tuple
callback.
Victor Julien [Fri, 21 Feb 2014 08:37:39 +0000 (09:37 +0100)]
output-lua: add SCLogPath callback
Add a lua callback for getting Suricata's log path, so that lua scripts
can easily get the logging directory Suricata uses.
Update the Setup logic to register callbacks before the scripts 'setup'
is called.
Example:
name = "fast_lua.log"
function setup (args)
filename = SCLogPath() .. "/" .. name
file = assert(io.open(filename, "a"))
end
Victor Julien [Fri, 21 Feb 2014 08:00:42 +0000 (09:00 +0100)]
output-lua: TxLogger use proper stack function
Use proper wrapper to setup the stack.
Victor Julien [Thu, 20 Feb 2014 16:58:15 +0000 (17:58 +0100)]
output-lua: improve error handling and documentation
Better document the various functions and improve error handling.
Victor Julien [Thu, 20 Feb 2014 16:55:15 +0000 (17:55 +0100)]
output-lua: register common callbacks
Clean up callback registration in the setup-stage and register
common callbacks.
Victor Julien [Thu, 20 Feb 2014 16:51:47 +0000 (17:51 +0100)]
output-lua: support File logging
Add file logger support. The script uses:
function init (args)
local needs = {}
needs['type'] = 'file'
return needs
end
The type is set to file to make it a file logger.
Victor Julien [Thu, 20 Feb 2014 16:49:51 +0000 (17:49 +0100)]
output-lua: rename LuaPacketLogger to ..Alerts
As the script is called for each alert, not for each packet, name
the script LuaPacketLoggerAlerts.
Victor Julien [Thu, 20 Feb 2014 14:57:00 +0000 (15:57 +0100)]
output-lua: add stack utility functions
Add utility functions for placing things on the stack for use
by the scripts. Functions for numbers, strings and byte arrays.
Add callback for returing IP header info: ip version, src ip,
dst ip, proto, sp, dp (or type and code for icmp and icmpv6):
SCPacketTuple
Victor Julien [Thu, 20 Feb 2014 14:47:50 +0000 (15:47 +0100)]
output-lua: initial packet support
Add key for storing packet pointer in the lua stack and a utility
function to retrieve it from lua callbacks.
Victor Julien [Thu, 20 Feb 2014 14:45:33 +0000 (15:45 +0100)]
output-lua: move LuaPrintStack to common
It's a utility function that will be used in several other places
as well.
Victor Julien [Thu, 20 Feb 2014 08:39:24 +0000 (09:39 +0100)]
output-lua: add example packet log script
Example packet log script that outputs to stdout in the alert-
fast log format.
Victor Julien [Thu, 20 Feb 2014 08:36:16 +0000 (09:36 +0100)]
output-lua: packet logger support
Through 'needs' the script init function can indicate it wants to
see packets and select a condition function. Currently only alerts
is an option:
function init (args)
local needs = {}
needs["type"] = "packet"
needs["filter"] = "alerts"
return needs
end
Victor Julien [Wed, 19 Feb 2014 12:49:35 +0000 (13:49 +0100)]
output-lua: new file for common functions
Add output-lua-common.[ch] to store functions common to various parts
of the lua output framework.
Victor Julien [Tue, 11 Feb 2014 13:44:21 +0000 (14:44 +0100)]
output: Lua HTTP log initial implementation
Initial version of a HTTP LUA logger. Execute lua scripts from the
Tx-log API.
Victor Julien [Wed, 19 Feb 2014 11:52:03 +0000 (12:52 +0100)]
output-lua: support submodules
Use the OutputCtx::submodules list to register additional log modules.
Currently this is hardcoded to the 'lua' module.
Victor Julien [Wed, 19 Feb 2014 11:50:57 +0000 (12:50 +0100)]
output-lua: display warning if no lua support
Display a warning that the lua module is not available if we're
not compiled against lua(jit).
Victor Julien [Wed, 19 Feb 2014 11:46:50 +0000 (12:46 +0100)]
output: add submodules list to OutputCtx
Add a list to the OutputCtx that can contain OutputModule structures.
This will be used by a 'parent' module to register submodules directly.
Victor Julien [Wed, 18 Jun 2014 10:15:58 +0000 (12:15 +0200)]
streaming: pass tx_id to logger
This way we can distinguish between various tx' in the logger.
Victor Julien [Tue, 17 Jun 2014 15:49:05 +0000 (17:49 +0200)]
streaming-loggers: add configuration
Add a (disabled by default) config to the yaml
Victor Julien [Fri, 13 Jun 2014 10:05:33 +0000 (12:05 +0200)]
tcp-data-log: file and dir logging modes
Add a file logging mode, which logs all the data into a single log file.
Also, make the directory logging more configurable.
Victor Julien [Sat, 5 Apr 2014 08:02:38 +0000 (10:02 +0200)]
tcp-data: new streaming logger
tcp-data logs out reassembled stream data in a streaming fashion.
Records type to log into different directories.
Victor Julien [Thu, 12 Jun 2014 09:42:00 +0000 (11:42 +0200)]
streaming logger: support Http Body logging
Add an argument to the registration to indicate which iterator
needs to be used: Stream or HttpBody
Add HttpBody Iterator, calling the logger(s) for each Http body chunk.
Victor Julien [Sat, 5 Apr 2014 08:00:27 +0000 (10:00 +0200)]
output-streaming: StreamIterator
StreamIterator implementation for iterating over ACKed segments.
Flag each segment as logged when the log function has been called for it.
Set a 'OPEN' flag for the first segment in both directions.
Set a 'CLOSE' flag when the stream ends. If the last segment was already
logged, a empty CLOSE call is performed with NULL data.
Victor Julien [Fri, 4 Apr 2014 10:51:26 +0000 (12:51 +0200)]
output-streaming: a Log API for streaming data
This patch adds a new Log API for streaming data such as TCP reassembled
data and HTTP body data. It could also replace Filedata API.
Each time a new chunk of data is available, the callback will be called.
Ken Steele [Tue, 12 Aug 2014 23:57:41 +0000 (19:57 -0400)]
Fix compiler warning about uninitialized variable in mpipe.
Duarte Silva [Tue, 12 Aug 2014 17:13:52 +0000 (18:13 +0100)]
Simple code fixes
- Removed unnecessary assignment of the data field
- Removed else condition (same function called for IPv4 and IPV6)
- Fixed constants to be a power of two (used in bitwise operations)
Victor Julien [Wed, 13 Aug 2014 14:33:50 +0000 (16:33 +0200)]
Optimize Packet Ext data freeing
Move the logic of PacketFreeExtData into a macro 'PACKET_FREE_EXTDATA'.
It was called for each packet.
Eric Leblond [Wed, 13 Aug 2014 08:48:26 +0000 (10:48 +0200)]
packet pool: fix ext_pkt cleaning
The field ext_pkt was cleaned before calling the release function.
The result was that IPS mode such as the one of AF_PACKET were not
working anymore because they were not able to send the data which
were initially pointed by ext_pkt.
This patch moves the ext_pkt cleaning to the cleaning macro. This
ensures that the cleaning is done for allocated and pool packets.
Victor Julien [Wed, 9 Jul 2014 06:55:47 +0000 (08:55 +0200)]
packet recycle: remove mutex destroy/init
This was necessary earlier when there was a memset involved.
Victor Julien [Wed, 9 Jul 2014 06:51:29 +0000 (08:51 +0200)]
packet recycle: do most clean up on packet reuse
Call PACKET_RELEASE_REFS from PacketPoolGetPacket() so that
we only access the large packet structure just before actually
using it. Should give better cache behaviour.
Victor Julien [Wed, 9 Jul 2014 06:50:26 +0000 (08:50 +0200)]
packet recycle: split macro
Split PACKET_RECYCLE into 2 parts. One part for cleanup to do before a
packet is returned to the pool, the other after it's retrieved from
the pool.
Victor Julien [Wed, 9 Jul 2014 08:59:49 +0000 (10:59 +0200)]
Fix decode tests calling PACKET_DO_RECYCLE instead of PACKET_RECYCLE
Victor Julien [Tue, 12 Aug 2014 13:59:05 +0000 (15:59 +0200)]
Update Changelog for 2.1beta1
Victor Julien [Fri, 8 Aug 2014 07:49:18 +0000 (09:49 +0200)]
Update Changelog for 2.0.3
Ken Steele [Wed, 5 Feb 2014 23:00:19 +0000 (18:00 -0500)]
Fix GRE Source Routing Header definition
The Source Routing Header had routing defined as a char* for a field
of variable size. Since that field was not being used in the code, I
removed the pointer and added a comment.
Ken Steele [Fri, 20 Dec 2013 18:50:43 +0000 (13:50 -0500)]
More structures that need to be marked Packed.
These structures are cast from raw packet data, so they should be packed.
The case is:
typedef struct Foo_ {
} Foo;
Foo *f = (Foo *)pkt;
Ken Steele [Fri, 20 Dec 2013 16:52:12 +0000 (11:52 -0500)]
Add Packed attribute on Header structures
Structures that are used to cast packet data into fields need to be packed
so that the compiler doesn't add any padding to these fields. This also helps
Tile-Gx to avoid unaligned loads because the compiler will insert code to
handle the possible unaligned load.
Victor Julien [Mon, 11 Aug 2014 12:14:59 +0000 (14:14 +0200)]
lua: improve configure checks
The base 'lua' library has different names on different OS' and even
Linux distro's. Instead of selecting the proper one, we now just try
all. This way no OS/distro specific knowledge about the name is needed.
Victor Julien [Fri, 8 Aug 2014 12:25:31 +0000 (14:25 +0200)]
alert-json: clean up flags
Make payload/packet logging code also use the flags field in
AlertJsonOutputCtx, instead of in the LogFileCtx.
Giuseppe Longo [Thu, 7 Aug 2014 13:10:45 +0000 (15:10 +0200)]
json-alert: include HTTP info on the alerts
Extends the JSON alert output to include the HTTP data
at the time of the alert.
Giuseppe Longo [Thu, 7 Aug 2014 12:36:54 +0000 (14:36 +0200)]
json-http: refactoring output code
Splits the output code in two public functions and permits
to call them from the alert function
Duarte Silva [Thu, 31 Jul 2014 16:06:20 +0000 (17:06 +0100)]
Use extra data structure in json alert output
to store local configuration
Victor Julien [Wed, 16 Jul 2014 22:23:50 +0000 (00:23 +0200)]
stream: detect and filter out bad window updates
Reported in bug 1238 is an issue where stream reassembly can be
disrupted.
A packet that was in-window, but otherwise unexpected set the
window to a really low value, causing the next *expected* packet
to be considered out of window. This lead to missing data in the
stream reassembly.
The packet was unexpected in various ways:
- it would ack unseen traffic
- it's sequence number would not match the expected next_seq
- set a really low window, while not being a proper window update
Detection however, it greatly hampered by the fact that in case of
packet loss, quite similar packets come in. Alerting in this case
is unwanted. Ignoring/skipping packets in this case as well.
The logic used in this patch is as follows. If:
- the packet is not a window update AND
- packet seq > next_seq AND
- packet acq > next_seq (packet acks unseen data) AND
- packet shrinks window more than it's own data size
THEN set event and skip the packet in the stream engine.
So in case of a segment with no data, any window shrinking is rejected.
Bug #1238.
Victor Julien [Thu, 7 Aug 2014 13:02:56 +0000 (15:02 +0200)]
ipv6: fix dst/hop header option parsing
The extension header option parsing used a uint8_t internally. However
much bigger option sizes are valid.
Victor Julien [Tue, 5 Aug 2014 15:28:17 +0000 (17:28 +0200)]
defrag: use 'struct timeval' for timeout tracking
Until now the time out handling in defrag was done using a single
uint32_t that tracked seconds. This lead to corner cases, where
defrag trackers could be timed out a little too early.
Victor Julien [Mon, 28 Jul 2014 12:41:15 +0000 (14:41 +0200)]
ipv6: set event on unsupported nh
If a next header / protocol is encountered that we can't handle (yet)
set an event. Disabled the rule by default.
decode-event:ipv6.unknown_next_header;
Victor Julien [Mon, 28 Jul 2014 11:59:44 +0000 (13:59 +0200)]
ipv6: more robust ipv6 exthdr handling
Skip past Shim6, HIP and Mobility header.
Detect data after 'none' header.
decode-event:ipv6.data_after_none_header;
Victor Julien [Mon, 28 Jul 2014 10:07:13 +0000 (12:07 +0200)]
ipv6: detect frag header reserved field non-zero
Frag Header length field is reserved, and should be set to 0.
decode-event:ipv6.fh_non_zero_reserved_field;
Victor Julien [Thu, 24 Jul 2014 14:50:34 +0000 (16:50 +0200)]
ipv6: make exthdr parsing more robust
Improve data length checks. Detect PadN option with 0 length.
Victor Julien [Thu, 17 Jul 2014 13:57:16 +0000 (15:57 +0200)]
ipv6: set flag on type 0 routing header
Type 0 Routing headers are deprecated per RFC 5095.
This patch sets an decode event flag that can be matched on through:
decode-event:ipv6.rh_type_0;
Victor Julien [Thu, 24 Jul 2014 11:39:10 +0000 (13:39 +0200)]
ipv6 defrag: fix unfragmentable exthdr handling
Fix or rather implement handling of unfragmentable exthdrs in ipv6.
The exthdr(s) appearing before the frag header were copied into the
reassembled packet correctly, however the stripping of the frag header
did not work correctly.
Example:
The common case is a frag header directly after the ipv6 header:
[ipv6 header]->[frag header]->[icmpv6 (part1)]
[ipv6 header]->[frag header]->[icmpv6 (part2)]
This would result in:
[ipv6 header]->[icmpv6]
The ipv6 headers 'next header' setting would be updated to point to
whatever the frag header was pointing to.
This would also happen when is this case:
[ipv6 header]->[hop header]->[frag header]->[icmpv6 (part1)]
[ipv6 header]->[hop header]->[frag header]->[icmpv6 (part2)]
The result would be:
[ipv6 header]->[hop header]->[icmpv6]
However, here too the ipv6 header would have been updated to point
to what the frag header pointed at. So it would consider the hop header
as if it was an ICMPv6 header, or whatever the frag header pointed at.
The result is that packets would not be correctly parsed, and thus this
issue can lead to evasion.
This patch implements handling of the unfragmentable part. In the first
segment that is stored in the list for reassembly, this patch detects
unfragmentable headers and updates it to have the last unfragmentable
header point to the layer after the frag header.
Also, the ipv6 headers 'next hdr' is only updated if no unfragmentable
headers are used. If they are used, the original value is correct.
Reported-By: Rafael Schaefer <rschaefer@ernw.de>
Bug #1244.
Victor Julien [Fri, 1 Aug 2014 07:55:43 +0000 (09:55 +0200)]
packet pool: init pthread key before using it
In the packet pool code, it's critical to initialize the pthread key
before using it. Applies only to the code used if __thread isn't
supported.
Victor Julien [Fri, 1 Aug 2014 07:54:34 +0000 (09:54 +0200)]
packet pool: cosmetic cleanups
Eric Leblond [Thu, 31 Jul 2014 09:48:41 +0000 (11:48 +0200)]
prscript: update URL
Buildbot server has been moved to another box.
Victor Julien [Thu, 31 Jul 2014 13:49:11 +0000 (15:49 +0200)]
magic: disable tests depending on magic version
Some tests depend on specific results by specific magic versions.
Disable these.
Eric Leblond [Wed, 30 Jul 2014 15:17:51 +0000 (17:17 +0200)]
suricata: RunUnittests now return void
RunUnittests function is now a terminal function (calling exit
before leaving).
Eric Leblond [Tue, 29 Jul 2014 08:05:23 +0000 (10:05 +0200)]
unittests: don't register app layer test
Some tests are already registered via the function
AppLayerParserRegisterProtocolUnittests. So we don't need to
egister them during runmode initialization.
Victor Julien [Thu, 31 Jul 2014 10:17:58 +0000 (12:17 +0200)]
Fix up mistaken style change
Ken Steele [Wed, 30 Jul 2014 18:44:45 +0000 (14:44 -0400)]
fixup
Ken Steele [Wed, 30 Jul 2014 18:19:35 +0000 (14:19 -0400)]
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.
Victor Julien [Sat, 12 Jul 2014 07:25:21 +0000 (09:25 +0200)]
eve: add tx_id to output for alerts and events
Add tx_id field for correlating alerts and events per tx.
sxhlinux [Thu, 24 Jul 2014 02:00:40 +0000 (10:00 +0800)]
Update app-layer-htp.c
When keyword "boundary=" doesn't exist in the http_header, the value of r is 0 and this condition shouldn't return 0 instead 1;
Ken Steele [Thu, 3 Jul 2014 16:42:12 +0000 (12:42 -0400)]
Reduce reallocation in AC Tile MPM creation.
Exponentially increase the memory allocated for new states when adding new
states, then at the end resize down to the actually final size so that no space is wasted.
Alexander Gozman [Mon, 28 Jul 2014 16:22:32 +0000 (20:22 +0400)]
Add input interface's name to JSON log
Victor Julien [Wed, 30 Jul 2014 09:00:53 +0000 (11:00 +0200)]
pcap-log: yaml comment update
Victor Julien [Wed, 30 Jul 2014 08:58:30 +0000 (10:58 +0200)]
pcap-log: unify lock handling, fixes Coverity warn
*** CID
1229124 : Data race condition (MISSING_LOCK)
/src/log-pcap.c: 363 in PcapLog()
357 {
358 return TM_ECODE_OK;
359 }
360
361 PcapLogLock(pl);
362
>>> CID
1229124 : Data race condition (MISSING_LOCK)
>>> Accessing "pl->pkt_cnt" without holding lock "PcapLogData_.plog_lock". Elsewhere, "PcapLogData_.pkt_cnt" is accessed with "PcapLogData_.plog_lock" held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).
363 pl->pkt_cnt++;
364 pl->h->ts.tv_sec = p->ts.tv_sec;
365 pl->h->ts.tv_usec = p->ts.tv_usec;
366 pl->h->caplen = GET_PKT_LEN(p);
367 pl->h->len = GET_PKT_LEN(p);
368 len = sizeof(*pl->h) + GET_PKT_LEN(p);