Commit Graph

276 Commits (cba41207b3f2d8251f7e0f7944683134d9cf8233)

Author SHA1 Message Date
Victor Julien cf2feeecf4 detect/prefilter: redo profiling 7 years ago
Jason Ish f7c3f30186 filestore v2: use fileinfo records as metadata
As fileinfo records are logged to the main eve log, disable
metadata by default. But when enabled, just use the fileinfo
record.

Metadata is stored in a file named:
  <sha256>.<seconds>.<file_id>.json

where the sha256 is the same as the file logged, the seconds
is the unix timestamp in seconds for the fileinfo record,
and the file_id is an atomically incremented integer per
Suricata instance.

This should allow for each occurrence of the same file to have
its own metadata file. But a collision is expected when running
Suricata repeatedly over the same pcap, as that would be the
exact same occurrence of a file.
7 years ago
Jason Ish 4a97315057 filestore v2 - initial version
Filestore v2 is starts as a copy of log-filestore with the
following changes.

- NSS is required as file names as based on the SHA256.
- Work/tmp files are stored in a temp. directory, then
  moved into a directory tree where the directory names
  are the first 2 characters of the hex SHA256.
- Removes the need for a waldo file or pid in the filenames.
7 years ago
Victor Julien 746638b220 cuda: remove
Remove CUDA support as it has been broken for a long time.

Ticket #2382.
7 years ago
Eric Leblond 711b6fb389 app-layer-ftp: add memcap for ftp
Add a memory cap for the FTP protocol.
7 years ago
Gaurav Singh 637a7c8e55 Adds options to mark when a file is final.
This takes the form of an option to add the pid of the process to file
names. Additionally, it adds a suffix to the file name to indicate it is
not finalized.

Adding the pid to the file name reduces the likelihood that a file is
overwritten when suricata is unexpectedly killed. The number in the
waldo file is only written out during a clean shutdown. In the event
of an improper shutdown, extracted files will be written using the old
number and existing files with the same name will be overwritten.

Writes extracted files and their metadata to a temporary file suffixed
with '.tmp'. Renames the files when they are completely done being
written. As-is there is no way to know that a file on disk is still
being written to by suricata.
7 years ago
Alfredo Cardigliano b6baafb3e3 pfring: hw bypass support
This patch adds support for hw bypass by enabling flow offload in the network
card (when supported) and implementing the BypassPacketsFlow callback.
Hw bypass support is disabled by default, and can be enabled by setting
"bypass: yes" in the pfring interface configuration section in suricata.yaml.
7 years ago
Victor Julien 3e868188e6 yaml: add 'append' to stats-log entry
Bug #798
7 years ago
Julian f27b4fc8fe redis: support for rpush in list mode
This adds a new redis mode rpush. Also more consistent config keywords orientated at the redis command: lpush and publish.
Keeping list and channel config keywords for backwards compatibility
7 years ago
Phil Young 01801c6d7c napatech: configuration changes.
Added comments describing parameter usage.
Changed example to use range formatting of streams.
7 years ago
Jason Ish 95a781d4b2 suricata.yaml: better comment on pid-file option
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2104
7 years ago
Victor Julien 62b6f9fe25 decode: add config option to disable teredo
Ticket #744.
7 years ago
Eric Leblond 33d7f7d539 output-json-alert: log http body
Add support for HTTP body logging as printable or as base64.
7 years ago
Victor Julien 9dab3ec71e rust: enable/disable yaml settings
Based on compile time settings, enable/disable app-layers
and loggers.
7 years ago
Pierre Chifflier 87dbda1d1e Add NTP event rules (commented) to the default config 7 years ago
Pierre Chifflier efe11dc37e Add NTP parser (rust-experimental) 7 years ago
Eric Leblond 66da9d0ba6 output-json-alert: rename applayer to metadata 7 years ago
Eric Leblond c3806ebd2a suricata.yaml: add some port variables
These variables are used by Talos ruleset and defining them allow
to get almost all rules of ruleset loaded.
7 years ago
Victor Julien ed706583e9 nfs: add nfs to alerts
Also add a single 'applayer' option for alert augmentation that
applies to all app-layers.
7 years ago
Victor Julien 0d79181d78 nfs: rename nfs3 to nfs
Since the parser now also does nfs2, the name nfs3 became confusing.
As it's still in beta, we can rename so this patch renames all 'nfs3'
logic to simply 'nfs'.
7 years ago
Eric Leblond 050d8f788b af-packet: warn when tpacket_v3 is used in IPS
Update yaml and add an error message.
7 years ago
Eric Leblond ea9b9b5063 stream-tcp: add option to accept invalid packets
Suricata was inconditionaly dropping packets that are invalid with
respect to the streaming engine. In some corner case like asymetric
trafic capture, this was leading to dropping some legitimate trafic.

