Commit Graph

12326 Commits (9cc92b8dd59ea97e0a9051542d34680e53afc31b)
 

Author SHA1 Message Date
Philippe Antoine 9cc92b8dd5 http2: support padded data frames
Ticket: #5691
(cherry picked from commit c6349d3cfc)
4 years ago
Jason Ish e9a0ac187c afpacket/netmap: warn about mixed ips, ids/tap deprecation
Suricata already logs if AF_PACKET or Netmap are running in a mixed IPS
and IDS/TAP mode.  As the behavior is undefined when these modes are
mixed, it is best to deprecate and to not allow this behavior. For now
warn that it will be unsupported and fail in Suricata 8.

Ticket: 5587
(cherry picked from commit 0c00f28ebc)
4 years ago
Jason Ish 10e3c151f6 readthedocs: enable all formats
Ticket: #5654
4 years ago
Philippe Antoine 0ca12493e3 mime: handles multiple sections for a parameter
Ticket: 4386

as per RFC2231.
For instance filename can be split between filename*0,
filename*1, etc...

(cherry picked from commit 784558df2e)
4 years ago
Philippe Antoine 55781229d7 mime: move FindMimeHeaderTokenRestrict to rust
Also fixes the case where the token name is present
in a value

(cherry picked from commit 8feb9c35ae)
4 years ago
Jeff Lucovsky 26b78abc0f netmap: allow specifying a library directory
Ticket: #4482
(cherry picked from commit 142a579971)
4 years ago
Jeff Lucovsky ca5a3d6d78 config/netmap: Permit selection of new/legacy APIs 4 years ago
Jeff Lucovsky 1ba259450b netmap: V14 API changes
This commit modifies the Netmap packet handling to use API version 14.

@bmeeks8 contributed many changes instrumental to this effort.

(cherry picked from commit ca7d097225)
4 years ago
Jeff Lucovsky 5d0fe15f69 util: Add sys/ioctl.h to common include
This commit adds another system include file based on autoconf to the
common Suricata include file for convenience.

(cherry picked from commit 3496e543af)
4 years ago
Victor Julien 2c0d3d715f version: development is towards 6.0.9 4 years ago
Victor Julien 778faaed96 detect: apply drops to tunnel root
`PacketDrop` applied a DROP to the current packet unconditionally,
while in tunnel/encapsulated cases the DROP should have been applied
to the root packet.

Fixes: 6742ecbc9e ("decode: make PacketDrop use action as parameter")

Bug: #5600.
4 years ago
Philippe Antoine bcd8d7d6c4 threshold: fix regex to accept by_both and by_rule
As is done in detect-threshold.c or in DETECT_RATE_REGEX
and is expected by switch (rule_type) which makes the same
for THRESHOLD_TYPE_THRESHOLD and THRESHOLD_TYPE_RATE

Ticket: #5327
(cherry picked from commit a2f857ed90)
4 years ago
Lukas Sismis 694d65f937 docs: replace Openhub reference 4 years ago
Lukas Sismis 12cc71447f transversal: backport: replace remaining website references 4 years ago
Lukas Sismis afbd68ad22 transversal: remove suricata-ids.org references
(cherry picked from commit e101384e7b)
4 years ago
Eric Leblond 50f0b6acac flow: fix FlowSwapFileFlags function
Ticket: #5625
(cherry picked from commit 4e1ff9a7ff)
4 years ago
Victor Julien a5bc56cecb detect/tag: improve time handling on windows
Bug: #5584.
(cherry picked from commit 0977f40d1c)
4 years ago
Victor Julien 985b93e80f eve: log mac addresses in packet direction
(cherry picked from commit 90f3823cad)
4 years ago
Victor Julien 84536b0b69 release: 6.0.8; update changelog
Re-releasing 6.0.7 with the correct libhtp and Suricata-Update versions.
4 years ago
Shivani Bhardwaj 8d62ca8fb0 release: 6.0.7; update changelog 4 years ago
Victor Julien 3570ec6f6e stream: fix reachable assertion
Fix `Flow::thread_id` not always getting properly set up, leading to
a reachable assertion.

Bug #4582.

(cherry picked from commit b06c0579f5)
4 years ago
Juliana Fajardini 21492a419e userguide: add section about exception policies
This describes briefly what the exception policies are, what is the
engine's behavior, what options are available and to which parts are
they implemented.

Task #5475
Task #5515
4 years ago
Juliana Fajardini 9e571b6a13 userguide: minor rewording and typo fixes
Some of these were recently introduced, some were highlited after the
applayer sections got merged. Some paragraphs seem to have been changed
due to trying to respect character limits for lines. Also includes a
typo pointed out by one of our community members via Discord.
4 years ago
Juliana Fajardini aafbf368ac stream/tcp: typo fix 4 years ago
Philippe Antoine 047661a5cb source: pcap timestamp microsecond consistency
That is it should be less than 1 000 000.
Have the same for fuzz targets where the bug came from.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44177
(cherry picked from commit 8ecf7e403e)
4 years ago
Philippe Antoine c31d3592a4 flow/icmpv4: fix vlan.use-for-tracking
For ICMPv4 error messages the vlan ids were always considered,
even if the 'vlan.use-for-tracking' option was disabled.

