Commit Graph

5432 Commits (496200dd08e20ecdc2ac2b8657587af417c86d58)
 

Author SHA1 Message Date
Duarte Silva 496200dd08 Prepared everything for the proxy deployment configuration
- Added the suricata.yaml configurations and updated the comments
- Renamed the field in the configuration structure to something generic
- Added two new constants and the warning codes
10 years ago
Duarte Silva 4e04cd2d1b Adding XFF support to EVE alert output
- Created app-layer-htp-xff.c and app-layer-htp-xff.h
- Added entries in the Makefile.am
- Added the necessary configuration options to EVE alert section
- Updated Unified2 XFF configuration comments and removed unnecessary whitespace
- Created a generic function to parse the configuration
- Release the flow locks sooner and remove debug logging
- Added XFF support to EVE alert output
10 years ago
DIALLO David 0bdf494b54 fix Cygwin build fails: array subscript has type char 10 years ago
DIALLO David bacbe113d0 Add a warning in Modbus section of YAML file to remind user to modify stream depth (unlimited) 10 years ago
DIALLO David bfc871ce85 Update AppLayerProtoDetectPrintProbingParsers with Modbus protocol 10 years ago
DIALLO David 83d9834e77 fix CID 1257762: Logically dead code(DEADCODE) 10 years ago
Eric Leblond e564ac77fd suricatasc: exit with error if command returns NOK 10 years ago
Eric Leblond 55ccd3b17d suricatasc: now python 2 and 3 compatible
Update code to support both python 2 and python 3.
10 years ago
Victor Julien 84e8217fd8 unix-socket: allow socked in custom locations
Allow the socket to be set in any location. This allows for easy
setting up of a socket as a non-root user.
10 years ago
Victor Julien b978730486 unix-socket: fix restart/shutdown cycle
When cleaning up after a pcap was processed, the stats api was cleaned
up before the stats threads were killed, leading to a BUG_ON triggering.
10 years ago
Ken Steele 3f3481e4d2 Fix indentation 10 years ago
Ken Steele 3f86c5a83f Fix memory leak in ac-tile
Incorrectly reallocing the goto table after it was freed by calling
SCACTileReallocState() when really only want to realloc the output table.
This was causing a large goto table to be allocated and never used or
freed.
10 years ago
Ken Steele b9e20ab4b8 Clean up memory leaks in ac-tile code
Free some memory at exit that was not getting freed.

Change pid_pat_list to store copy of case-strings in the same block
of memory as the array of pointers.
10 years ago
Ken Steele 1faa94c314 Make bad copy-mode be an error in runmode-tile. 10 years ago
Victor Julien c779065d35 Bug 1329: error out on invalid rule protocol
Due to a logic error in AppLayerProtoDetectGetProtoByName invalid
protocols would not be detected as such. Instead of ALPROTO_UNKNOWN
ALPROTO_MAX was returned.

Bug #1329
10 years ago
Eric Leblond 9f22c878e8 unix-manager: fix cppcheck errors
This patch fixes the following errors:
 [src/unix-manager.c:306]: (error) Memory pointed to by 'client' is freed twice.
 [src/unix-manager.c:313]: (error) Memory pointed to by 'client' is freed twice.
 [src/unix-manager.c:323]: (error) Memory pointed to by 'client' is freed twice.
 [src/unix-manager.c:334]: (error) Memory pointed to by 'client' is freed twice.

Unix manager was treating the packet after closing the socket if message was
too long.
10 years ago
Victor Julien 096b85ab68 stream: don't send EOF to AppLayer too soon
Sending EOF too soon results in the AppLayer cleaning up prematurely.
10 years ago
Victor Julien 0bb2b15491 ipv6: check for MLD messages with HL not 1
MLD messages should have a hop limit of 1 only. All others are invalid.

Written at MLD talk of Enno Rey, Antonios Atlasis & Jayson Salazar during
Deepsec 2014.
10 years ago
Ken Steele 68e6c4e94b Correct flow memory usage bookkeeping error
Fix bug 1321 where flow_memuse was incremented more on allocation than
free.
10 years ago
Victor Julien d951de2f19 Bug 977: -T / --init-errors-fatal to process all rules
Have -T / --init-errors-fatal process all rules so that it's easier
to debug problems in ruleset. Otherwise it can be a lengthy fix, test
error cycle if multiple rules have issues.

Convert empty rulefile error into a warning.

Bug #977
10 years ago
Victor Julien e951afb911 afpacket: only check offloading once per iface
Instead of once per thread per iface.
10 years ago
Victor Julien fa10811585 ioctl: make all string args const pointers 10 years ago
Victor Julien c3c144d504 http: don't crash when normalizing uri on low memory 10 years ago
Victor Julien f8f2ff49de defrag: don't crash when out of memory
Handle memory allocation errors in defrag better. Could lead to
crashes if malloc errors happened.
10 years ago
Eric Leblond 56373e5b34 af-packet: no more threads than RSS queues
If we manage to read the number of RSS queues from an interface,
this means that the optimal number of capture threads is equal
to the minimum of this number and of the number of cores on the
system.

