Commit Graph

12612 Commits (fc6fdef07006e5382839ef88873e90754b30e6e0)
 

Author SHA1 Message Date
Jeff Lucovsky fc6fdef070 suricatasc: Handle incomplete/empty recv values
Issue: 4947

Improve handling of values returned by recv. Sometimes, recv returns an
empty string if suricata terminates asynchronously.
3 years ago
Victor Julien ddf14e51dc nfs2: improve READ parsing
Take fill_bytes into account.
3 years ago
Jason Ish 2011a5579c rust/app-layer: expose AppLayerEvent derive macro
Export the AppLayerEvent derive macro so plugin (or library code) can
use it as expected, for example:

use suricata::applayer::AppLayerEvent;

enum MyEvent {
    EventOne,
    EventTwo,
}
3 years ago
Jason Ish ba310440a6 rust/derive: make usable from a plugin or lib user
The macro was generating code that references names use the "crate"
prefix which will fail if the macro is used by a library user or plugin.
Dynamically check where we are running an use the correct import paths
as needed.
3 years ago
Jason Ish bbd5e6402b rust: rename to suricata (from suricata_rust)
Rename the Rust lib to simply "suricata" instead of "suricata_rust".
This allows Rust plugin/library code to use it under the name "suricata"
which is what should be expected.

The name was only "suricata_rust" to prevent on-disk conflict with the C
code, so just rename the file on disk, which doesn't affect how the code
is interacted with from an API layer.
3 years ago
Jason Ish 2ffe88c1f0 rust: remove feature function-macro
The function macro existed so it would only be enabled on Rust
versions that supported.  Now that our MSRV is 1.41, which is
greater than 1.38 we can assume we always have support for
this macro.
3 years ago
Shivani Bhardwaj 613b12b0e7 rust: bump MSRV to 1.41.1
Ticket: #4902.
(cherry picked from commit 87f04475aa)
3 years ago
Jason Ish 50fdcd098c rust/http2: use base64 crate for base64 decode 3 years ago
Jason Ish 6392216f6b base64: use the Rust base64 encode implementation
Replace our internal base64 implementation with a ffi wrapper
around the Rust implementation provided by an external crate.
3 years ago
Jason Ish 6d3dcf27a6 eve: use JsonBuilder for encoding base64
Replaces all usages of Base64Encode just before writing to a
JsonBuilder with jb_set_base64 and jb_append_base64.
3 years ago
Jason Ish 8181030f72 jsonbuilder: add methods to encode values as base64
Add new methods to set a value as a base64 encoded string of
a byte array. This uses the Rust base64 crate and encodes
directly into the JsonBuilder buffer with no intermediate
buffer required.

jb_set_base64: set a field on an object
jb_append_base64: append a value to an array
3 years ago
Victor Julien c073d5cfbf app-layer: use StreamSlice as input to parsers
Remove input, input_len and flags in favor of stream slice.
3 years ago
Victor Julien 6466296b32 app-layer: add StreamSlice to pass data to parsers
Since object to contain relevant pointer, length, offset, flags to make
it easy to pass these to the parsers.
3 years ago
Jeff Lucovsky 93842aa14a doc/yaml: Signal-termination option description 3 years ago
Jeff Lucovsky 7f0f463b64 logging/diag: Enable stacktrace diagnostic if config'd
This commit adds a signal handler for SIGSEGV when configured. The
signal handler emits a one line stack trace using SCLogError. The intent
is to provide diagnostic information in deployments where core files are
not possible.

The diagnostic message is from the offending thread and includes the
stack trace; each frame includes the symbol + offset.
3 years ago
Jeff Lucovsky 163f70be9d logging: Stacktrace on signal term setting
This commit adds a configuration setting to enable a stack trace message
if Suricata receives a signal that terminates execution, such as
SIGSEGV, SIGABRT.
3 years ago
Jeff Lucovsky 501c870a2c error: Add error code for sig-related diagnostics
This commit adds an error code for the diagnostic code used for
diagnostic messages following unexpected termination due to signals..
3 years ago
Jeff Lucovsky 303dd29b50 configure.ac: Support libunwind configuration
This commit adds support for enabling libunwind -- a library that can be
used to display stack information.

Libunwind is enabled and used by Suricata if present during
configuration.  A diagnostic message is displayed if libunwind
cannot be found.
3 years ago
Juliana Fajardini 6ae80b2819 doc: replace ohloh with openhub link 3 years ago
Juliana Fajardini de0ce26e3f userguide: update references to Suricata website
Many places were still referencing the old Suricata page.
Used git grep with replace to update them. Checked that new links work.
Left old references when they were only documentation examples (for
output or unittests).

Task#4915
3 years ago
Juliana Fajardini 7b20488d4e userguide: fix low-hanging typos Config page 3 years ago
Philippe Antoine bf9bbdd612 detect: fix app-layer-protocol keyword for HTTP
Ticket: 4920

Completes commit c8dbe24fb6
which introduced AppProtoEquals to have a generic
check for http in signature can mean http1 or http2 in
traffic.

This commit missed this case, as I only looked for
git grep "alproto ==" and here we deal with
alproto_tc and alproto_ts, but not alproto by itself.
3 years ago
Odin Jenseg 2a5d79e426 doc/eve-json-format/dns: Describing Z-bit 3 years ago
Jason Ish 0861b66e15 dns: add dns flag to dns request logging
Ticket #4515
3 years ago
Odin Jenseg dfb6f105e8 dns: Logging of Z-bit
[Edit by Jason Ish: fix flag bit value]

Ticket #4515
3 years ago
Jason Ish fcbdc30426 dns: create transaction even if z-bit was set
It appears that DNS servers will still process a DNS request even if the
z-bit is set, our parser will fail the transaction. So create the
transaction, but still set the event.

