Commit Graph

14936 Commits (765b05f1391a68b0be7a530542f953e52757e7b3)
 

Author SHA1 Message Date
Juliana Fajardini 765b05f139 docs: miscellanea updates
- Fix a DPDK reference link, add some line breaks.
- Exemplify what a good commit message looks
like, for Suricata's commit style.
2 years ago
Jason Ish ae5c65fb49 github-ci: disable some workflows on doc only changes
Don't run the following GitHub workflows on documentation only
changes:
- cifuzz
- codeql
- formatting
- rust
- scan-build
2 years ago
Jason Ish 3e2a62915b doc/userguide: display version on front page
When viewing the docs online at Readthedocs, or similar it might be
immediately apparent what version of the documentation is being
displayed. Display the version on the first line before the table of
contents to make it clear.
2 years ago
Victor Julien 89f1837625 rust: update cargo.lock 2 years ago
jason taylor c1c9b1c5ee detect: update filename buffer description name
Signed-off-by: jason taylor <jtfas90@gmail.com>
2 years ago
Victor Julien b63374bf5f stream: special handling for RST data
Data on RST packets is not invalid, but also shouldn't be used
in reassembly.

RFC 1122:

  4.2.2.12  RST Segment: RFC-793 Section 3.4

    A TCP SHOULD allow a received RST segment to include data.

    DISCUSSION
        It has been suggested that a RST segment could contain
        ASCII text that encoded and explained the cause of the
        RST.  No standard has yet been established for such
        data.

RST data will be presented to the detection engine per packet,
but will not be part of stream reassembly.

Bug: #6244.
2 years ago
Victor Julien 9ba55b8a28 stream: add stream.rst_with_data event for RST with data 2 years ago
Victor Julien 4e19454152 ftp: reenable debug check; improve debug log 2 years ago
Victor Julien 33fca4d4db pcap/file: normalize file timestamps
Normalize the timestamps that are too far in the past to epoch.

Bug: #6240.
2 years ago
Victor Julien 8dc12f5f14 threads: improve spawn failure error reporting 2 years ago
Andreas Herz 26130d903f doc: add note about cpu prio overwrite behavior 2 years ago
Andreas Herz da68692547 doc: dataset - add type to be mandatory 2 years ago
Jeff Lucovsky 427d2a71d5 radix: Detect duplicate netblocks
This commit prevents duplicate IPV4/IPV6 netblocks from being added to the
radix tree.

Contributed by Giuseppe Longo <giuseppe@glongo.it>

Issue: 5748
2 years ago
Jeff Lucovsky a559d7c670 error: Add SC_EEXIST for dups
Issue: 5748

This commit adds SC_EEXIST to be used for cases where an
item/resource/artifact with the same attributes already exists.
2 years ago
Jeff Lucovsky 06158223d2 gen/bool: Use bool type instead of ints
This commit converts usages of `int` to `bool` within the radix utility
code.
2 years ago
Jeff Lucovsky c666317038 reputation: Release memory on key add fails
Ensure that memory for the reputation key is released on failed adds.

Contributed by Giuseppe Longo <giuseppe@glongo.it>

Issue: 5748
2 years ago
Jeff Lucovsky ca0b2b4daa gen/typos: Correct misc. typos. 2 years ago
Jeff Lucovsky 2625c823b3 general: Remove unused include files 2 years ago
Jeff Lucovsky 2d96b6e13b output/stats: Handle stat names w/out scope
Issue: 6094

Not all stat names are scoped, e.g. decoder.pkts is scoped to decoder;
mempressure_max is unscoped.

The concept of a short-name is added to the underlying stat structure so
- Calculation is done once, at stat registration time
- The output code can easily determine if a stat has a scope
2 years ago
Jeff Lucovsky 3499029d40 mem/alloc: Replace malloc with calloc
Minor cleanup so SCCalloc is used in preference to SCMalloc.
2 years ago
Jeff Lucovsky e83e17a28a general/typo: Correct spelling/grammar issues 2 years ago
Jeff Lucovsky 424f12d1b3 schema: Add memcap pressure values
Issue: 6094

This commit extends the EVE schema with memcap_pressure values; these
are included in the stat event type records.
2 years ago
Shivani Bhardwaj 8770431986 dcerpc: accept ALTER_CONTEXT as a valid request
So far, if only the starting request was a DCERPC request, it would be
considered DCERPC traffic. Since ALTER_CONTEXT is a valid request type,
it should be accepted too.

Reported and patch proposed in the following Redmine ticket by
InterNALXz.

Bug 6191
2 years ago
Lukas Sismis ff8bbda53b dpdk: treat unknown socket ID as a valid socket ID
Ticket: #6232
2 years ago
Lukas Sismis 223356bfb5 dpdk: fix DPDK thread check for IPS mode
Ticket: #6233
2 years ago
Juliana Fajardini f16d428fd1 userguide/upgrade: link to exception policy FAQ
With the release of 7, people are starting to have issues with traffic
being blocked. While we don't add a more expansive documentation for
this, add a link to the FAQ covering possible fixes for drops caused by
the fail closed default behavior of the exception policies.
2 years ago
Philippe Antoine b12a35c3cf output: add storing boolean for files
When filestore keyword is triggered, the file is not yet stored,
when the alert is generated, but only marked for storing.