This patch implements this logic thanks to the newly introduced
function GetIfaceRSSQueuesNum.
10 years ago
Eric Leblond 123c58af4b util-ioctl: add message in case of failure 10 years ago
Eric Leblond b4bb6e67ba util-ioctl: Add function to get number of RSS queues on iface
The number of RSS queues can be fetched via a standard ioctl which
is independant of hardware.
10 years ago
Victor Julien c174c9d779 af-packet: threads: auto, default to workers
Add a new default value for the 'threads:' setting in af-packet: "auto".
This will create as many capture threads as there are cores.

Default runmode of af-packet to workers.
10 years ago
Victor Julien 7b4987abc3 Runmode: handle value 'auto'
Auto now selects the default runmode for the capture method.
10 years ago
Victor Julien 234d18ab68 threading: remove '1slot' functions
No longer in use after the 'auto' runmode removal.

All runmodes now use either varslot or pktacqloop support.
10 years ago
Victor Julien 7025aabe75 Runmodes: remove 'auto' runmodes
Remove 'auto' runmodes from all capture methods. It wasn't reliable
enough, as it didn't enforce inspection order of packets.
10 years ago
Victor Julien 81c42f4916 log-stats: expand membuffer if necessary
Many threads could lead to a membuffer size requirement bigger than
64k. So use the expansion call to grow the buffer as needed.
10 years ago
Victor Julien 6277d2e0e4 MemBuffer: add expansion call
For some of the buffer users it's hard to predict how big the data
will be. In the stats.log case this depends on chosen runmode and
number of threads.

To deal with this case a 'MemBufferExpand' call is added. This realloc's
the buffer.
10 years ago
Victor Julien 75397ed750 stats: expose stats to Lua output
Register with type 'stats':

    function init (args)
        local needs = {}
        needs["type"] = "stats"
        return needs
    end

The stats are passed as an array of tables:

    { 1, { name=<name>, tmname=<tm_name>, value=<value>, pvalue=<pvalue>}}
    { 2, { name=<name>, tmname=<tm_name>, value=<value>, pvalue=<pvalue>}}
    etc

Name is the counter name (e.g. decoder.invalid), tm_name is the thread name
(e.g. AFPacketeth05), value is current value, and pvalue is the value of the
last time the script was invoked.
10 years ago
Victor Julien 5d95b08172 output streaming: cleanup at runmode destruction 10 years ago
Victor Julien 51a540c27e stats: disable stats if no loggers are enabled 10 years ago
Victor Julien 6252d24e0b stats: initialize after outputs
Initialize stats after outputs so that we can check if we need to
initialize the stats api at all.
10 years ago
Victor Julien a95c95f74c stats: introduce global config
As the stats api calls the loggers at a global interval, the global
interval should be configured globally.

 # global stats configuration
 stats:
   enabled: yes
   # The interval field (in seconds) controls at what interval
   # the loggers are invoked.
   interval: 8

If this config isn't found, the old config will be supported.
10 years ago
Victor Julien e98346b555 Introduce stats log API, convert existing output
Convert regular 'stats.log' output to this new API.

In addition to the current stats value, also give the last value. This
makes it easy to display the difference.
10 years ago
Victor Julien ee8da21e36 pcre: fix var capture for non relative matches
Var capture setup depended on the match being relative due to a logic
error.
10 years ago
Giuseppe Longo 1ad2a231fe pfring: fixes memleaks
This fixes some memory leaks
Bug #1184
10 years ago
Victor Julien 16941468ce lua: in streaming api, indicate open/close
The SCStreamingBuffer call now also returns two booleans:
    data, data_open, data_close = SCStreamingBuffer()

The first indicates this is the first data of this type for this
TCP session or HTTP transaction.

The second indicates this is the last data.

Ticket #1317.
10 years ago
Ken Steele 8dcd99209e Update copyright year in detect-flowbits files. 10 years ago
Ken Steele e6f83a586c DetectFlowintData - remove unused idx in TargetVar.
The idx inside TargetVar inside DetectFlowintData is never used, so remove
it.
10 years ago
Ken Steele c547d39152 Fix bug in DetectFlowintParse() - Assigning to both parts of a Union
sfd->target.value was always being set, even if the targettype was
not FLOWINT_TARGET_VAL. This would cause the tvar to be overwritten
with garbage data.
10 years ago
Ken Steele fa72082491 Don't write target.tvar.idx in DetectFlowintParse
Match functions should not be writing to the SigMatch context. So just use
a local variable instead.
10 years ago
Ken Steele 5cdb21ec34 Remove an unused define COUNTER_DETECT_ALERTS
The only place this exists in the code is when it is defined.
10 years ago
Ken Steele 18e2de320b Coding style cleanup in detect-modbus files. 10 years ago
Ken Steele ff41c1c452 Correct size increase in SigGroupHeadStore()
The code was increasing the size of the allocated memory by 16, but
only increasing the stored size by 10. Now uses one variable for both
places.
10 years ago
DIALLO David 55c5081240 Detect-engine: Add Modbus detection engine
Management of Modbus Tx

Based on DNS source code.

Signed-off-by: David DIALLO <diallo@et.esia.fr>
10 years ago