Ticket #4924
3 years ago
Lukas Sismis 4972021cd4 dpdk: add DPDK test support in Github CI
Add DPDK dependency to the build process in distributions with
a native support of DPDK in their default package managers.
3 years ago
Lukas Sismis dab3274263 dpdk: add documentation for the DPDK runmode
Briefly present the DPDK runmode through configuration file.
3 years ago
Lukas Sismis de53e07559 dpdk/ice: setup RSS for Intel ICE PMD
Set RSS hash function according to Intel ICE PMD available hash functions

Set hash functions according to the support by the ICE PMD, so that no warning
regarding RSS setting is issued.
3 years ago
Lukas Sismis 3f7a50eeb7 dpdk/ixgbe: setup RSS for Intel IXGBE PMD
Set RSS hash function according to Intel IXGBE PMD available hash functions.

During configuration, a warning appeared stating that RSS hash function
has been changed from one value to the other. This has meant that
the supported hash functions did not cover all required hash functions
by the configuration. This commit solves the warning.
3 years ago
Lukas Sismis 639aa04c5f dpdk/i40e: support RSS on Intel i40e PMD driver
Due to peculiar behavior of i40e PMD driver, the RSS is required to be set
via rte_flow rules or a hash filter as compared to other NICs where RSS is
configured through port configuration structure.
RTE_FLOW rules are created on 5-tuples (as opposed to 3-tuple configured
on the other NICs). Fragmented traffic have been tested with this setup
and it has been proven that fragmented packets of the same flow are
received on the same queue. At the same time, setting 3-tuple on rte_flow
rules have not yield in the expected results.

Notes from the experiments:

- Configuration of 5-tuple (as is in the commit):
    fragmented and nonfragmented packets are received by the same workers
    even when I applied seed to alter them via tcpreplay-edit (option --seed)

- Setting only ETH_RSS_FRAG_IPV4 and ETH_RSS_IPV4 (i.e. setting 3-tuple):
    when setting ETH_RSS_IPV4, the PMD driver says that pctype is not
    supported (generally this means that the "type" of traffic is not
    a valid configuration for the i40e)

- Setting only ETH_RSS_FRAG_IPV4 and ETH_RSS_NONFRAG_IPV4_OTHER:
    this doesn't work well, packets of the same flow are received on
    the different workers (my explanation is that the fragmented packets are
    matched with ETH_RSS_FRAG_IPV4 but the other UDP packets are not matched
    with ETH_RSS_NONFRAG_IPV4_OTHER rte_flow rule (they would be matched with
    ETH_RSS_NONFRAG_IPV4_UDP).
3 years ago
Victor Julien f98df5c3fd dpdk: add RSS flags that are set in the NIC 3 years ago
Victor Julien 56dfec48b9 dpdk: add specific error counters 3 years ago
Lukas Sismis a7faed1245 dpdk: initial support with workers runmode
Register a new runmode - DPDK. This enables a new flag on Suricata start
(--dpdk).

With the flag given, DPDK runmode is enabled.

Runmode loads the configuration and then initializes EAL.

If successful, it configures the physical NICs according to the configuration
file. After that, worker threads are initialized and then are in continuous
receive loop.
3 years ago
Lukas Sismis fcfee6994e dpdk: edit configure.ac to include DPDK compilation option
Add a build flag --enable-dpdk to support DPDK parts in the source code.
3 years ago
Jeff Lucovsky 142a579971 netmap: allow specifying a library directory
Ticket: #4482
3 years ago
Jason Ish 92eb14c5ad datasets: initialize after dropping privileges
Move initialization of datasets to a point after privileges
have been dropped.

Ticket 4239
3 years ago
Pierre Chifflier d67f8f9196 rust/smb: convert parser to nom7 functions (SMB1) 3 years ago
Pierre Chifflier 895a54cea4 rust/smb: convert parser to nom7 functions (DCERPC records) 3 years ago
Pierre Chifflier 8d77ce1ffc rust/smb: convert parser to nom7 functions (SMB2) 3 years ago
Pierre Chifflier 5cadb878ff rust/smb: convert parser to nom7 functions (SMB3) 3 years ago
Pierre Chifflier 4c97dfa851 rust/smb: convert parser to nom7 functions (NTLM/SSP records) 3 years ago
Pierre Chifflier 3da816eb23 rust/smb: convert parser to nom7 functions (NBSS records) 3 years ago
Pierre Chifflier 90f9450971 rust: add nom7 combinator take_until_and_consume 3 years ago
Lukas Sismis e4b5239202 doc: fix typo in "Stream engine" documentation 3 years ago
Philippe Antoine dd32238667 ftp: do not set alproto if one was already found
Ticket: 4857

If a pattern such as GET is seen ine the beginning of the
file transferred over ftp-data, this flow will get recognized
as HTTP, and a HTTP state will be created during parsing.

Thus, we cannot override directly alproto's values

This solves the segfault, but not the logical bug that the flow
should be classified as FTP-DATA instead of HTTP
3 years ago
Victor Julien a02f263e56 app-layer/htp: cleanup test 3 years ago
Victor Julien 0a1c3267e6 htp: rename callbacks to make purpose clearer 3 years ago
Victor Julien 258415b23f stream: unify ack'd right edge handling
Use util function in all code needing the ack'd data.
3 years ago
Victor Julien ac11502629 detect/engine: store buffer name in local array
Instead of storing a name and description as a pointer in DetectBufferType
store them in fixed size arrays. This is in preparation of runtime registration
of buffer types, where a constant name/desc is not available.
3 years ago