]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Thu, 28 Jul 2022 06:20:55 +0000 (08:20 +0200)]
detect/cip: cleanup includes
Philippe Antoine [Mon, 4 Jul 2022 13:28:39 +0000 (15:28 +0200)]
quic: do not log empty cyu array
Ticket: #5167
Philippe Antoine [Mon, 4 Jul 2022 08:51:15 +0000 (10:51 +0200)]
dnp3: do not log empty objects array
Ticket: #5167
Philippe Antoine [Fri, 1 Jul 2022 19:28:12 +0000 (21:28 +0200)]
ike: do not log empty notify array
Ticket: #5167
Philippe Antoine [Fri, 1 Jul 2022 13:56:29 +0000 (15:56 +0200)]
mqtt: do not log reason_codes if there is none
Ticket: #5167
Philippe Antoine [Fri, 1 Jul 2022 13:52:33 +0000 (15:52 +0200)]
output: do not log empty arrays for sid
Ticket: #5167
Jufajardini Reichow [Mon, 11 Jul 2022 23:04:57 +0000 (20:04 -0300)]
userguide: fix typo in inline mode illustration
The image describing Suricata's sliding window had two of the "packets"
with the same text. Now they actually give the sense of a sliding
window.
This was found by Zhiyuan-liao.
dependabot[bot] [Thu, 14 Jul 2022 19:33:33 +0000 (19:33 +0000)]
github-actions: bump actions/cache from 3.0.4 to 3.0.5
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/
c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d ...
0865c47f36e68161719c5b124609996bb5c40129 )
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Philippe Antoine [Wed, 6 Jul 2022 13:27:10 +0000 (15:27 +0200)]
threads: cleaner code with one instruction per line
As reported by Shchelk
Victor Julien [Wed, 27 Jul 2022 14:05:08 +0000 (16:05 +0200)]
detect: reduce datatype scope for various keywords
Victor Julien [Wed, 27 Jul 2022 14:04:17 +0000 (16:04 +0200)]
detect/cip: remove dead code
Victor Julien [Wed, 27 Jul 2022 12:14:36 +0000 (14:14 +0200)]
detect: update copyright years
Victor Julien [Wed, 27 Jul 2022 06:37:20 +0000 (08:37 +0200)]
includes: minor cleanups
Victor Julien [Wed, 27 Jul 2022 06:10:09 +0000 (08:10 +0200)]
profiling: minor code cleanups
Philippe Antoine [Tue, 26 Jul 2022 14:13:52 +0000 (16:13 +0200)]
ci: checks include are necessary in github
Philippe Antoine [Tue, 26 Jul 2022 13:17:56 +0000 (15:17 +0200)]
util: fix integer warnings in profiling
Philippe Antoine [Mon, 27 Jun 2022 11:20:29 +0000 (13:20 +0200)]
src: remove unused header files
Philippe Antoine [Mon, 20 Jun 2022 11:57:18 +0000 (13:57 +0200)]
src: rework includes as per cppclean
Jufajardini Reichow [Mon, 25 Jul 2022 23:47:23 +0000 (20:47 -0300)]
detect/engine: init alert queue counters on reload
alert_queue_overflow and alerts_suppressed were not being
reinitialized when there was a reload of Suricata rules, leading to
non-valid stats counters if that happened.
Bug #5457
Philippe Antoine [Mon, 4 Jul 2022 08:30:20 +0000 (10:30 +0200)]
output: skip files logging for ICMP packets
Ticket: #5408
Philippe Antoine [Fri, 1 Jul 2022 11:22:38 +0000 (13:22 +0200)]
output: use flow's proto for file loggers
As there can be an ICMP packet which gets related to a TCP flow.
Ticket: #5408
Philippe Antoine [Fri, 1 Jul 2022 11:06:59 +0000 (13:06 +0200)]
fuzz: use forced file store
to find bugs such as 5408
Philippe Antoine [Thu, 28 Apr 2022 14:24:46 +0000 (16:24 +0200)]
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
Philippe Antoine [Fri, 10 Jun 2022 13:17:05 +0000 (15:17 +0200)]
detect/nfs: use inclusive ranges
Philippe Antoine [Thu, 9 Jun 2022 19:11:22 +0000 (21:11 +0200)]
detect: use generic integer functions for itype
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 19:00:34 +0000 (21:00 +0200)]
detect: use generic integer functions for snmp.version
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 18:55:58 +0000 (20:55 +0200)]
detect: use generic integer functions for rfb.sectype
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 18:51:59 +0000 (20:51 +0200)]
detect: use generic integer functions for nfs.version
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 18:43:42 +0000 (20:43 +0200)]
detect: use generic integer functions for nfs.procedure
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 13:42:40 +0000 (15:42 +0200)]
detect: use generic integer functions for iprep
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 12:53:46 +0000 (14:53 +0200)]
detect: use generic integer functions for bsize
Ticket: #4112
Philippe Antoine [Thu, 9 Jun 2022 09:46:38 +0000 (11:46 +0200)]
detect: use generic integer functions for urilen
Ticket: #4112
Philippe Antoine [Fri, 29 Apr 2022 09:58:10 +0000 (11:58 +0200)]
defrag: use util function for timeout
To fix timestamp overflow as found by oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44608
fixu
jason taylor [Sat, 11 Jun 2022 15:36:48 +0000 (11:36 -0400)]
detect: update text for nocase used with http.host
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Wed, 15 Jun 2022 23:00:36 +0000 (23:00 +0000)]
doc: update to include additional rule references
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Mon, 6 Jun 2022 20:05:37 +0000 (20:05 +0000)]
doc: update intro direction content
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 21:51:15 +0000 (21:51 +0000)]
doc: fixed HOME_NET/EXTERNAL example formatting
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 19:50:55 +0000 (19:50 +0000)]
doc: add clarity around HOME_NET/EXTERNAL_NET
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 19:48:00 +0000 (19:48 +0000)]
doc: minor example rule description update
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 19:44:30 +0000 (19:44 +0000)]
doc: minor wording restructure
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 19:08:14 +0000 (19:08 +0000)]
doc: add tcp-pkt/tcp-stream to intro
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 19:01:04 +0000 (19:01 +0000)]
doc: minor punctuation update
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 17:25:35 +0000 (17:25 +0000)]
doc: intro example rule update to simpler example
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Fri, 3 Jun 2022 15:37:22 +0000 (15:37 +0000)]
doc: minor intro wording update
Signed-off-by: jason taylor <jtfas90@gmail.com>
Philippe Antoine [Wed, 29 Jun 2022 19:30:41 +0000 (21:30 +0200)]
snmp: rustfmt detect.rs
Philippe Antoine [Sat, 25 Jun 2022 07:12:31 +0000 (09:12 +0200)]
snmp: adds usm keyword
as is logged
Ticker: #5416
Victor Julien [Thu, 30 Jun 2022 15:13:09 +0000 (17:13 +0200)]
github/codeowners: update
Philippe Antoine [Fri, 29 Apr 2022 11:12:56 +0000 (13:12 +0200)]
ftp: optimized tx iterator
To be more efficient with larger number of transactions.
Ticket: #5314
Victor Julien [Wed, 29 Jun 2022 09:16:43 +0000 (11:16 +0200)]
mime: remove unused length fields
Victor Julien [Tue, 28 Jun 2022 18:20:37 +0000 (20:20 +0200)]
fuzz/mime: fix call conditions and args
The SMTP parser should not supply lines w/o EOL chars to the mime
parser unless its in the BODY parsing stage. Mimic this in the fuzz
target by testing the state for inputs that have no EOL.
Additionally, make sure the delim cnt reflects the missing EOL.
Victor Julien [Tue, 28 Jun 2022 13:29:25 +0000 (15:29 +0200)]
mime: fix corner case
Fix a corner case where a base64 sequence including a space was followed
by a newline in the input data.
Victor Julien [Tue, 28 Jun 2022 13:29:11 +0000 (15:29 +0200)]
mime: add base64 related debug messages
Victor Julien [Tue, 28 Jun 2022 11:07:37 +0000 (13:07 +0200)]
mime: improved empty line handling
Make sure a new body is not set up on empty lines unless it is
a body that is not encoded as base64/quoted printable.
Victor Julien [Tue, 28 Jun 2022 05:46:54 +0000 (07:46 +0200)]
mime: fix and cleanup tests
Line count check was failing after recent delim handling updates.
Victor Julien [Mon, 27 Jun 2022 18:51:53 +0000 (20:51 +0200)]
smtp: fix passing a wrong delim len around
Victor Julien [Mon, 27 Jun 2022 18:15:16 +0000 (20:15 +0200)]
mime: properly pass full lines to non-decoded body
Use actual delim count and make sure we also pass on empty lines
(so delim(s) only).
Victor Julien [Mon, 27 Jun 2022 14:20:02 +0000 (16:20 +0200)]
mime/base64: fix final data not getting processed
If the last data of the body was not a multple of 4 and not padded
to be a multiple of 4, it would not be processed.
Victor Julien [Mon, 27 Jun 2022 09:34:14 +0000 (11:34 +0200)]
stream: fix GAP check
Gap check would consider a GAP when the current data was in fact
exactly not a gap, but next segment(s) were already available.
Victor Julien [Sun, 26 Jun 2022 20:43:38 +0000 (22:43 +0200)]
mime: minor code cleanup
Victor Julien [Sun, 26 Jun 2022 14:25:36 +0000 (16:25 +0200)]
mime: remove unused 'linerem' logic
Victor Julien [Sun, 26 Jun 2022 00:29:34 +0000 (02:29 +0200)]
smtp/mime: fix parsing edge case
Correctly track "remaining" bytes after partial base64 decoding.
Add comment clarifications and debug validation checks.
Victor Julien [Sat, 25 Jun 2022 11:01:37 +0000 (13:01 +0200)]
smtp: skip preprocessing for mime headers
Mime parser doesn't expect partial lines, which preprocessing can
provide. Add a check to let mime headers be handled by regular line
parsing.
Victor Julien [Fri, 17 Jun 2022 11:23:26 +0000 (13:23 +0200)]
eve/schema: add drop.udplen, email fields
Juliana Fajardini [Tue, 28 Jun 2022 20:06:50 +0000 (17:06 -0300)]
source/pcap: fix infinite loop if interface goes down
When in live-pcap mode, if the sniffed interface went down and up again,
Suri would enter an infinite and keep running, while not registering new
events. This fixes that behavior by allowing Suri to retry to open the
pcap in case of a retry on an already activated capture
('PCAP_ERROR_ACTIVATED').
This change is based on Zhiyuan Liao's work.
Bug #3846
dependabot[bot] [Tue, 28 Jun 2022 19:39:06 +0000 (19:39 +0000)]
github-actions: bump ossf/scorecard-action from 1.1.1 to 1.1.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/
3e15ea8318eee9b333819ec77a36aca8d39df13e ...
ce330fde6b1a5c9c75b417e7efc510b822a35564 )
---
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>
Philippe Antoine [Mon, 27 Jun 2022 14:10:51 +0000 (16:10 +0200)]
detect: impose limits on pcrexform
As is done for pcre keyword
Ticket: #5409
Juliana Fajardini [Wed, 22 Dec 2021 12:47:24 +0000 (12:47 +0000)]
devguide: incorporate contribution process page
That page existed only in our redmine. Updated and added a few things,
like a paragraph about our expectations for feature contributors.
Also updated links, contacts and some other processes that may have
changed since last edition.
Added some section labels in related documents, for ease of referencing.
Task #4929
Victor Julien [Thu, 16 Jun 2022 15:27:35 +0000 (17:27 +0200)]
detect: set drop reason for rule based drops
Call `PacketDrop` with drop reason for drops, keep old logic
in place for the rest.
Victor Julien [Thu, 16 Jun 2022 15:07:49 +0000 (17:07 +0200)]
stream: suppress exception policy debug message
Victor Julien [Fri, 10 Jun 2022 08:34:47 +0000 (10:34 +0200)]
detect/filestore: clean up stream flag handling
Victor Julien [Mon, 13 Jun 2022 15:21:51 +0000 (17:21 +0200)]
github/workflows: add cargo for all Ubuntu jobs
Victor Julien [Mon, 13 Jun 2022 12:31:39 +0000 (14:31 +0200)]
eve/schema: add pcap_filename field
Victor Julien [Mon, 13 Jun 2022 10:55:52 +0000 (12:55 +0200)]
file: consistently track size of gaps
Until now only the size of gaps counted in the regular append, not
close and open.
Bug: #5392.
Victor Julien [Fri, 10 Jun 2022 12:59:55 +0000 (14:59 +0200)]
eve/schema: add new flow fields
Victor Julien [Fri, 10 Jun 2022 14:24:15 +0000 (16:24 +0200)]
stream: remove unused TCP_LISTEN
Keep the values the same so we might be able to bring it back
w/o issues.
Victor Julien [Sun, 28 Nov 2021 19:11:54 +0000 (20:11 +0100)]
counter: tcp liberal counter
Victor Julien [Sun, 28 Nov 2021 18:20:58 +0000 (19:20 +0100)]
stream: after missing segments, be liberal on RST
This avoids long lasting inactive flows because in the most likely
case the RST did in fact end the connection. However Suricata may
still consider it to be "established".
Victor Julien [Thu, 25 Nov 2021 06:53:10 +0000 (07:53 +0100)]
flow: add various flow counters
Add flow.end state counters
Add active TCP sessions counter
Add flow.active counter
Add flow.total counter
Ticket: #1478.
Victor Julien [Fri, 26 Nov 2021 20:01:08 +0000 (21:01 +0100)]
counters: add StatsDecr
Victor Julien [Thu, 11 Nov 2021 12:30:46 +0000 (13:30 +0100)]
flow/manager: add flow.mgr.rows_sec counter
Victor Julien [Thu, 11 Nov 2021 07:34:43 +0000 (08:34 +0100)]
flow/recycler: bring back pthread_cond_t sleep
Bug #4379.
Victor Julien [Thu, 11 Nov 2021 07:17:44 +0000 (08:17 +0100)]
flow/recycler: minor code cleanups
Victor Julien [Thu, 11 Nov 2021 07:14:51 +0000 (08:14 +0100)]
flow/manager: move counters into util func
Victor Julien [Thu, 11 Nov 2021 06:50:26 +0000 (07:50 +0100)]
flow/manager: minor code cleanups
Victor Julien [Thu, 11 Nov 2021 06:43:02 +0000 (07:43 +0100)]
flow/manager: remove debug and dead code
Victor Julien [Tue, 9 Nov 2021 16:53:18 +0000 (17:53 +0100)]
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.
Victor Julien [Wed, 10 Nov 2021 14:40:26 +0000 (15:40 +0100)]
time: add timeradd implementation
timeradd isn't available on MinGW.
Victor Julien [Sat, 6 Nov 2021 19:29:01 +0000 (20:29 +0100)]
flow/manager: adaptive hash eviction timing
The flow manager scans the hash table in chunks based on the flow timeout
settings. In the default config this will lead to a full hash pass every
240 seconds. Under pressure, this will lead to a large amount of memory
still in use by flows waiting to be evicted, or evicted flows waiting to
be freed.
This patch implements a new adaptive logic to the timing and amount of
work that is done by the flow manager. It takes the memcap budgets and
calculates the proportion of the memcap budgets in use. It takes the max
in-use percentage, and adapts the flow manager behavior based on that.
The memcaps considered are:
flow, stream, stream-reassembly and app-layer-http
The percentage in use, is inversely applies to the time the flow manager
takes for a full hash pass. In addition, it is also applied to the chunk
size and the sleep time.
Example: tcp.reassembly_memuse is at 90% of the memcap and normal flow
hash pass is 240s. Hash pass time will be:
240 * (100 - 90) / 100 = 24s
Chunk size and sleep time will automatically be updated for this.
Adds various counters.
Bug: #4650.
Bug: #4808.
Michael Tremer [Fri, 11 Mar 2022 11:08:10 +0000 (11:08 +0000)]
stream: tcp: Handle retransmitted SYN with TSval
For connections that use TCP timestamps for which the first SYN packet
does not reach the server, any replies to retransmitted SYNs will be
tropped.
This is happening in StateSynSentValidateTimestamp, where the timestamp
value in a SYN-ACK packet must match the one from the SYN packet.
However, since the server never received the first SYN packet, it will
respond with an updated timestamp from any of the following SYN packets.
The timestamp value inside suricata is not being updated at any time
which should happen. This patch fixes that problem.
Bug: #4376.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Victor Julien [Fri, 10 Jun 2022 09:05:40 +0000 (11:05 +0200)]
detect/dcerpc: simplify keyword validation
Now that the engine understands the relation between SMB and DCERPC better
we can get rid of some of the special case handling in keywords.
Victor Julien [Thu, 9 Jun 2022 20:25:44 +0000 (22:25 +0200)]
detect/content: fix FNs due to bad depth calc
When trying to propegate the depth/offset, within/distance chains
a logic error would set too a restrictive depth on a pattern that
followed more than one "unchained" patterns.
Bug: #5162.
Victor Julien [Thu, 9 Jun 2022 20:25:08 +0000 (22:25 +0200)]
detect/content: simplify int bounds checking
Use a macro to validate the ranges for overflows. This removes
the clutter of all the checks and warnings, and also no longer
puts the state machine in an undefined state when hitting such
a condition.
Victor Julien [Thu, 9 Jun 2022 11:53:20 +0000 (13:53 +0200)]
detect/dcerpc: apply dcerpc to smb as well
So 'alert dcerpc' also matches if the DCERPC is over SMB.
Explicitly refuse smb keywords for the 'dcerpc' app proto setting:
`alert dceprc ... smb.share; ...` is rejected.
Remove a now useless special case in the stateless rule processing
matching for dcerpc/smb.
Bug: #5208.
Philippe Antoine [Wed, 1 Jun 2022 13:04:34 +0000 (15:04 +0200)]
event: only sets APPLAYER_UNEXPECTED_PROTOCOL once
If f->alproto == ALPROTO_UNKNOWN, we do not know the new protocol
yet, so we do not set the event yet.
Philippe Antoine [Tue, 31 May 2022 13:49:38 +0000 (15:49 +0200)]
events: reset logged event
Otherwise, if we log a first app_layer_event, then reset
with AppLayerDecoderEventsResetEvents for a new packet,
then get another event, it does not get logged
Ticket: #5391
Philippe Antoine [Tue, 7 Jun 2022 12:27:56 +0000 (14:27 +0200)]
smb: use default stream-depth 0 by default
As broken by commit
e5c948df87
Ticket: #5390
Victor Julien [Thu, 9 Jun 2022 08:21:09 +0000 (10:21 +0200)]
eve/schema: add missing magic from files array
dependabot[bot] [Tue, 7 Jun 2022 19:41:08 +0000 (19:41 +0000)]
github-actions: bump actions/cache from 3.0.3 to 3.0.4
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/
30f413bfed0a2bc738fdfd409e5a9e96b24545fd ...
c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d )
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Philippe Antoine [Wed, 8 Jun 2022 12:40:49 +0000 (14:40 +0200)]
nfs: fix arbitrary allocation
Bug introduced by https://github.com/OISF/suricata/pull/7111
Nom's count begins by allocating a Vector, which leads to arbitrary
allocation due to flavors_cnt coming from network, and not even
being checked against i.len()
Ticket: #5237
Philippe Antoine [Wed, 8 Jun 2022 15:07:45 +0000 (17:07 +0200)]
util: fix integer warnings in mime decoding
Ticket: #4516