Commit graph

3666 commits

Author SHA1 Message Date
gpotter2
d4db9bf6d0 Add TSval and TSecr to TCPSyn 2021-09-17 11:35:16 +02:00
Arne Welzel
b7690bb367 ignore_checksums_nets: Add test for multiple subnets
This test fails with Zeek 4.1 and Zeek 4.0.3.
2021-09-14 21:17:01 +02:00
Tim Wojtulewicz
8414d13030 Merge remote-tracking branch 'origin/topic/vern/vector-hole-loops'
* origin/topic/vern/vector-hole-loops:
  fix for looping over vectors with holes per https://github.com/zeek/zeek/issues/1763
  btest for https://github.com/zeek/zeek/issues/1763
2021-09-08 12:04:56 -07:00
Tim Wojtulewicz
b7e264f8ef Merge remote-tracking branch 'origin/topic/seth/tsv-logs-utf8-by-default'
* origin/topic/seth/tsv-logs-utf8-by-default:
  Fix mis-usage of string::append that leads to an overflow
  Use json_escape_utf8 for all utf8 data in ODesc
  Switch the TSV Zeek logs to be UTF8 by default.
2021-09-08 12:04:13 -07:00
Vern Paxson
acaaa0d36a fix race condition in btest output ordering 2021-09-08 10:23:39 -07:00
Vern Paxson
74fbfa3aae whoops, forgot to canonicalize filenames in new btest 2021-09-08 10:23:39 -07:00
Vern Paxson
9d896d114b extend btest to include a coercion overflow 2021-09-08 10:23:39 -07:00
Vern Paxson
7f3ab84e5c fixed a typo in a comment 2021-09-08 10:23:39 -07:00
Vern Paxson
9757d37332 test case for vector coercions, including holes 2021-09-08 10:23:39 -07:00
Vern Paxson
9b2eb2c373 Baseline variants for "-a zam" 2021-09-08 10:23:38 -07:00
Vern Paxson
9722b4216f new "-a ZAM" testing baseline alternative 2021-09-08 10:23:38 -07:00
Vern Paxson
f89ed411cf updates for usage issues: support for -uu, maybe/definitely distinctions 2021-09-08 10:23:38 -07:00
Vern Paxson
87fce26a0b btest for https://github.com/zeek/zeek/issues/1763 2021-09-07 10:21:50 -07:00
Tim Wojtulewicz
404fed6923 Use json_escape_utf8 for all utf8 data in ODesc 2021-09-07 09:16:53 -07:00
Seth Hall
a4ceb98bf8 Switch the TSV Zeek logs to be UTF8 by default.
There is a paired zeek-testing branch for some updates there.
2021-09-07 09:16:53 -07:00
Tim Wojtulewicz
0746ef7ecc Merge remote-tracking branch 'origin/topic/vlad/analyzer_coverage'
* origin/topic/vlad/analyzer_coverage:
  Add btests for DNS WKS and BINDS
  Add btest for DNS WKS RR.
  Add btest for DNS NSEC3PARAM RR.
2021-09-03 18:12:28 +00:00
Tim Wojtulewicz
0369ca01bc Disable the scripts.base.frameworks.logging.sqlite.simultaneous-writes test under TSan
Due to a bug (or intentional code) in SQLite, we disabled enabling the shared cache
in sqlite3 if running under ThreadSanitizer (see cf1fefbe0b0a6163b389cc92b5a6878c7fc95f1f).
Unfortunately, this has the side-effect of breaking the simultaneous-writes test because
the shared cache is disabled. This is hopefully a temporary fix until SQLite fixes the
issue on their side.
2021-09-03 10:38:15 -07:00
Tim Wojtulewicz
569552b320 GH-1589: Avoid extracting IP-like strings from SMTP headers 2021-09-03 17:35:10 +00:00
Christian Kreibich
b999448e3d Minor updates to the external-testsuite scripts
Delete the unused Baseline folder, remove a Bro-era name from gitignore,
change create-new-repo to work with a second argument that is actually
a URL, and tweak whitespace. Expand description in README and update the
explanation of OPENSSL_ENABLE_MD5_VERIFY in subdir-btest.cfg.
2021-09-01 17:29:40 -07:00
Vlad Grigorescu
f9c36f5c37 Add btests for DNS WKS and BINDS 2021-09-01 12:00:50 -05:00
Vlad Grigorescu
6e5e2c8cb3 Merge branch 'master' into topic/vlad/analyzer_coverage 2021-08-31 15:58:42 -05:00
Christian Kreibich
2bcaa33563 Merge branch 'topic/christian/gh-1731-broker-peers-bug'
* topic/christian/gh-1731-broker-peers-bug:
  Fix addr/string type confusion in Broker::peers()