Ticket: 4881
2 years ago
Philippe Antoine f35052941d jsonschema: add missing field .files[].file_id 2 years ago
Philippe Antoine 805b07fa42 src: checks to avoid divisions by zero
Ticket: #5920
2 years ago
Philippe Antoine 4bb2241f56 profiling: fix check to compute average bytes 2 years ago
Victor Julien 1f9767a9cb stats: add drop reason counters
{
  "accepted": 296185,
  "blocked": 162,
  "rejected": 0,
  "replaced": 0,
  "drop_reason": {
    "decode_error": 0,
    "defrag_error": 0,
    "defrag_memcap": 0,
    "flow_memcap": 0,
    "flow_drop": 94,
    "applayer_error": 0,
    "applayer_memcap": 0,
    "rules": 3,
    "threshold_detection_filter": 0,
    "stream_error": 63,
    "stream_memcap": 0,
    "stream_midstream": 2,
    "nfq_error": 0,
    "tunnel_packet_drop": 0
  }
}

Ticket: #6230.
2 years ago
Victor Julien d56f34370d stats: update ips capture counters centrally
This adds support to all capture methods for these counters.

The updates happen only on "real" packets, not on encapsulated
packets.

Ticket: #4756.
2 years ago
Victor Julien 6a1138e2b1 stats: register ips capture stats for each packet thread
ReleasePacket based verdicts can happen in several threads,
depending on the runmode details.

Only register and update if in IPS mode.
2 years ago
Victor Julien 735c37c668 eve/schema: add ips capture stats 2 years ago
Victor Julien ece1cb3e94 stats: simplify ips capture stats logic
Since many implementations use the ReleasePacket callback to issue
their verdict, no thread ctx is available. To work around this
just register the stats in a `thread_local` variable instead.
2 years ago
Victor Julien 8b018818a6 mime: replace small memcpy with loop
To address:

      In file included from /usr/include/string.h:535,
                 from suricata-common.h:108,
                 from util-decode-mime.c:26:
In function ‘memcpy’,
    inlined from ‘ProcessBase64Remainder’ at util-decode-mime.c:1201:13:
/usr/include/mipsel-linux-gnu/bits/string_fortified.h:29:10: warning: ‘__builtin_memcpy’ forming offset 4 is out of the bounds [0, 4] of object ‘block’ with type ‘uint8_t[4]’ {aka ‘unsigned char[4]’} [-Warray-bounds=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
util-decode-mime.c: In function ‘ProcessBase64Remainder’:
util-decode-mime.c:1174:13: note: ‘block’ declared here
 1174 |     uint8_t block[B64_BLOCK];
      |             ^~~~~

Copy data should be <= 4 bytes.
2 years ago
Victor Julien 73b0efb03a detect: fix minor compile warning
detect-engine.c: In function ‘DetectKeywordCtxHashFunc’:
detect-engine.c:3550:75: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 3550 |     uint64_t hash = StringHashDjb2((const uint8_t *)name, strlen(name)) + (uint64_t)ctx->data;
      |
2 years ago
Victor Julien b1535fe1f9 sysfs: fix minor compile warning
Seen in Debian QA on mipsel.

util-sysfs.c: In function ‘SysFsWriteValue’:
util-sysfs.c:50:45: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int64_t’ {aka ‘long long int’} [-Wformat=]
   50 |     snprintf(sentence, sizeof(sentence), "%ld", value);
      |                                           ~~^   ~~~~~
      |                                             |   |
      |                                             |   int64_t {aka long long int}
      |                                             long int
      |                                           %lld
2 years ago
Cole Dishington 1b08c561f6 decode-ipv6: Set L4 proto on ipv6 incase of GRE decode error
Set the L4 proto before decoding GRE in ipv6 decoding in case there is a
GRE header decoding error.

Bug: #6222
2 years ago
Philippe Antoine fdf9cdf400 decode: fix offset for DCE layer
Fixes: 136d351e40 ("decode: single network layer entrypoint")

Ticket: #3637
2 years ago
Jeff Lucovsky 9a33c536c0 detect/include: Remove unnecessary includes 2 years ago
Victor Julien 5c10ea2dc8 version: start development towards 7.0.1 2 years ago
Shivani Bhardwaj 21ec99aa76 release: 7.0.0; update changelog 2 years ago
Jeff Lucovsky 9fd77c737f detect/multi-tenant: Make tenant_id 32 bits everywhere
Issue: 6047

This commit ensures that the tenant id is contained in a unsigned 32 bit
container.
2 years ago
Jeff Lucovsky 3286c3b912 detect/pcre: Use local match variables
pcre2 is not thread-safe wrt match objects so use locally scoped
objects.

Issue: 4797
2 years ago
Victor Julien 27aa35cd5b detect/base64_decode: use local pcre2_match_data 2 years ago
Victor Julien e2f4c751aa reference: fix multi-tenant loading issues
Bug: #4797.
2 years ago
Victor Julien 2859eeae81 classification: fix multi-tenant loading issues
Move pcre2 data structures used for parsing into the detect engine
context, so that multiple tenant loading threads don't use the same
data structures.

Bug: #4797.
2 years ago
Juliana Fajardini 24745b3a73 doc/userguide: update ref to installation from git
It was still pointing to the redmine wiki and the documentation to be
truthful to the new documentation.
2 years ago
Juliana Fajardini 049aed529f meta-docs: update links
Readme and PR template was still pointing to the redmine wiki and
readthedocs, replace with docs.suricata links.
2 years ago