Commit Graph

11834 Commits (00eadac27777fc6a299185319d93ca89a600f251)
 

Author SHA1 Message Date
Philippe Antoine 00eadac277 http2: http.uri keyword now works for HTTP2
cf #4067

(cherry picked from commit a98d0fe6ed)
5 years ago
Philippe Antoine 333a512269 http2: allow http1 keywords for http2 traffic
Adding a special case in DetectSignatureSetAppProto
5 years ago
Philippe Antoine 88c5e12ae9 http2: only mimic http1 request if there is one
That may not be the case in midstream/async configurations

(cherry picked from commit d00b755b64)
5 years ago
Mats Klepsland 1ff75718ee thresholds: Fix buffer overflow in threshold context
th_entry is resized using ThresholdHashRealloc() every time a rule with
a threshold using by_rule tracking is added. The problem is that this is
done before the rules are reordered, so occasionally a rule with by_rule
tracking gets a higher signature number (after reordering) than the
number of th_entries allocated, causing Suricata to crash.

This commit fixes this by allocating th_entries after all the rules are
loaded and reordered.

Backtrace from core dump:

  Program terminated with signal SIGSEGV, Segmentation fault.

  #0  0x000000000051b381 in ThresholdHandlePacket (p=p@entry=0x7fb0080f3960, lookup_tsh=0x51, new_tsh=new_tsh@entry=0x7fb016c316e0, td=td@entry=0x14adedf0, sid=9800979, gid=1, pa=0x7fb0080f3b18)
      at detect-engine-threshold.c:415
  415>----                if (TIMEVAL_DIFF_SEC(p->ts, lookup_tsh->tv1) < td->seconds) {

Bug #4503.

(cherry picked from commit 2a326421aa)
5 years ago
Mats Klepsland f32177e215 thresholds: syntax fixes
Fix syntax of if statement in SigGetThresholdTypeIter()

(cherry picked from commit f47e4375b3)
5 years ago
Mats Klepsland 4db179f2a3 thresholds: remove unneeded function argument
Remove packet pointer from SigGetThresholdTypeIter() as it is
unused.

(cherry picked from commit b0b4fab794)
5 years ago
Philippe Antoine 9aa5c6aff0 rust: fix app-layer parser flags
This especially allows for SSH bypass to work

(cherry picked from commit fdab22d924)
5 years ago
Philippe Antoine 437b7d3348 ftp: completely parses pasv and epsv responses
(cherry picked from commit ca6e434e0b)
5 years ago
Jason Ish 1d667c3c44 unix-socket: reset to ready state on startup
As part of commit ea15282f47,
some initialization was moved to happen even in unix socket mode,
however, this initialization does setup some loggers that can only have
one instance enabled (anomaly, drop, file-store).

This will cause these loggers to error out on the first pcap, but work
on subsequent runs of the pcap as some deinitialization is done after
each pcap.

This fix just runs the post pcap-file deinitialization routine to
reset some of the initialization done on startup, like is done after
running each pcap in unix socket mode.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4225

Additionally this prevents alerts from being logged two times
on the first run of a pcap through the unix socket:

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4434

(cherry picked from commit 488d5fb342)
5 years ago
Philippe Antoine e0764e1e12 http2: make decompression a configure-time option 5 years ago
Philippe Antoine 56bda0f9cb http2: have filecontainer for both directions
(cherry picked from commit 6fe8bce3b0)
5 years ago
Philippe Antoine 2504b96c48 http2: adds check about dynamic headers table size
(cherry picked from commit 3de0123ffb)
5 years ago
Victor Julien a3f94435d3 http2: remove dead code
(cherry picked from commit de280c47d9)
5 years ago
Philippe Antoine eb250e5512 http2: remove assertion which can be wrong
Brotli decoder stops consuming input it it reaches the
end of its input

(cherry picked from commit b3c502d572)
5 years ago
Philippe Antoine 6109855bca http2: pass data through when decompression fails
as is done for HTTP1

(cherry picked from commit 1ca4f041bb)
5 years ago
Philippe Antoine 899a9b8e17 http2: decompression for files
gzip and brotli decompression for files

(cherry picked from commit d861228214)
5 years ago
Philippe Antoine 0e6ffb966f rust: BIT_U16 macro utility
(cherry picked from commit 2e46b5d100)
5 years ago
Philippe Antoine 9287f6ae7f rust: better panic message for missing file config
(cherry picked from commit aee8e60149)
5 years ago
Jeff Lucovsky 301bc0d120 decode/vntag: By default, disable vntag decoding
This commit makes the VNTag decoder off by default.
5 years ago
Jeff Lucovsky a3a105fe90 decode/vntag: Add VNTag decoder logic
(cherry picked from commit 0f0cb5169f)
5 years ago
Jeff Lucovsky 11de7663ba tests/vntag: VNTAG decoder unittests
(cherry picked from commit 596d760833)
5 years ago
Jeff Lucovsky 3adb7d9063 decode/vntag: VNTAG 802.1Qbh decoder
(cherry picked from commit 713bace44f)
5 years ago
Jeff Lucovsky d29270c702 decode/stats: VNTAG stats
(cherry picked from commit b944e636a8)
5 years ago
Jeff Lucovsky 4c07af4450 decode/events: VNTAG decoder events
(cherry picked from commit 1ddad0a0d6)
5 years ago
Jeff Lucovsky 216d836b12 decode: Add ethertype for VNTAG
(cherry picked from commit 049afde3a2)
5 years ago
Shivani Bhardwaj dda131a059 github: Update codeowner handle
(cherry picked from commit 0c5a8fb35d)
5 years ago
Jason Ish a8e1172e7f rust: pin memchr to ~2.3
2.4+ requires a newer version of Rust.
5 years ago
Jason Ish 50d9089eb0 makefile: don't include the whole test/ directory
Including the whole directory results in .deps files ending up
in the distribution archive which shouldn't be there. Instead
we have to list all the test sources individually.

Backport of 70b21df756.
5 years ago
Philippe Antoine 76a981f7a2 rdp: correctly returns incomplete in parse_tc
Adding the already consumed bytes
In case an incomplete tls handshake is handled with/after
a refular rdp t123_tpkt

(cherry picked from commit 6da9a37285)
5 years ago
Philippe Antoine 1e786f941b ftp: fixes leak with duplicate expectation
(cherry picked from commit 68d6922e3c)
5 years ago
Jeff Lucovsky 3535cdbc02 output/log: Ensure files closed in threaded mode
This commit ensures that file objects are closed in threaded mode.

(cherry picked from commit 38ae21a196)
5 years ago
Jeff Lucovsky 5394126b10 output/log: Removed pcie (Tilera) log vestiges
This commit removes the last remnants of the Tilera log output mechanism
(unsupported since 5.0.x).

(cherry picked from commit aa9ad56a5b)
5 years ago
Luke Coughlan 3f53e0bb2f flow/bypass: Properly set the ICMP emergency-bypassed value
Currently the ICMP emergency-bypassed value defined in suricata.conf is
overwriting the UDP value rather than correctly setting it for ICMP.
This commit corrects this bug so that the ICMP value can be set as
expected.

(cherry picked from commit 7fb56a9075)
5 years ago
Philippe Antoine effa7ac54f kerberos: fix probing parser tag condition
according to the comment

(cherry picked from commit cb150e97d0)
5 years ago
Victor Julien bef816e03f detect/alert: apply pd only actions to flow
Ticket #4394

(cherry picked from commit 6cf44fc839)
5 years ago
Victor Julien a0f8321686 detect/alert: minor code refactor
Use a simpler reject check and move logic into util func.

(cherry picked from commit 6c594d29db)
5 years ago
Victor Julien bb5a7d597b detect/iponly: don't check & set flow flags twice
Per flow IP-only flags are checked and set by IP-only engine, so
no need to set/check them per alert.

(cherry picked from commit fbcdd2ec26)
5 years ago
Jeff Lucovsky 5e0acd594e threshold-config: Improve support for big IP lists
(cherry picked from commit ef62761e8c)
5 years ago
Jeff Lucovsky 7b6d6054b3 detect/threshold: Improve threshold.config perf
This commit improves performance when parsing threshold.config by
removing a loop-invariant to create a one-time object with the parsed
address(es).

Then, as needed, copies of this object are made as the suppression
rule(s) are processed.

(cherry picked from commit 02ceac8b8d)
5 years ago
Jeff Lucovsky 1233e922e1 detect/threshold: Function to deep-copy thresh obj
This commit adds a function to make a deep copy of a DetectThresholdData
object.

The function is used when parsing threshold.config items to make a
one-time object and then add copies as needed.

(cherry picked from commit e873632a28)
5 years ago
Jeff Lucovsky 7f5bc37e5c detect/address: Expose DetectAddressCopy function
(cherry picked from commit 11f9cc6524)
5 years ago
Jeff Lucovsky d8a26849b5 general: Typo cleanup
(cherry picked from commit 2893b04ab0)
5 years ago
Victor Julien 7ca30e5b7e eve/drop: use highest priority drop
When adding the alert to a drop record make sure the add the highest
priority.

It would until now add all drops from high to low prio, effectively
overwriting the record each time.

Ticket #4397

(cherry picked from commit 398ebf9345)
5 years ago
Jason Ish 01ec2ed674 misc: include queue.h before other headers
At least on FreeBSD, some other include is including "sys/queue.h"
which results in FreeBSDs /usr/include/sys/queue.h being picked
up and setting __SYS_QUEUE_H__ so our queue.h is not picked up.

But the FreeBSD queue.h does not have the CIRCLEQ definitions. To
fix just include our queue.h first, which also sets __SYS_QUEUE_H__
preventing the system one from being picked up.

(cherry picked from commit d4554ec6bb)
5 years ago
Jason Ish 0856b23758 tx: fix unidir tx cleanup
A unidirection protocol parser should only have its transactions
marked as "skipped" if it is skipped in both the TS and TC
directions, otherwise unidir transactions are always considered
skipped and the cleanup will never updates its minimum id.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4437

(cherry picked from commit afaa18c5ad)
5 years ago
Jason Ish c23ea17d6b eve/mqtt: fix mqtt logging with threaded eve
Mqtt was not setting up a per-thread file context for logging
in threaded mode, leading a crash when used in threaded mode.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4404

(cherry picked from commit 64330498f8)
6 years ago
Victor Julien e6262b737a ci: make format check use 6.0.x branch 6 years ago
Victor Julien 42c65c77d6 detect/icmp: reject invalid rules for icode/itype
(cherry picked from commit 68f8b2f40f)
6 years ago
Victor Julien 19f383025b detect/prefilter: fix null ptr deref on invalid rule
A bad rule 'icode:<0; prefilter;' would trigger a null ptr deref
in ApplyToU8Hash.

Bug #4375.

(cherry picked from commit 7d6835958b)
6 years ago
Victor Julien 7ce77213cd version: start development towards 6.0.3 6 years ago