Commit Graph

13211 Commits (2abce12b5b2ae6cf3355e8ea5a48f0b2f6581d60)
 

Author SHA1 Message Date
Victor Julien 2abce12b5b eve/schema: add missing smb fields 3 years ago
Victor Julien b24e1f1e46 eve/schema: add missing drop fields for ipv6 3 years ago
Victor Julien 6ad5d6a148 eve/schema: add profiling detect fields 3 years ago
Lukas Sismis 8845c07a90 bypass: af-packet: fix memory leak - reassign of EBPFBypassData
AF-Packet bypass function in some situations allocates EBPF bypass data
for an already bypassed flow and assigns it to the flow without any checks

Issue: #5368
3 years ago
Lukas Sismis 05797c45bb bypass: fix memory leak - reassign of FlowBypassInfo
In some situations bypass callback is called on already bypassed
flow. This allocates FlowBypassInfo structure for the flow but
does not check if the flow already has one.

Issue: #5368
3 years ago
Victor Julien 2486d29adb napatech: fix conf API call 3 years ago
Victor Julien 8580499ded exceptions: initial exception-policy implementation
Adds a framework for setting exception policies. These would be called
when the engine reaches some kind of exception condition, like hitting
a memcap or some traffic processing error.

The policy gives control over what should happen next: drop the packet,
drop the packet and flow, bypass, etc.

Implements the policy for:

    stream: If stream session or reassembly memcaps are hit call the
    memcap policy on the packet and flow.

    flow: Apply policy when memcap is reached and no flow could be
    freed up.

    defrag: Apply policy when no tracker could be picked up.

    app-layer: Apply ppolicy if a parser reaches an error state.

All options default to 'ignore', which means the default behavior
is unchanged.

Adds commandline options: add simulation options for exceptions. These
are only exposed if compiled with `--enable-debug`.

Ticket: #5214.
Ticket: #5215.
Ticket: #5216.
Ticket: #5218.
Ticket: #5194.
3 years ago
Victor Julien 4567995678 decode: add pass action wrapper 3 years ago
Victor Julien d81ad78444 decode: turn no payload/packet inspect macros into funcs
Remove unused unset macros.
3 years ago
Victor Julien 0035673208 eve/drop: log drop reason
Ticket: #5202.
3 years ago
Victor Julien 55fb2d5d2d stream/tests: remove bad test; update failing test to new behavior 3 years ago
Victor Julien 2d64ec6585 stream: clarify error handling comment 3 years ago
Victor Julien b6cf79901a stream/reassemble: clarify error handling 3 years ago
Victor Julien f34845858c stream: remove now unused tcp.insert_list_fail counter 3 years ago
Victor Julien 13554f7e44 stream/segtree: simplify error handling
Now that spurious retransmissions don't propegate into the reassembly
code, error handling can be simplified.
3 years ago
Victor Julien d8edea904c stream/rules: add example rule for pkt_spurious_retransmission 3 years ago
Victor Julien cc4e8f0936 stream: detect spurious retransmissions early 3 years ago
dependabot[bot] 8377b9dc7c github-actions: bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
jason taylor 05bca0b6fb config: update commented value to default status
Signed-off-by: jason taylor <jtfas90@gmail.com>
3 years ago
Victor Julien 84448d3bae tests: remove unnecessary flow locks
Added once to satisfy debug validation, but we don't mix unittests
and debug validation anymore.

    sed -i -E '/.*FLOWLOCK_.*LOCK/d' *.c
3 years ago
Victor Julien 579547c849 smtp: minor line loop cleanup 3 years ago
Victor Julien 96bb67f474 smtp: remove defunct check for line with single LF
Don't fix it as DATA processing needs all the bytes.
3 years ago
Victor Julien a2924b7141 smtp: constify line arguments where possible 3 years ago
Victor Julien e0d5878e49 smtp: move current line out of state 3 years ago
Victor Julien 1451bd62a6 smtp: move input out of state 3 years ago
Victor Julien 77fae275ef smtp: turn assertions in to debug asserts 3 years ago
Victor Julien 3a631085bb smtp: simplify preprocess loop 3 years ago
Victor Julien 30e47b2171 mime/base64: decode cleanups and simplification
Addresses edge case: > 4 bytes at the end of the input with 2 or more
spaces.

Changes length type for remainder processing to allow for much longer
lines, which can happen in practice.