2021-08-19 15:13:37 -07:00
Tim Wojtulewicz
f442893c98 Return fully-escaped string if utf8 conversion fails
This adds a new function for validating UTF-8 sequences by converting to
UTF-32. This allows us to also check for various blocks of codepointsi
that we consider invalid while checking for valid sequences in general.
2021-08-19 08:56:27 -07:00
Christian Kreibich
fa38d81a7b Fix addr/string type confusion in Broker::peers()
Broker::NetworkInfo$address is of type string. The Broker::peers() BiF treated
it as an address, which caused ZVal's type validation to flag a
mismatch and abort.

Includes a small tweak to the broker.unpeer test that makes it invoke
Broker::peers(), which breaks in absence of the fix.
2021-08-18 15:16:58 -07:00
Benjamin Bannier
28e8abbf19 Fix option length computation in Geneve analyzer.
We previously computed the length of the Geneve options field
incorrectly which lead to us passing data at an incorrect offset to
inner analyzers. With this patch we now interpret the length field
correctly, according the the spec
https://datatracker.ietf.org/doc/html/rfc8926#section-3.4.

Closes #1726.
2021-08-18 09:19:49 +02:00
Johanna Amann
8192ad581d Do not lookup ignore_checksums_nets for every packet
This could lead to a noticeable (single-percent) performance
improvement.

Most of the functionality for this is in the packet analyzers that now
cache ignore_chesksums_nets.

Based on a patch by Arne Welzel (Corelight).
2021-08-06 10:32:53 +01:00
jerome Grandvalet
8cabecec40 Fix HTTP evasion
- Happen when there is no CRLF at the end of HTTP
    - Fix by adding CRLF when packet is complete (in relation to content-length in header)
2021-07-23 09:28:29 +02:00
Johanna Amann
13cfa4c938 Fix handling of timers when cloning TableVals
When cloning TableVals, a new timer was created for the wrong object
(the existing TableVal, not the clone). This lead to the already
existing timer being no longer accessible. Which, in turn, leads to an
abandoned timer reading into no longer allocated data when the original
TableVal is deleted.

Fixes GH-1687
2021-07-21 12:52:22 +01:00
Robin Sommer
a7343ee019 Fix registration of protocol analyzers from inside plugins.
With the recent packet manager work, it broke to register a protocol
analyzer for a specific port from inside a plugin's initialization code.
That's because that registration now depends on the packet manager being
set up, which isn't case at that time a plugin's `InitPostInit()` runs.
This fix contains two parts:

    - Initialize the packet manager before the analyzer manager, so that
      the latter's `InitPostScript()` can rely on the former being
      ready.

    - Change the analyzer manager to (only) record port registrations
      happening before it's fully initialized. Its `InitPostScript()`
      then performs the actual registrations, knowing it can use the
      packet manager now.

This comes with a `cmake/` to add a missing include directory.
2021-07-18 10:00:49 +02:00
Tim Wojtulewicz
3c7a2b1450 Merge remote-tracking branch 'origin/topic/vlad/dns_rr_fixes'
* origin/topic/vlad/dns_rr_fixes:
  Add a TODO to return a correct status for ParseRR_WKS
  Remove unnecessary if
  Generate dns_WKS_reply event
  dns_HINFO_reply event was never being generated.
2021-07-15 11:33:44 -07:00
Tim Wojtulewicz
e75a40edb3 Update scripts/site/local-compat test for 4.2 cycle 2021-07-15 17:36:13 +00:00
Tim Wojtulewicz
62aa2fe7ba Merge remote-tracking branch 'origin/topic/robin/vector-string-tests'
* origin/topic/robin/vector-string-tests:
  Remove tests for deprecated operators.
  Add tests for operations on vectors of string.