The async-oneside option did help but this was not perfect in some
real life case. So this patch introduces an option that allow the
user to tell Suricata not to drop packet that are invalid with
respect to streaming.
7 years ago
Eric Leblond 775e67459c filestore: avoid open write close sequence
Current file storing approach is using a open file, write data,
close file logic. If this technic is fixing the problem of getting
too much open files in Suricata it is not optimal.

Test on a loop shows that open, write, close on a single file is
two time slower than a single open, loop of write, close.

This patch updates the logic by storing the fd in the File structure.
This is done for a certain number of files. If this amount is exceeded
then the previous logic is used.

This patch also adds two counters. First is the number of
currently open files. The second one is the number of time
the open, write, close sequence has been used due to too much
open files.

In EVE, the entries are:
 stats {file_store: {"open_files_max_hit":0,"open_files":5}}
7 years ago
Eric Leblond 54718b306e filestore: add option to disable meta file writing
As the fileinfo entry is containing the file_id it is enough to
have this entry to link the extracted file with metadata.
7 years ago
Victor Julien d6592211d0 rust/nfs: NFSv3 parser, logger and detection 7 years ago
Victor Julien a995734b3a yaml: sync with new stream engine 8 years ago
Victor Julien 807312320f stream-tcp: implement thread pool for segments
Config option:

stream:
  reassembly:
    segment-prealloc: 2048
8 years ago
Victor Julien 91f57200c7 stream: add stream.reassembly.check-overlap-different-data option 8 years ago
Victor Julien b3e9d39771 stream: remove unused zero copy setting 8 years ago
Ray Ruvinskiy 7539973109 tls: logging for session resumption
We assume session resumption has occurred if the Client Hello message
included a session id, we have not seen the server certificate, but
we have seen a Change Cipher Spec message from the server.

Previously, these transactions were not logged at all because the
server cert was never seen.

Ticket: https://redmine.openinfosecfoundation.org/issues/1969
8 years ago
fooinha a64e5e77c7 eve: async mode for redis output
eve: detects libevent for async redis at configure
eve: moves redis output code to new file - util-log-redis.{c,h}
eve: redis ECHO and QUIT commands for async mode
eve: redis output defaults if conf is missing
8 years ago
fooinha 20d4d40051 log: tls custom format log 8 years ago
Mats Klepsland 2b460b8d06 output-json-lua: log certificate serial number 8 years ago
Mats Klepsland 115b3138cc output-json-tls: log certificate and chain
Log entire certificate and certificate chain Base64 encoded.
8 years ago
Mats Klepsland 0716199acb output-json-tls: custom tls logging 8 years ago
Jason Ish 82f6103149 unified2: nostamp and file rotation
Give unified2 a nostamp option which will create the file
without the timestamp suffix (like Snort's nostamp option).

Also register for rotation notification on SIGHUP so the file
will be recreated if it is removed by an external rotation
program (only when nostamp is used).
8 years ago
Victor Julien 5ca4a2e6fe outputs: vars log
EVE addition called 'vars' that logs pkt/flow vars for each packet/flow.
8 years ago
Victor Julien 1a2ad059a1 eve: log pktvars/flowvars/bits/ints
Optionally logs 'vars' into alerts
8 years ago
Victor Julien 75907fce06 profiling: output all sort options for rules
Limit the default number of sids to 10.
8 years ago
Victor Julien 7d8a5a75ef profiling: honor limit in json rule output 8 years ago
Victor Julien a0580d8805 stream: initialize stream segment pool from mtu
If segments section in the yaml is ommitted (default) or when the
pool size is set to 'from_mtu', the size of the pool will be MTU
minus 40. If the MTU couldn't be determined, it's assumed to be
1500, so the segment size for the bool will be 1460.
8 years ago
Victor Julien 15f4144eda smb: add tcp/445 to proto detect fallback 8 years ago
Travis Green f08cc1f3db yaml: update commented rule files
Disabled scada.rules, added commented rule file names to help
administrators find informational rule files.
8 years ago
Victor Julien 3012edae1c luajit: update default yaml and doc for 'states' 8 years ago
Victor Julien 3973363164 yaml: group ICS protocols together 8 years ago
Victor Julien b231558957 ENIP: add default ports to yaml 8 years ago
Jason Ish bbaa79b80e DNP3: Application layer decoder.
Decodes TCP DNP3 and raises some DNP3 decoder alerts.
8 years ago
Victor Julien b789d2ae3d tls: change 'no-reassemble' option to default off
This option was broken so there should be no visible change to
actual deployments.
8 years ago
Jason Ish a6854147be pcap-log config: sguil-base-dir -> dir and update comment
The code already looks for "dir" first instead of
"squil-base-dir", and already respects this configuration
parameter in other modes than the "sguil" mode.

Coda will still access "sguil-base-dir".
8 years ago
Victor Julien e6cf7ae8fa yaml: improve stream-depth comments 8 years ago