Adds a series of debug validation checks with real error handling
as well, to assist the fuzzer to find more edge cases.
3 years ago
Victor Julien 92cd95b416 base64: no special case for nul char
Let it be handled like other invalid input.
3 years ago
Shivani Bhardwaj 5b27619778 base64: make decoder handle decoded data space constraints
So far, it was the job of caller to send the bae64 decoder a perfect
block of data and take care of the destination buffer (decoded data)
size. Now, make it the decoder's job to take care of any space
constraints that the destination buffer may have and return accordingly.

Also, handle space characters in base64 encoded data as per RFC 2045.

Update MIME parser accordingly to handle the base64 data.

Ticket: 5315
3 years ago
Shivani Bhardwaj cb01cc6929 base64: add Base64Ecode enum 3 years ago
Shivani Bhardwaj 9131d1d857 base64: add Base64Mode enum 3 years ago
Shivani Bhardwaj 1e3282f363 smtp: treat CR as a line terminator
The ideal line terminator for an SMTP line is <CRLF>. But, given that
bare LF is still allowed by many systems despite the prohibition by
standards, we have to consider that. In order to simplify things, we
consider bare CR as line terminators as well while updating the
delimiter parameter correctly if they were to be followed by a LF
immediately or as a part of next fragment.

This takes care of some edge cases that made base64 decoder error out
because unexpected data was sent to it at times.

Ticket: 5316
3 years ago
BACK Yonah 42a661f028 ci: adds CodeQL workflow and LGTM support
Ticket: #5307
3 years ago
dependabot[bot] 51c78680d2 github-actions: bump ossf/scorecard-action from 1.1.0 to 1.1.1
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](5c8bc69dc8...3e15ea8318)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 41314e0830 github-actions: bump github/codeql-action from 2.1.11 to 2.1.12
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.11 to 2.1.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](a3a6c128d7...27ea8f8fe5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Philippe Antoine d1a4dae36b detect: use generic integer functions for streamsize
By the way, adds the prefilter feature

Ticket: #2697
Ticket: #4112
3 years ago
Philippe Antoine 35b6dcec7e detect: use generic integer functions for filesize
Ticket: #4112
3 years ago
Philippe Antoine bfdf5b1952 detect: use generic integer functions for tcp mss
Ticket: #4112
3 years ago
Philippe Antoine 025b510cac detect: use generic integer functions for template2 3 years ago
Philippe Antoine 261eebba12 detect: use generic integer functions for ttl
Ticket: #4112
3 years ago
Philippe Antoine 2b0be91f28 detect: use generic integer functions for dsize
Ticket: #4112
3 years ago
Philippe Antoine f29b43defd detect: rust generic functions for integers
Move it away from http2 to generic core crate.
And use it for DCERPC (and SMB)

And remove the C version.
Main change in API is the free function is not free itself, but
a rust wrapper around unbox.

Ticket: #4112
3 years ago
Philippe Antoine c4d9cb02ec util: better hex print function
Without dangerous snprintf pattern identified by CodeQL
even if this pattern is not a problem in those precise cases,
it may easily get copy pasted in a dangerous place, so better
get rid of it and make CodeQL happy
3 years ago
Philippe Antoine 6058792bee rust: make suricata context const
So that it is read only and its pointers do not get modified
3 years ago
Philippe Antoine 5a00acece2 ftp: remove temporary fields from state
As input, input_len and direction only last for the scope of
one call of AppLayerParserParse, it is not necessary to keep them
in FtpState which lives longer, so we consume less memory.
3 years ago
Philippe Antoine 6224e283fa modbus: bump up rust crate version
So that probing parser is more strict and does not accept unknown
function code as valid modbus.

Ticket: #5377
3 years ago
Jason Ish c8a5207083 detect: introduce "like" ip-only signature type
Rules that look like they should be IP-only but contain a negated rule
address are now marked with an LIKE_IPONLY flag. This is so they are
treated like IPONLY rules with respect to flow action, but don't
interfere with other IPONLY processing like using the radix tree.

Ticket: #5361
3 years ago
Philippe Antoine d5abaf0b38 decode: fix integer warning
Newly introduced warning.
Regular cast as value is checked just before.

Ticket: #4516
3 years ago
Philippe Antoine 717e51b7cf defrag: fix integer warnings
Ticket: #4516
3 years ago