]>
git.ipfire.org Git - thirdparty/suricata.git/log
Eric Leblond [Wed, 10 Feb 2021 16:45:16 +0000 (17:45 +0100)]
suricata: improve list keywords
Exit with error if a keyword is not supported or not existing
and display a message.
Eric Leblond [Wed, 10 Feb 2021 16:28:18 +0000 (17:28 +0100)]
suricata: return error value of custom run modes
Eric Leblond [Wed, 10 Feb 2021 16:26:47 +0000 (17:26 +0100)]
util/running-modes: don't exit in running mode
Eric Leblond [Wed, 10 Feb 2021 15:23:25 +0000 (16:23 +0100)]
log/pcap: exit on invalid filename
If the filename has to % sign and if pcap logging is using multi
mode, then the pcap capture will fail. So let's exit if ever this
is the case.
Eric Leblond [Fri, 29 Jan 2021 22:59:11 +0000 (23:59 +0100)]
suricata: unix-socket mode and -l are compatible
Commit
93642a0d1dd29c96e98824935ef963f6b1ef40eb did prevent to
specify the logging directory on command line and use the unix
socket.
It looks like the implementation has evolved and the arbitrary
limitation can be removed allowing a user to start unix socket
without editing the configuration file.
Eric Leblond [Wed, 27 Jan 2021 10:38:34 +0000 (11:38 +0100)]
eve: only output ja3 and ja3s if present
This will prevent JSON entries like the following that occur
with the dedault configuration (ja3 deactivated and extended
tls ouput activated):
"tls": {
"subject": "C=GB, ST=London, L=London, O=Global Security, OU=IT Department, CN=example.com",
"issuerdn": "C=GB, ST=London, L=London, O=Global Security, OU=IT Department, CN=example.com",
"serial": "00:9C:FC:DA:1D:A4:70:87:5D",
"fingerprint": "b8:18:2d:cb:c9:f8:1a:66:75:13:18:31:24:e0:92:35:42:ab:96:89",
"version": "TLSv1",
"notbefore": "2020-05-03T11:07:28",
"notafter": "2021-05-03T11:07:28",
"ja3": {},
"ja3s": {}
}
Jeff Lucovsky [Mon, 8 Feb 2021 13:06:53 +0000 (08:06 -0500)]
detect/pcre: Test capture group/var mismatch
Jeff Lucovsky [Mon, 8 Feb 2021 13:05:41 +0000 (08:05 -0500)]
detct/pcre: Correct capture group count check
This commit corrects the validation check between the number of
variables used and the number of specified capture groups.
Philippe Antoine [Fri, 5 Feb 2021 14:15:27 +0000 (15:15 +0100)]
template: use response_gap in rust parser
Victor Julien [Fri, 5 Feb 2021 07:41:22 +0000 (08:41 +0100)]
detect/state: optimize state keeping
Victor Julien [Thu, 4 Feb 2021 13:48:11 +0000 (14:48 +0100)]
detect: fix heap overflow issue with buffer setup
In some cases, the InspectionBufferGet function would be followed by
a failure to set the buffer up, for example due to a HTTP body limit
not yet being reached. Yet each call to InspectionBufferGet would lead
to the matching list_id to be added to the
DetectEngineThreadCtx::inspect.to_clear_queue. This array is sized to
add each list only once, but in this case the same id could be added
multiple times, potentially overflowing the array.
Victor Julien [Wed, 3 Feb 2021 11:00:51 +0000 (12:00 +0100)]
flow/manager: (u)sleep slightly longer
Sleep 250 microseconds instead of 100 as running in KVM cause the
old value to use 100% CPU for these threads.
Perf testing suggests no measurable impact for the non-KVM case.
Ticket: #4096
Victor Julien [Mon, 1 Feb 2021 21:23:47 +0000 (22:23 +0100)]
app-layer: fix transaction cleanup
Fix a 'skipped' transaction early in the list leading to all further
transactions getting skipped, even if they were fully processed and
ready to be cleaned up.
Philippe Antoine [Wed, 27 Jan 2021 20:21:44 +0000 (21:21 +0100)]
fuzz: rightly uses PacketFreeOrRelease in target
instead of PacketFree because packets
may belong to the pool
Philippe Antoine [Tue, 26 Jan 2021 19:34:14 +0000 (20:34 +0100)]
fuzz: use some value for max_pending_packets
so as not to timeout waiting forever for the condition
in PacketPoolWait
Philippe Antoine [Mon, 25 Jan 2021 20:33:24 +0000 (21:33 +0100)]
fuzz: makes target sigpcap more reproducible
By removing the temporary rules file if it existed
before the first run
Victor Julien [Tue, 26 Jan 2021 20:22:26 +0000 (21:22 +0100)]
github: run codecov verify test w/o optimizations
Victor Julien [Tue, 26 Jan 2021 13:28:11 +0000 (14:28 +0100)]
rust: update dependencies
Victor Julien [Sat, 16 Jan 2021 09:14:10 +0000 (10:14 +0100)]
rust: lock all major crate versions
To avoid surprises with dependencies bumping MSRV.
Victor Julien [Sat, 16 Jan 2021 09:08:11 +0000 (10:08 +0100)]
rust: relax nom version to any >=5.1.1
Philippe Antoine [Thu, 21 Jan 2021 11:27:31 +0000 (12:27 +0100)]
http: enables request decompression
Eric Leblond [Sun, 24 Jan 2021 21:40:02 +0000 (22:40 +0100)]
suricata: avoid at exit crash in nfq mode
When Suricata was build with ebpf support and when it was started
in NFQ mode, it was crashing at exit because it was trying to free
the device extension.
This patch fixes the issue by only trigger the eBPF related code
when Suricata is running in AFP_PACKET mode.
Eric Leblond [Sun, 24 Jan 2021 21:11:38 +0000 (22:11 +0100)]
storage: fix a variable name
Eric Leblond [Sat, 23 Jan 2021 19:57:02 +0000 (20:57 +0100)]
detect: fix link to documentation
Philippe Antoine [Thu, 21 Jan 2021 13:44:33 +0000 (14:44 +0100)]
ftp: ftp-data recognized by StringToAppProto
Philippe Antoine [Thu, 12 Nov 2020 08:24:36 +0000 (09:24 +0100)]
http2: decompression for files
gzip and brotli decompression for files
Philippe Antoine [Tue, 8 Dec 2020 13:53:01 +0000 (14:53 +0100)]
rust: BIT_U16 macro utility
Philippe Antoine [Sun, 6 Dec 2020 19:36:45 +0000 (20:36 +0100)]
rust: better panic message for missing file config
Philippe Antoine [Fri, 22 Jan 2021 14:31:59 +0000 (15:31 +0100)]
rust: fix warning about unused values in smb tests
Philippe Antoine [Fri, 22 Jan 2021 14:55:31 +0000 (15:55 +0100)]
protocol detection: fix failure case
as reached by CIFuzz even if unreachable from Suricata
Philippe Antoine [Mon, 2 Sep 2019 14:27:46 +0000 (16:27 +0200)]
protodetect: debug validation when multiple patterns match
Victor Julien [Thu, 21 Jan 2021 15:44:39 +0000 (16:44 +0100)]
stream: remove debug assert
In cases of large windows in the past the check would tigger.
Victor Julien [Wed, 20 Jan 2021 21:34:01 +0000 (22:34 +0100)]
detect/http_client_body: minor test cleanups
Eric Leblond [Wed, 20 Jan 2021 20:17:04 +0000 (21:17 +0100)]
dataset: fix dataset string lookup
The data was unlocked but the use_cnt was not decreased resulting
in the data entry not being removable.
Victor Julien [Wed, 20 Jan 2021 12:40:15 +0000 (13:40 +0100)]
detect/file_data: cleanup tests
Victor Julien [Wed, 20 Jan 2021 07:40:04 +0000 (08:40 +0100)]
stream/tests: minor cleanups
Victor Julien [Wed, 20 Jan 2021 06:15:10 +0000 (07:15 +0100)]
qa/cocci: support FAIL macros in malloc check
Victor Julien [Tue, 19 Jan 2021 19:25:19 +0000 (20:25 +0100)]
github: codecov fix path handling
Victor Julien [Tue, 19 Jan 2021 18:40:32 +0000 (19:40 +0100)]
stream: move tests into tests/
Victor Julien [Tue, 19 Jan 2021 13:23:05 +0000 (14:23 +0100)]
detect/fast_pattern: redo unittests
Victor Julien [Tue, 19 Jan 2021 13:22:50 +0000 (14:22 +0100)]
detect/fast_pattern: remove dead code
Victor Julien [Tue, 19 Jan 2021 06:50:28 +0000 (07:50 +0100)]
detect/http-ua: cleanup tests
Emmanuel Thompson [Mon, 4 May 2020 15:38:16 +0000 (11:38 -0400)]
decode/flow/esp: Add ESP decoder & flow
- Adds an ESP (Encapsulating Security Payload) header decoder
- Tracks ESP flows via the SPI field
Victor Julien [Mon, 18 Jan 2021 19:58:26 +0000 (20:58 +0100)]
decode: reformat REINIT macro
Victor Julien [Mon, 18 Jan 2021 14:50:57 +0000 (15:50 +0100)]
decode: minor unittest cleanups
Victor Julien [Mon, 18 Jan 2021 12:56:32 +0000 (13:56 +0100)]
proto/names: add SCTP if not defined in system
If SCTP is missing from /etc/protocols, add it manually.
Victor Julien [Mon, 18 Jan 2021 08:41:01 +0000 (09:41 +0100)]
github: add codecov.yml
Don't report until both cov runs are available to avoid partial
reporting in pull request comments.
Victor Julien [Mon, 18 Jan 2021 06:57:39 +0000 (07:57 +0100)]
json: remove unused jansson wrappers
Victor Julien [Sun, 17 Jan 2021 22:34:07 +0000 (23:34 +0100)]
http: enable and fix content range tests
Victor Julien [Sun, 17 Jan 2021 22:22:09 +0000 (23:22 +0100)]
app-layer/nfs: dead code removal
Juliana Fajardini [Sat, 21 Nov 2020 22:42:57 +0000 (22:42 +0000)]
detect/rpc: clean up unittests
- detect-rpc: convert unit tests to new FAIL/PASS API.
- detect-rpc: replace SigInit with DetectEngineAppendSig for more
concise code.
Victor Julien [Sun, 17 Jan 2021 16:15:01 +0000 (17:15 +0100)]
github: add codecov badge
Victor Julien [Sun, 17 Jan 2021 06:40:53 +0000 (07:40 +0100)]
ci: initial codecov integration
Eric Leblond [Tue, 5 Jan 2021 20:40:33 +0000 (21:40 +0100)]
configure: fix llc detection on recent Debian
Where clang --version was returning:
clang version 9.0.1-15+b1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Newer version like clang-10 on Debian are returning:
Debian clang version 10.0.1-8+b1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
As a result the parsing was failing to determine which llc was
available on the system.
Jason Ish [Wed, 13 Jan 2021 15:40:06 +0000 (09:40 -0600)]
lua: fix coverity issue with out of scope variable
Fix usage of out-of-scope variables. Introduced with the hashing
and adding the guard of g_disable_hashing.
To fix, just remove the guard so all variables are in scope. Hashes
are not initialized here so there is no need for the guard.
Jeff Lucovsky [Wed, 13 Jan 2021 18:43:52 +0000 (13:43 -0500)]
lua/test: Test cases using SC prefix
This commit adds paired test cases to ensure that the SC variant of the
entry points are tested.
Jeff Lucovsky [Wed, 13 Jan 2021 18:39:21 +0000 (13:39 -0500)]
doc/lua: Lua API name consistency
This commit updates the documentation of the SCFlow* function names
available to Lua scripts.
Formerly, they used the prefix "Sc"; now they use "SC".
Jeff Lucovsky [Tue, 12 Jan 2021 15:16:43 +0000 (10:16 -0500)]
general: Correct typo
Jeff Lucovsky [Tue, 12 Jan 2021 15:14:54 +0000 (10:14 -0500)]
lua: Use SC prefix for Lua functions
This commit adds additional Lua API interfaces to bring consistency to
functions such that the `SC` prefix is available consistently across
flow int and flow var functions.
Victor Julien [Tue, 12 Jan 2021 21:22:27 +0000 (22:22 +0100)]
email/md5: optimize md5 handling
Jason Ish [Mon, 4 Jan 2021 17:03:31 +0000 (11:03 -0600)]
doc/userguide/transforms: remove not about libnss being required
Jason Ish [Mon, 4 Jan 2021 17:02:50 +0000 (11:02 -0600)]
doc/userguide/install: remove libnss
Jason Ish [Mon, 4 Jan 2021 16:59:50 +0000 (10:59 -0600)]
travis-ci: don't install libnss
Jason Ish [Mon, 4 Jan 2021 16:48:20 +0000 (10:48 -0600)]
email/eve: use Rust function to hash buffer to hex
Use SCMd5HashBufferToHex to hash the subject to a hex string.
Removes snprintf loop.
Jason Ish [Wed, 30 Dec 2020 22:37:28 +0000 (16:37 -0600)]
rust/hashing: add function to finalize md5 to hex string
New function, SCMd5FinalizeToHex to finalize an md5 hash
to a hex string.
Jason Ish [Wed, 30 Dec 2020 22:18:39 +0000 (16:18 -0600)]
ja3: use SCMd5HashBufferToHex to print hash as hex
Replace snprintf loop with new function that hashes a single
buffer to an MD5 hex string.
Jason Ish [Wed, 30 Dec 2020 22:17:52 +0000 (16:17 -0600)]
rust/hashing: function to md5 hash buffer to hex
Add function SCMd5HashBufferToHex to hash a single buffer to an
md5 hex string.
Jason Ish [Mon, 28 Dec 2020 22:08:30 +0000 (16:08 -0600)]
filestore: respect g_disable_hashing
If g_disable_hashing is set, behave like libnss wasn't compiled
in.
Jason Ish [Wed, 23 Dec 2020 22:55:11 +0000 (16:55 -0600)]
github-ci: don't install libnss/libnspr packages
Jason Ish [Wed, 23 Dec 2020 22:54:57 +0000 (16:54 -0600)]
configure.ac: remove tests for libnspr and libnss
Jason Ish [Wed, 23 Dec 2020 22:50:07 +0000 (16:50 -0600)]
hashing: remove remaining HAVE_NSS guards
For features, we pretend to HAVE_NSS so scripts, external tests
continue to work.
Jason Ish [Wed, 23 Dec 2020 22:40:27 +0000 (16:40 -0600)]
output-json-email: use Rust md5 bindings instead of libnss
Jason Ish [Wed, 23 Dec 2020 22:35:07 +0000 (16:35 -0600)]
util/mime: use Rust md5 bindings instead of libnss
As the new Md5 hashing consumes its context on finalize, an bool
has_md5 flag has been added to let the logger know there is an
md5 hash available.
Jason Ish [Wed, 23 Dec 2020 22:25:02 +0000 (16:25 -0600)]
transform-sha256: use Rust sha256 bindings
Use new Rust sha256 bindings insead of libnss.
Jason Ish [Wed, 23 Dec 2020 22:24:23 +0000 (16:24 -0600)]
rust/hashing: method to SHA256 and finalize in one call
Add SCSha256HashBuffer to hash a single buffer returning the
result.
Jason Ish [Wed, 23 Dec 2020 22:13:55 +0000 (16:13 -0600)]
transform-sha1: use Rust sha1 bindings
Removes dependence on NSS.
Jason Ish [Wed, 23 Dec 2020 15:53:50 +0000 (09:53 -0600)]
util-crypt: remove ComputeSHA1
There is now a Rust replacement for ComputeSHA1 that is exposed
to C as SCSha1HashBuffer.
Jason Ish [Wed, 23 Dec 2020 15:50:48 +0000 (09:50 -0600)]
ssl: replace ComputeSHA1 with Rust SCSha1HashBuffer
Removes the final use of internal ComputeSHA1 function.
Jason Ish [Mon, 11 Jan 2021 17:28:41 +0000 (11:28 -0600)]
transform/md5: use Rust md5 bindings
Jason Ish [Mon, 11 Jan 2021 17:27:43 +0000 (11:27 -0600)]
error: new disabled hashing error code
Add new error code to be used when something fails due to hashing being
disabled.
Jason Ish [Wed, 6 Jan 2021 18:47:13 +0000 (12:47 -0600)]
doc/userguide: document --disable-hashing
Jason Ish [Mon, 11 Jan 2021 17:26:21 +0000 (11:26 -0600)]
suricata: add --disable-hashing option
The idea with a flag to disable hashing is to provide a way to
get the effect of building Suricata without libnss, which is
sometimes done for performance reasons.
Jason Ish [Fri, 8 Jan 2021 15:06:48 +0000 (09:06 -0600)]
suricata.c: clang-format required after new option added
Jason Ish [Fri, 8 Jan 2021 15:05:32 +0000 (09:05 -0600)]
suricata.c: disable clang-format on long_opts init
clang-format will reformat this to have multiple options on a
single line which is hard to read and I don't see a specific
clang-format option to format this better. So for now,
disable clang-format on this section of code.
Jason Ish [Wed, 23 Dec 2020 15:48:14 +0000 (09:48 -0600)]
community-id: use Rust SHA1 to compute hash
Removes use of our internal ComputeSHA1 for calculating the
community ID.
Jason Ish [Wed, 23 Dec 2020 15:47:32 +0000 (09:47 -0600)]
rust/hashing: new function to SHA1 hash a single buffer
SCSha1HashBuffer will has a single buffer and compute the digest
in one call.
Jason Ish [Wed, 23 Dec 2020 04:31:09 +0000 (22:31 -0600)]
rust: remove md5 crate, unalias md-5
Remove the md5 crate as a dependency as it is no longer removed.
We now use md-5 from RustCrypto.
Jason Ish [Wed, 23 Dec 2020 04:27:26 +0000 (22:27 -0600)]
rust/ssh: use md-5 crate instead of md5
The "md-5" crate is part of the RustCrypto project that also
uses the sha1 and sha256 crates we are using. These all implement
the Digest trait for a common API.
Jason Ish [Tue, 22 Dec 2020 22:44:29 +0000 (16:44 -0600)]
doc/ja3: libnss support no longer required
Jason Ish [Tue, 22 Dec 2020 22:44:42 +0000 (16:44 -0600)]
ja3: remove requirement on NSS
Jason Ish [Tue, 22 Dec 2020 22:43:13 +0000 (16:43 -0600)]
rust/hashing: a method to md5 hash a single buffer
Add SCMd5HashBuffer as a replacement for NSS HASH_HashBuf as
used in ja3 to hash a single buffer.
Jason Ish [Tue, 22 Dec 2020 22:18:01 +0000 (16:18 -0600)]
filestore: remove requirement of nss for filestore
Required including NSS header in places that depended on
util-file.h including it.
All filestore suricata-verify tests now pass without libnss.
Also enabled detect-file{md5,sha1,sha256} without NSS support.
Jason Ish [Tue, 22 Dec 2020 18:38:24 +0000 (12:38 -0600)]
filestore: use Rust bindings for sha256/sha1/md5
Jason Ish [Tue, 22 Dec 2020 18:35:45 +0000 (12:35 -0600)]
rust: add ffi module for sha256, sha1 and md5
Add a Rust module that exposes Rust implementations of
sha256, sha1 and md5 from the RustCrypto project.
This is an experiment in replacing the libnss hash functions with
pure Rust versions that will allow us to remove nss as a compile
time option.
Initial tests are good, even with a 10% or so performance
improvement when being called from C.
Also trying a module naming scheme where modules under the ffi
modules are purely for exports to C, as it doesn't make any
sense to use this new hashing module directly from Rust.
Kirby Kuehl [Tue, 5 Jan 2021 16:55:22 +0000 (08:55 -0800)]
doc: fix URL for unix-socket python example
Jeff Lucovsky [Fri, 8 Jan 2021 13:00:35 +0000 (08:00 -0500)]
tftp: Add test cases
This commit adds test cases for the TFTP parser.
Jeff Lucovsky [Fri, 8 Jan 2021 12:56:19 +0000 (07:56 -0500)]
tftp: Improve parser
This commit improves TFTP parsing by ensuring the mode and opcode are
valid.
Jason Ish [Fri, 8 Jan 2021 16:32:47 +0000 (10:32 -0600)]
github-ci: use python3 in debian builds
Jason Ish [Fri, 8 Jan 2021 15:39:19 +0000 (09:39 -0600)]
github-ci/macos: use brew to install Python 3
The default Python on MacOS is Python 2. Suricata-Verify now
depends on Python 3, so install it with Brew.
Jason Ish [Wed, 30 Dec 2020 17:24:17 +0000 (11:24 -0600)]
github-ci: update min Rust version from 1.34.2 to 1.41.1