]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Sun, 5 Jun 2022 18:05:23 +0000 (20:05 +0200)]
smtp: minor line loop cleanup
Victor Julien [Sun, 5 Jun 2022 16:23:55 +0000 (18:23 +0200)]
smtp: remove defunct check for line with single LF
Don't fix it as DATA processing needs all the bytes.
Victor Julien [Sun, 5 Jun 2022 16:24:05 +0000 (18:24 +0200)]
smtp: constify line arguments where possible
Victor Julien [Sun, 5 Jun 2022 15:20:40 +0000 (17:20 +0200)]
smtp: move current line out of state
Victor Julien [Sun, 5 Jun 2022 13:01:18 +0000 (15:01 +0200)]
smtp: move input out of state
Victor Julien [Sat, 4 Jun 2022 06:49:41 +0000 (08:49 +0200)]
smtp: turn assertions in to debug asserts
Victor Julien [Sat, 4 Jun 2022 06:49:25 +0000 (08:49 +0200)]
smtp: simplify preprocess loop
Victor Julien [Fri, 3 Jun 2022 15:10:59 +0000 (17:10 +0200)]
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.
Victor Julien [Sat, 4 Jun 2022 05:09:27 +0000 (07:09 +0200)]
base64: no special case for nul char
Let it be handled like other invalid input.
Shivani Bhardwaj [Thu, 2 Jun 2022 15:20:07 +0000 (20:50 +0530)]
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
Shivani Bhardwaj [Fri, 3 Jun 2022 10:26:36 +0000 (15:56 +0530)]
base64: add Base64Ecode enum
Shivani Bhardwaj [Thu, 12 May 2022 18:00:00 +0000 (23:30 +0530)]
base64: add Base64Mode enum
Shivani Bhardwaj [Fri, 29 Apr 2022 08:51:40 +0000 (14:21 +0530)]
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
BACK Yonah [Mon, 28 Mar 2022 17:10:48 +0000 (19:10 +0200)]
ci: adds CodeQL workflow and LGTM support
Ticket: #5307
dependabot[bot] [Wed, 1 Jun 2022 19:54:29 +0000 (19:54 +0000)]
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](https://github.com/ossf/scorecard-action/compare/
5c8bc69dc88b65c66584e07611df79d3579b0377 ...
3e15ea8318eee9b333819ec77a36aca8d39df13e )
---
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>
dependabot[bot] [Wed, 1 Jun 2022 19:54:26 +0000 (19:54 +0000)]
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](https://github.com/github/codeql-action/compare/
a3a6c128d771b6b9bdebb1c9d0583ebd2728a108 ...
27ea8f8fe5977c00f5b37e076ab846c5bd783b96 )
---
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>
Philippe Antoine [Mon, 25 Apr 2022 15:59:00 +0000 (17:59 +0200)]
detect: use generic integer functions for streamsize
By the way, adds the prefilter feature
Ticket: #2697
Ticket: #4112
Philippe Antoine [Wed, 23 Mar 2022 20:43:50 +0000 (21:43 +0100)]
detect: use generic integer functions for filesize
Ticket: #4112
Philippe Antoine [Wed, 23 Mar 2022 20:33:08 +0000 (21:33 +0100)]
detect: use generic integer functions for tcp mss
Ticket: #4112
Philippe Antoine [Wed, 23 Mar 2022 20:16:26 +0000 (21:16 +0100)]
detect: use generic integer functions for template2
Philippe Antoine [Wed, 23 Mar 2022 20:11:34 +0000 (21:11 +0100)]
detect: use generic integer functions for ttl
Ticket: #4112
Philippe Antoine [Wed, 23 Mar 2022 19:52:42 +0000 (20:52 +0100)]
detect: use generic integer functions for dsize
Ticket: #4112
Philippe Antoine [Wed, 23 Mar 2022 19:44:44 +0000 (20:44 +0100)]
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
Philippe Antoine [Sat, 16 Apr 2022 13:51:29 +0000 (15:51 +0200)]
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
Philippe Antoine [Tue, 31 May 2022 11:43:56 +0000 (13:43 +0200)]
rust: make suricata context const
So that it is read only and its pointers do not get modified
Philippe Antoine [Tue, 31 May 2022 11:24:09 +0000 (13:24 +0200)]
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.
Philippe Antoine [Mon, 23 May 2022 15:49:49 +0000 (17:49 +0200)]
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
Jason Ish [Wed, 11 May 2022 17:23:24 +0000 (11:23 -0600)]
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
Philippe Antoine [Mon, 2 May 2022 11:30:35 +0000 (13:30 +0200)]
decode: fix integer warning
Newly introduced warning.
Regular cast as value is checked just before.
Ticket: #4516
Philippe Antoine [Tue, 18 Jan 2022 14:36:52 +0000 (15:36 +0100)]
defrag: fix integer warnings
Ticket: #4516
Philippe Antoine [Fri, 29 Apr 2022 06:55:58 +0000 (08:55 +0200)]
rust: cbindgen first verifies existing bindings
So as not to recompile every C file inclusing rust.h
Philippe Antoine [Sat, 16 Apr 2022 14:51:42 +0000 (16:51 +0200)]
detect: parsing avoiding infinite loop
by comparing size_t to strlen result
Instead of uint16_t which would loop
Ticket: #5310
Philippe Antoine [Sat, 16 Apr 2022 14:46:01 +0000 (16:46 +0200)]
file: use functions on fd to avoid toctou
Ticket: #5308
Philippe Antoine [Sat, 16 Apr 2022 14:41:46 +0000 (16:41 +0200)]
util: check for unsigned overflow in rohash
To make CodeQL happy
Jason Ish [Mon, 30 May 2022 22:52:29 +0000 (16:52 -0600)]
conf: remove ConfGetValue
All uses of ConfGetValue are satisfied by ConfGet
Philippe Antoine [Fri, 20 May 2022 18:24:43 +0000 (20:24 +0200)]
util: remove malloc from streaming buffer config
as it is unused
dependabot[bot] [Tue, 31 May 2022 19:31:38 +0000 (19:31 +0000)]
github-actions: bump actions/cache from 3.0.2 to 3.0.3
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.2 to 3.0.3.
- [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/
48af2dc4a9e8278b89d7fa154b955c30c6aaab09 ...
30f413bfed0a2bc738fdfd409e5a9e96b24545fd )
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Andreas Dolp [Tue, 31 May 2022 13:58:54 +0000 (15:58 +0200)]
doc/tls: Add documentation for TLS logging
Andreas Dolp [Tue, 31 May 2022 13:28:40 +0000 (15:28 +0200)]
doc/tls: Remove redundant example
Andreas Dolp [Sat, 2 Apr 2022 12:33:54 +0000 (14:33 +0200)]
suricata.yaml.in: Fix default value of prealloc-sessions
Andreas Dolp [Sat, 2 Apr 2022 12:02:40 +0000 (14:02 +0200)]
doc: Add missing ")" in example
Andreas Dolp [Sat, 2 Apr 2022 11:59:59 +0000 (13:59 +0200)]
suricata.yaml.in: Remove duplicate "with" in comment.
Andreas Dolp [Thu, 17 Feb 2022 07:04:35 +0000 (08:04 +0100)]
doc: Fix typos
Andreas Dolp [Thu, 17 Feb 2022 07:03:10 +0000 (08:03 +0100)]
doc: Fix broken link
Philippe Antoine [Thu, 12 May 2022 18:31:25 +0000 (20:31 +0200)]
output: adds schema.json
Ticket: #1369
Victor Julien [Mon, 30 May 2022 19:08:19 +0000 (21:08 +0200)]
log-pcap: remove tunnel locks
The tunnel lock mutex only "protects" the tunnel synchronization,
not the packet data, length or datalink fields.
Victor Julien [Mon, 30 May 2022 13:53:39 +0000 (15:53 +0200)]
nflog: fix datalink compile issue
Juliana Fajardini [Thu, 26 May 2022 22:07:55 +0000 (19:07 -0300)]
util/action: convert unittests to FAIL/PASS API
Task #5371
Juliana Fajardini [Thu, 26 May 2022 21:53:03 +0000 (18:53 -0300)]
util/action: unittests clean-up (to sv tests)
Removing all unittests that work better as suricata-verify tests.
Task #5371
Victor Julien [Wed, 18 May 2022 12:36:24 +0000 (14:36 +0200)]
unittest: minor helper cleanup
Victor Julien [Wed, 25 May 2022 13:01:15 +0000 (15:01 +0200)]
detect/parse: cleanup test
Victor Julien [Wed, 18 May 2022 12:46:28 +0000 (14:46 +0200)]
detect: parsing test cleanups/improvements
Victor Julien [Wed, 18 Dec 2019 19:21:01 +0000 (20:21 +0100)]
host-os-info: add test to show mixed ipv4/ipv6
Victor Julien [Wed, 18 May 2022 18:47:33 +0000 (20:47 +0200)]
rule/vars: clean up tests
Victor Julien [Tue, 24 May 2022 10:55:39 +0000 (12:55 +0200)]
detect/iponly: minor code cleanup
Victor Julien [Mon, 23 May 2022 11:59:31 +0000 (13:59 +0200)]
detect/iponly: include postmatch in determination
Victor Julien [Tue, 10 May 2022 12:22:36 +0000 (14:22 +0200)]
detect/iponly: simplify handling of 'any' parsing
Victor Julien [Tue, 10 May 2022 11:26:07 +0000 (13:26 +0200)]
detect: address parsing variable rename to match code style
Victor Julien [Fri, 13 May 2022 08:01:51 +0000 (10:01 +0200)]
detect/iponly: remove unused code
Juliana Fajardini [Thu, 26 May 2022 23:28:41 +0000 (20:28 -0300)]
rust: fix doc comments that trigger rust warnings
Rust generates warnings that are treated as errors for documentation
blocks before `extern` blocks.
dependabot[bot] [Wed, 25 May 2022 19:45:53 +0000 (19:45 +0000)]
github-actions: bump ossf/scorecard-action from 1.0.4 to 1.1.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.0.4 to 1.1.0.
- [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/
c1aec4ac820532bab364f02a81873c555a0ba3a1 ...
5c8bc69dc88b65c66584e07611df79d3579b0377 )
---
updated-dependencies:
- dependency-name: ossf/scorecard-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Victor Julien [Thu, 26 May 2022 11:30:56 +0000 (13:30 +0200)]
stream: add packet header outside of lock
Victor Julien [Thu, 26 May 2022 11:29:59 +0000 (13:29 +0200)]
log/pcap: open handles outside of lock
Scott Jordan [Thu, 3 Feb 2022 20:18:11 +0000 (15:18 -0500)]
log/pcap: add buffer timeout
Set timeout for pcap log so that packets do not sit
in buffer. Set default to one second.
Scott Jordan [Mon, 1 Nov 2021 21:43:43 +0000 (16:43 -0500)]
stream: memcap tracking for TcpSegment alloc
Eric Leblond [Fri, 12 Mar 2021 09:56:51 +0000 (10:56 +0100)]
log/pcap: handle case of multiple link types
Eric Leblond [Thu, 11 Mar 2021 22:58:37 +0000 (23:58 +0100)]
flow: set datalink for pseudo packet
Set pseudo packet datalink to the global one. This fixes the case
where the pcap handle is open with information coming from a
pseudo packet. Without this, we did end up in most cases with
an Ethernet packet being written in a Raw pcap.
Eric Leblond [Thu, 11 Mar 2021 22:55:53 +0000 (23:55 +0100)]
suricata: introduce global linktype
As Suricata is not supporting pcap-ng we have to stick with one single
datalink type for the capture if ever we want to do pcap logging.
Assuming this, this patch introduces a function to set the link
type globally. This will be used with pcap conditional logging
to get the logging of TCP segments with the correct link type.
Eric Leblond [Wed, 10 Mar 2021 15:40:12 +0000 (16:40 +0100)]
log/pcap: log segments for pseudo packets
Eric Leblond [Thu, 25 Feb 2021 21:50:01 +0000 (22:50 +0100)]
log/pcap: fix conditional pcap in tag mode
We were missing the first packet when using condition pcap logging
in tag mode as it was not tagged. As a result we were not getting
the stream data triggering the alert in the pcap file.
Eric Leblond [Thu, 25 Feb 2021 21:48:16 +0000 (22:48 +0100)]
detect/tag: add a tag for first packet
We may need to know that a packet has been tagged but is the
first one (and thus is not tagged).
Scott Jordan [Wed, 17 Feb 2021 22:36:42 +0000 (16:36 -0600)]
log/pcap: dump segments of both sides of tcp session.
This patch updates tcp segment dumping to dump segments
from both sides of the session in order when capturing
alerts and tags.
Eric Leblond [Sun, 14 Feb 2021 18:14:30 +0000 (19:14 +0100)]
doc: add info about capture_file key
Eric Leblond [Sat, 13 Feb 2021 20:56:51 +0000 (21:56 +0100)]
log/pcap and eve/alert: get pcap filename to support multi mode
This patch adds a function to get the current pcap file name that
will be used to current packet. This patch also updates EVE
alerts to add pcap output filename when pcap capture is done in
multi or normal mode.
Eric Leblond [Sat, 13 Feb 2021 20:34:34 +0000 (21:34 +0100)]
log/pcap: fix typo in error message
Eric Leblond [Mon, 8 Feb 2021 20:46:26 +0000 (21:46 +0100)]
stream: count realloc in memcap
TCP memory cap was not taking into account the memory that can
be used by realloc of Packet headers in TCP segments.
Eric Leblond [Sun, 7 Feb 2021 18:31:44 +0000 (19:31 +0100)]
log/pcap: update copyright date
Eric Leblond [Sat, 6 Feb 2021 22:17:30 +0000 (23:17 +0100)]
doc: add conditional pcap logging info
Eric Leblond [Sat, 6 Feb 2021 20:19:04 +0000 (21:19 +0100)]
log/pcap: introduce tag as logging condition
This patch adds the tag as logging condition. If this option is
used all tagged packets are written to the pcap.
Eric Leblond [Sat, 6 Feb 2021 21:35:38 +0000 (22:35 +0100)]
log/pcap: fix some indentation and white spaces
Eric Leblond [Sat, 6 Feb 2021 08:52:53 +0000 (09:52 +0100)]
log/pcap: add support for tunnel logging
In alert mode, we need to write the root packet to the pcap
file instead of the packet that did trigger the alert.
Eric Leblond [Sat, 6 Feb 2021 21:18:25 +0000 (22:18 +0100)]
log/pcap: add existing stream logging
This patch update the alert mode of pcap logging.
It uses the packet header data added to the TCP segments
to build packets corresponding to the acked data that did trigger
the alert. It then write it to the pcap file before starting to
dump all packet for the flow that did alert.
Eric Leblond [Sat, 30 Jan 2021 20:57:32 +0000 (21:57 +0100)]
stream: conditionally add packet header to segment
This patch optionally adds packet header to the TCP segment
and update the for each segment function by changing the
callback.
This patch is based on the work by Scott Jordan <scottfgjordan@gmail.com>
Eric Leblond [Sun, 8 Nov 2020 17:10:49 +0000 (18:10 +0100)]
detect: add flag when packet is first with alert
We add a flag to packet to be able to know if this packet was the
first one to get alerts on the flow.
Eric Leblond [Sun, 8 Nov 2020 16:50:58 +0000 (17:50 +0100)]
log/pcap: add PcapWrite function
It will be used later when multiple writing operations will be
necessary.
Eric Leblond [Sun, 1 Nov 2020 08:54:47 +0000 (09:54 +0100)]
log/pcap: conditional logging
Add an option to only write to pcap packets with alerts and flow
that have alerted.
Jason Ish [Tue, 24 May 2022 18:17:44 +0000 (12:17 -0600)]
github-ci: remove fedora 34 build
Fedora 34 goes EOL in early June. The checks in this build are already
covered by the 35 and 36 builds.
Jason Ish [Mon, 23 May 2022 15:26:44 +0000 (09:26 -0600)]
github-ci: bump fedora versions
35 -> 36
34 -> 35
33 -> 34
Jason Ish [Wed, 4 May 2022 19:18:09 +0000 (13:18 -0600)]
rules: use primary default-rule-path if set on command line
When reloading rules, respect `--set default-rule-path=...` from the
command line if set.
Previously the rule reload would always take the default-rule-path from
the configuration file, even if overrided on the command line.
Issue: #1911
Juliana Fajardini [Mon, 9 May 2022 14:24:18 +0000 (11:24 -0300)]
detect/alert: directly increment alerts.discarded
In the unlikely case of AlertQueueExpand failure, we were incrementing
the discarded alerts stats in AlertQueueAppend via the Packet member in the
DetectEngineThreadCtx, which may not be initialized yet.
Bug #5353
Philippe Antoine [Fri, 13 May 2022 07:43:11 +0000 (09:43 +0200)]
dcerpc: use vecdeque tx iterator
Ticket: #5321
dependabot[bot] [Tue, 17 May 2022 19:43:53 +0000 (19:43 +0000)]
github-actions: bump github/codeql-action from 2.1.9 to 2.1.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.9 to 2.1.11.
- [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/
7502d6e991ca767d2db617bfd823a1ed925a0d59 ...
a3a6c128d771b6b9bdebb1c9d0583ebd2728a108 )
---
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>
dependabot[bot] [Fri, 20 May 2022 19:32:03 +0000 (19:32 +0000)]
github-actions: bump actions/upload-artifact from 3.0.0 to 3.1.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/
6673cd052c4cd6fcf4b4e6e60ea986c889389535 ...
3cea5372237819ed00197afe530f5a7ea3e805c8 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Philippe Antoine [Wed, 17 Jul 2019 13:21:13 +0000 (15:21 +0200)]
protodetect: use both directions over UDP
As is already done for TCP
Ticket: #2757
Philippe Antoine [Wed, 17 Jul 2019 13:19:30 +0000 (15:19 +0200)]
protodetect: be more tolerant
Do not mask protocols on both directions with only first packet
For instance :
When the first packet is no valid DNS but on port 53 (a junk request)
second packet (error response from server) does not get checked for DNS
as first packet bit masked away DNS for both directions
Ticket: #2757
Arne Welzel [Wed, 4 May 2022 18:06:36 +0000 (20:06 +0200)]
stacktrace-on-signal: Use kill(getpid(), sig_num)
kill(0, ...) re-raises the signal to every processes in the process
group which may impact unrelated processes.
Concretely, in our CI pipeline, a segfaulting Suricata process killed
the test driver.
Jason Ish [Wed, 4 May 2022 21:19:48 +0000 (15:19 -0600)]
suricata.yaml: include version that generated this file
Add a line to the configuration that says which version generated the
configuration file. For example:
# This configuration generated by:
# Suricata 7.0.0-dev
Issue: #4784
Victor Julien [Tue, 22 Mar 2022 15:59:17 +0000 (16:59 +0100)]
stream/segtree: improve docs, error handling
Victor Julien [Tue, 22 Mar 2022 15:55:52 +0000 (16:55 +0100)]
streaming/buffer: add debug validation for 'impossible' condition
Victor Julien [Tue, 3 May 2022 17:56:19 +0000 (19:56 +0200)]
app-layer: make registration structure more compact