Ticket: #5330
(cherry picked from commit ce2775d331)
4 years ago
Jason Ish bb848069e4 requirements: use suricata-update 1.2.5 4 years ago
Jason Ish 0ca09ecbcd detect: fix user after free in debug log
Found by gcc 12.2.1.
4 years ago
Philippe Antoine 40d1bb3422 mqtt: remove quadratic time complexity
When having many transactions in a single parsing call...

Fix has overhead of having one more field in the mqtt state.

Completes commit a8079dc978

Ticket: #5399
(cherry picked from commit e160917bcf)
4 years ago
Jeff Lucovsky ba37574ca5 mqtt: convert transaction list to vecdeque
Ticket: 5430
4 years ago
Philippe Antoine 18c616394e mqtt: make max transactions configurable
Allows users to find balance between completeness of decoding
and increases resource consumption, which can DOS suricata.

(cherry picked from commit e42094f238)
4 years ago
Philippe Antoine e029f80af2 mqtt: limits the number of active transactions per flow
Ticket: 4530

So, that we do not get DOS by quadratic complexity, while
looking for a new pkt_id over the ever growing list
of active transactions

(cherry picked from commit a8079dc978)
4 years ago
Victor Julien 7183e766f9 detect/flowbits: more permissive parsing by default
To get strict parsing, `--strict-rule-keywords=flowbits` command line
option can be used.

Bug: #5547.
4 years ago
Jason Ish 8174ba9e6f content: don't error out on incomplete hex
Before 6.0.6 if hex content was incomplete, Suricata didn't error out.
With 6.0.6 incomplete hex was detected and errored on which is a
breaking change in a release branch.  Instead, only emit a warning
unless strict content checking has been requested.

To enable strict behaviour on incomplete content hex in a rule,
"--strict-rule-keywords=content" can be used on the command line.

Issue: #5546
4 years ago
Jason Ish 726de4e70c detect: allow rule errors to display error, but not be fatal
Add a new setup return code, -4 which will print the error, but not
error out in test mode. This is to support allowing incomplete hex, as
there is no context as to which rule had the issue.

For context:
- -3: error ok, no message
- -2: error not ok, no message
- -4: error ok, message
4 years ago
Victor Julien f40ad90adf detect: fix duplicate detect state issue
For protocols with multi buffer inspection there could be multiple times
the same sid would be queued into the candidates queue. This triggered
a debug validation check.

W/o debug validation this would lead to duplicate work and possibly multiple
alerts where a single one would be appropriate.

Bug: 5419.
(cherry picked from commit 1bff888947)
4 years ago
Philippe Antoine dbadca1567 detect: transforms check for 0-sized buffer
So as to avoid undefined behavior with a 0-sized variable length
array

Ticket: #5521
(cherry picked from commit 61b73416e2)
4 years ago
Juliana Fajardini fff9d529b7 exceptions: add reject support to exception policy
This enables the usage of 'reject' as an exception policy. As for both
IPS and IDS modes the intended result of sending a reject packet is to
reject the related flow, this will effectively mean setting the reject
action to the packet that triggered the exception condition, and then
dropping the associated flow.

Task #5503

(cherry picked from commit bbd968c738)
4 years ago
Victor Julien 336cd57234 stream/ids: make sure we don't slide past last_ack
Bug: #5401.
(cherry picked from commit f04b7a1827)
4 years ago
Victor Julien a383f29aa2 decode/tcp: allow 4 byte TFO with 2 byte cookie
(cherry picked from commit f5bd55dac8)
4 years ago
Gleb Smirnoff ae9b4144be ipfw: use PF_DIVERT on modern FreeBSD
(cherry picked from commit 5dbbc52b06)
4 years ago
Victor Julien d483ace444 unittests: optimize RunmodeIsUnittests()
(cherry picked from commit 86e600dab8)
4 years ago
Philippe Antoine 16da02cfbd http2: remove to_vec for comparisons
Ticket: #5454
(cherry picked from commit 9b4a133777)

Conflict fixed by Philippe Antoine
4 years ago
Philippe Antoine eae0aadab8 http2: fix clippy warning about &Vec<u8>
Using &[u8] instead in function prototype

(cherry picked from commit d011b468da)

Conflict fixed by Philippe Antoine
4 years ago
Victor Julien 275975c699 github-ci: add cherry-pick line check 4 years ago
Victor Julien 0a6e2b9d1a flow/recycler: bring back pthread_cond_t sleep
Bug #4379.

(cherry picked from commit f271fb4575)
4 years ago
Victor Julien 33446b0f64 flow/manager: sleep handled by pthread_cond_t again
Use only in live mode to allow FM to respond quickly to time
increases in offline mode.

Bug #4379.

(cherry picked from commit e6ac2e4e8a)
4 years ago
Victor Julien bb8f743870 time: add timeradd implementation
timeradd isn't available on MinGW.

(cherry picked from commit 39141a8836)
4 years ago
Philippe Antoine 739eba94a5 fuzz: restrict flags passed to AppLayerProtoDetectGetProto
Manual adaptation of 05f9b3f and f4449d3
4 years ago
Philippe Antoine ed15b0d6ab http2: check overflow before it happens
instead of checking afterwards if value got smaller

(cherry picked from commit b86beb9b68)

Manually adapted to make it work with MSRV
4 years ago