2021-07-15 09:50:36 -07:00
Vlad Grigorescu
15b294098c dns_HINFO_reply event was never being generated.
On top of that, I modified the event to pass the relevant fields from the DNS message.
2021-07-15 09:56:38 -05:00
Vlad Grigorescu
a2a8870931 Add btest for DNS WKS RR. 2021-07-14 21:43:36 -05:00
Vlad Grigorescu
01660553d6 Add btest for DNS NSEC3PARAM RR. 2021-07-14 20:22:06 -05:00
Robin Sommer
8d19c43429 Remove tests for deprecated operators. 2021-07-14 11:23:13 +02:00
Robin Sommer
7f2769bd17 Add tests for operations on vectors of string. 2021-07-14 11:21:42 +02:00
Christian Kreibich
136a9baa42 Fix race conditions in scripts.base.frameworks.input.reread
On FreeBSD, this test showed two problems: (1) reordering problems
based on writing the predicate, event, and end-of-data updates into a
single file, (2) a race condition based on printing the entirety of
the table description argument in update events. The description
contains the destination table, and its content at the time an update
event gets processed isn't deterministic: depending on the number
of updates the reader thread has sent, the table will contain a
varying number of entries.
2021-07-12 13:25:03 -07:00
Christian Kreibich
4e75662963 Fix race condition in scripts.base.frameworks.input.invalid*
The invalidset and invalidtext tests loaded an input file via table
and event reads, in parallel. On FreeBSD this triggers an occasional
reordering of messages coming out of the reader thread vs the input
managers. This commit makes the table and event reads sequential,
avoiding the race.
2021-07-09 18:16:14 -07:00
Christian Kreibich
767cf2b518 Add a cluster controller testcase for agent-controller checkin
This verifies that in a setup with the supervisor creating both controller and
agent, the agent successfully checks in with the controller.
2021-07-08 13:12:53 -07:00
Christian Kreibich
04dda8b4a7 Update baselines affected by cluster controller changes 2021-07-08 13:12:53 -07:00
Christian Kreibich
7bee79b400 Add optional bare-mode boolean flag to Supervisor's node configuration
When omitted, the node inherits the Supervisor's bare-mode
status. When true/false, the new Zeek node will enable/disable bare
mode, respectively. It continues to load any scripts passed at the
command line and in the additional scripts list already provided in
the node configuration.

Includes testcase.
2021-07-08 13:12:53 -07:00
Christian Kreibich
36051dc9a1 Add support for setting environment variables via supervisor
The NodeConfig record now has a table for specifying environment variable names
and values, which the supervisor sets in the created node.

This also repositions the cpu_affinity member to keep the order the same in
the corresponding script-layer and in-core types.

Includes testcase.
2021-07-08 13:12:53 -07:00
Johanna Amann
7ec50bf434 Merge remote-tracking branch 'origin/topic/johanna/gh-859'
* origin/topic/johanna/gh-859:
  Add X509/SSL changes to NEWS
  X509: add check if function succeeds
  GH-1634: Address feedback
  Small indentation fixes in ssl-log-ext.zeek
  Fix memory leak in x509_check_cert_hostname bif
  Small bugfix and updates for external test hashes (SSL/X509)
  Baseline updates for recent SSL changes.
  Add ability to check if hostname is valid for a specific cert
  Add ssl_history field to ssl.log
  Add policy script suppressing certificate events
  Add new ssl-log-ext policy script
  Deprecate extract-certs-pem.zeek and add log-certs-base64.zeek
  Implement X509 certificate log caching
  Deprecate ICSI SSL notary script.
  Change SSL and X.509 logging format
  Enable OCSP logging by default.
  Split the code that handles X509 event hashing into its own file

Closes GH-859
2021-07-05 10:12:46 +01:00
Christian Kreibich
795a7ea98e Add a global log policy hook to the logging framework
This addresses the need for a central hook on any log write, which
wasn't previously doable without a lot of effort. The log manager
invokes the new Log::log_stream_policy hook prior to any filter-specific
hooks. Like filter-level hooks, it may veto a log write. Even when
it does, filter-level hooks still get invoked, but cannot "un-veto".

Includes test cases.
2021-07-02 12:42:45 -07:00
Johanna Amann
8972676e92 GH-1634: Address feedback
This commit addreses feedback for GH-1643, changing typos and renaming
one of the fields in x509.log.
2021-07-02 15:12:58 +01:00
Johanna Amann
6eff0594f3 Merge remote-tracking branch 'origin/topic/johanna/undate-cert-stuff'
* origin/topic/johanna/undate-cert-stuff:
  Update Mozilla CA list and CT anchors.
2021-07-02 13:05:04 +01:00
Christian Kreibich
937bdccab5 Skip input framework entries with missing but non-optional fields
The framework so far populated data structures with missing fields
even when those fields are defined without the &optional
attribute. When using the attribute, such entries continue to get
populated.

Update tests to reflect focus on unset fields.
2021-06-30 20:02:26 -07:00
Tim Wojtulewicz
3c0bb8f1dd Merge remote-tracking branch 'origin/topic/seth/small-builtin-plugin-fixes'
* origin/topic/seth/small-builtin-plugin-fixes:
  Fix tests
  Removed a non-functional builtin plugin preload loading mechanism
  Load the builtin-plugin preload files and fix the dev path.
2021-06-30 14:11:10 -07:00
Seth Hall
6c66f6ede5 Fix tests 2021-06-30 19:22:19 +00:00