Eric Leblond [Tue, 22 Jan 2013 09:47:29 +0000 (10:47 +0100)]
suricatasc: update python packaging
'make install' install now suricatasc script and Python module to
the system. The suricatasc client module can now be used in other
Python projects by using 'import suricatasc'.
A transformation was needed for distribution of a module and a script.
Module in src directory is now containing most of the code and the
script only handle argument parsing and the creation of a unix socket
client through 'suricatasc' module.
Eric Leblond [Thu, 6 Dec 2012 10:21:57 +0000 (11:21 +0100)]
suricatasc: refactor as a class
The goal of this commit is to be able to use suricatasc has a library
and and program. This is done by putting all active code in class and
adding a Python magic to detect when file is used as a program.
Eric Leblond [Fri, 30 Nov 2012 19:47:47 +0000 (20:47 +0100)]
suricatasc: real cmd line parsing and verbose mode
This patch adds commandline parsing and help to suricatasc. It also
adds a verbose mode (-v) where the send and received JSON object are
shown. This should ease development of unix socket client.
Eric Leblond [Fri, 30 Nov 2012 19:11:44 +0000 (20:11 +0100)]
unix socket: add 'conf-get' command
This patch adds a 'conf-get' command which get the configuration
value from suricata. Argument of the command is the name of the
variable to fetch.
The command syntax is the following:
{
"command": "conf-get",
"arguments": { "variable":value}
}
Eric Leblond [Fri, 30 Nov 2012 17:13:11 +0000 (18:13 +0100)]
suricatasc: factorize code and use dynamic commands
This patch factorize the recv code and uses the new 'command-list'
to get the list of existing commands from suricata. This allows
suricatasc to be able to call any new command if this command does
not require an argument.
Eric Leblond [Fri, 22 Feb 2013 14:54:09 +0000 (15:54 +0100)]
Fix build with old pcap library.
Pcap snaplen related modification broke compilation of Suricata for
system having old pcap library. This patch fixes the issue and allow
old pcap library to honour the snaplen value.
Eric Leblond [Mon, 18 Feb 2013 10:00:20 +0000 (11:00 +0100)]
Workaround function missing in libhtp include
As reported in bug #688, htp_config_set_path_decode_u_encoding
function is not included in libhtp header before 0.3.0. Result
is that suricata compilation fail with an external htp library.
The following patch detect the issue and adds the missing
declaration.
Matt Keeler [Tue, 19 Feb 2013 16:49:06 +0000 (11:49 -0500)]
Added host buffer allowance and stream configuration for Napatech 3GD
Added a napatech section in the yaml configuration.
hba - host buffer allowance
use-all-streams - whether all streams should be used
streams - list of stream numbers to use when use-all-streams is no
The source-napatech.* files were modified to support the host buffer allowance configuration.
The runmode-napatech.c file was modified to support both the host buffer allowance configuration and stream configuration
Eric Leblond [Fri, 15 Feb 2013 15:11:47 +0000 (16:11 +0100)]
pcap: add snaplen YAML variable
This patch introduces 'snaplen' a new YAML variable in the pcap section.
It can be set per-interface to force pcap capture snaplen. If not set
it defaults to interface MTU if MTU can be known via a ioctl call and to
full capture if not.
Eric Leblond [Fri, 15 Feb 2013 11:10:25 +0000 (12:10 +0100)]
pcap: set snaplen to MTU if available.
Main objective of this patch is to use a dynamic snaplen to avoid
to truncate packet at the currently fixed snaplen.
It set snaplen to MTU length if the MTU can be retrieved. If not, it
does not set the snaplen which results in using a 65535 snaplen.
libpcap is trying to use mmaped capture and setup the ring by using buffer_size
as the total memory. It also use "rounded" snaplen as frame size. So if we set
snaplen to MTU when available we are optimal regarding the building of the ring.
Eric Leblond [Thu, 14 Feb 2013 10:11:55 +0000 (11:11 +0100)]
teredo: update protocol decoding.
This patch fixes an error in pointer arythmetic and add some
comments to increase maintanability of the code. It also
simplify the decoding code as a careful RFC reading indicate
that if we discard packet containing an authentication field,
it is only possible to have a single origin indication field.
Ignacio Sanchez [Thu, 11 Oct 2012 12:55:40 +0000 (13:55 +0100)]
Adds support for the geoip keyword
Adds support for match-on conditions (src, dst, any, both)
Uses GEOIP_MEMORY_CACHE for performance reasons
Adds support for negation and multiple countries in the same rule
Bug fixes
Changed to take flow direction from rule, if present
Eric Leblond [Mon, 21 Jan 2013 08:27:08 +0000 (09:27 +0100)]
conf: introduce WithDefault function
This patch introduces a new set of functions to the ConfGetChildValue
family. They permit to look under a default node if looking under
base node as failed. This will be used to access to default parameters
for a data type (for instance, first usage will be interface).
Eric Leblond [Wed, 28 Nov 2012 12:22:22 +0000 (13:22 +0100)]
Add removal safe TAILQ iterator.
TAILQ_FOREACH macro was not safe for element removal as it was
accessing the next element in case of a free. This patch is inspired
by Linux list handling and provide a new macro TAILQ_FOREACH_SAFE.
This macro is removal safe and only differs by a last argument being
a temporaty pointer to an element.
Eric Leblond [Wed, 28 Nov 2012 09:34:35 +0000 (10:34 +0100)]
prelude: don't build string objet for NULL string
prelude_string_set_ref don't like when it is called with a NULL
parameter. This patch adds check for NULL value. This is formally
good as there is no use of a NULL description.
Anoop Saldanha [Tue, 27 Nov 2012 06:02:16 +0000 (11:32 +0530)]
fix for bug #526.
Insert pseudo packet under low load conditions to complete rule swap.
This is necessary when we use autofp active packets where most packets
would be sent to the first queue under low load conditions.