Commit graph

3795 commits

Author SHA1 Message Date
Christian Kreibich
337c7267e0 Management framework: allow agents to communicate with cluster nodes
This provides Broker-level plumbing that allows agents to reach out to their
managed Zeek nodes and collect responses.

As a first event, it establishes Management::Node::API::notify_agent_hello,
to notify the agent when the cluster node is ready to communicate.

Also a bit of comment rewording to replace use of "data cluster" with simply
"cluster", to avoid ambiguity with data nodes in SumStats, and expansion of
test-all-policy.zeek and related/dependent tests, since we're introducing new
scripts.
2022-04-15 18:51:54 -07:00
Tim Wojtulewicz
d0e13a1e79 Merge remote-tracking branch 'origin/topic/vern/table-attr-fixes'
* origin/topic/vern/table-attr-fixes:
  updates for btests - new cases to check, new baselines
  updates for btests - new cases to check, new baselines
  fix for ill-formed (complex) &default function
  type-checking for use of empty table constructors in expressions
  catch empty constructors used for type inference suppress repeated error messages
  factoring to make checking of &default attributes externally accessible
  bug fix for empty table constructors with &default attributes (plus a typo)
2022-04-05 18:05:15 -07:00
Vern Paxson
84dc430e00 fix & btest for ZAM bug with inlined nested loop 2022-04-01 14:04:50 -07:00
Vern Paxson
77007eccf8 updates for btests - new cases to check, new baselines 2022-03-31 20:42:54 -07:00
Vern Paxson
16a16948a1 updates for ZAM optimization 2022-03-23 15:36:36 -07:00
Vern Paxson
1f27edf756 btest tweaks I overlooked 2022-03-23 15:36:35 -07:00
Vern Paxson
ae75635c5a new btests to cover extended functionality & associatd errors 2022-03-23 15:36:35 -07:00
Vern Paxson
64775a8192 updates to btests to support switch to expression-based initialization 2022-03-23 15:36:35 -07:00
Tim Wojtulewicz
c299301372 Update zeek-testing-private hash [nomail] [skip ci] 2022-03-22 13:12:12 -07:00
Tim Wojtulewicz
2386b650cd Merge remote-tracking branch 'ynadji/raw_bytes_to_v6_addr'
* ynadji/raw_bytes_to_v6_addr:
  add raw_bytes_to_v6_addr in docs when raw_bytes_to_v4_addr is present
  Zero out bytes by default for consistent return value on error
  Add tests for raw_bytes_to_v6_addr
  Add raw_bytes_to_v6_addr function
2022-03-10 11:09:49 -07:00
Yacin Nadji
a2320ffe88 Zero out bytes by default for consistent return value on error 2022-03-09 11:15:48 -05:00
Yacin Nadji
45ab85c09e Add tests for raw_bytes_to_v6_addr 2022-03-08 17:50:26 -05:00
Johanna Amann
ff4f3f359c Merge remote-tracking branch 'origin/topic/vern/rec-constr-check'
* origin/topic/vern/rec-constr-check:
  associated btest
  fix base scripts to include mandatory fields in record constructors
  restored record constructor checking for missing-but-mandatory fields
2022-03-02 13:49:31 +00:00
Johanna Amann
f264a9eccf Merge remote-tracking branch 'origin/topic/christian/gh-1982'
* origin/topic/christian/gh-1982:
  The is_num(), is_alpha(), and is_alnum() BiFs now return F on empty string
  Expand testcases around is_num(), is_alpha(), is_alnum(), is_ascii() BiFs
  Clarify is_ascii() BiF docstring re behavior on empty strings
  Fix minor indentation bugs in strings.bif
2022-03-02 08:25:41 +00:00
Johanna Amann
d38923cfcf Merge remote-tracking branch 'origin/topic/johanna/tls12-decryption'
Documentation is missing and will be added in the next couple of hours.

* origin/topic/johanna/tls12-decryption: (24 commits)
  TLS decryption: add test, fix small issues
  Address PR feedback
  TLS decryption: refactoring, more comments, less bare pointers
  Small code fix and test baseline update.
  SSL decryption: refactor TLS12_PRF
  SSL decryption: small style changes, a bit of documentation
  Deprecation and warning fixes
  Clang-format updates
  add missing call to EVP_KDF_CTX_set_params
  TLS decryption: remove payload from ssl_encrypted_data again.
  TLS 1.2 decryption: adapt OpenSSL 3.0 changes for 1.1
  ssl: adapt TLS-PRF to openSSL 3.0
  ssl/analyzer: potentially fix memory leaks caused by bytestrings
  analyzer/ssl: several improvements
  analyzer/ssl: defensive key length check + more debug logging
  testing: feature gate ssl/decryption test
  testing: add ssl/decryption test
  analyzer/ssl: handle missing <openssl/kdf.h>
  analyzer/ssl: silence warning in DTLS analyzer
  analyzer/ssl: move proc-{client,server}-hello into the respective analyzers
  ...
2022-03-02 08:20:39 +00:00
Johanna Amann
590d4aa13e TLS decryption: add test, fix small issues
Add a test loading keys from an external file. Make some debug messages
slightly better and remove unnecessary debug output.
2022-03-01 17:45:11 +00:00
Vern Paxson
b3ff872bd7 associated btest 2022-02-28 17:38:32 -08:00
Christian Kreibich
19bfa071e0 Expand testcases around is_num(), is_alpha(), is_alnum(), is_ascii() BiFs 2022-02-28 13:09:32 -08:00
Christian Kreibich
40fa1a0769 Merge branch 'topic/christian/controller-renaming'
* topic/christian/controller-renaming:
  Bump external cluster testsuite to reflect Management framework reorg
  Bump zeek-client to reflect Management framework reorg
  Reorg of the cluster controller to new "Management framework" layout
2022-02-10 18:10:08 -08:00
Christian Kreibich
59fa19424d Bump external cluster testsuite to reflect Management framework reorg 2022-02-09 18:09:46 -08:00
Christian Kreibich
54aaf3a623 Reorg of the cluster controller to new "Management framework" layout
- This gives the cluster controller and agent the common name "Management
framework" and changes the start directory of the sources from
"policy/frameworks/cluster" to "policy/frameworks/management". This avoids
ambiguity with the existing cluster framework.

- It renames the "ClusterController" and "ClusterAgent" script modules to
"Management::Controller" and "Management::Agent", respectively. This allows us
to anchor tooling common to both controller and agent at the "Management"
module.

- It moves common configuration settings, logging, requests, types, and
utilities to the common "Management" module.

- It removes the explicit "::Types" submodule (so a request/response result is
now a Management::Result, not a Management::Types::Result), which makes
typenames more readable.

- It updates tests that depend on module naming and full set of scripts.
2022-02-09 18:09:42 -08:00
Christian Kreibich
9a7d5c986e Merge branch 'topic/christian/cluster-controller-get-nodes'
* topic/christian/cluster-controller-get-nodes:
  Bump external cluster testsuite
  Bump zeek-client for the get-nodes command
  Add ClusterController::API::get_nodes_request/response event pair
  Support optional listening ports for cluster nodes
  Don't auto-publish Supervisor response events in the cluster agent
  Make members of the ClusterController::Types::State enum all-caps
  Be more conservative with triggering request timeout events
  Move redefs of ClusterController::Request::Request to their places of use
  Simplify ClusterController::API::set_configuration_request/response
2022-02-03 13:19:34 -08:00
Johanna Amann
b1415dd364 Merge remote-tracking branch 'origin/topic/johanna/gh-1952'
* origin/topic/johanna/gh-1952:
  Match DPD TLS signature on one-sided connections.

Fixes GH-1952
2022-02-03 11:24:34 +00:00
Christian Kreibich
3b79c36146 Bump external cluster testsuite 2022-02-02 23:00:37 -08:00
Robin Sommer
5b1691f162
Merge remote-tracking branch 'origin/topic/zeke/gh-1890'
* origin/topic/zeke/gh-1890:
  Consistently warn about mixing vector and scalar operand depreciaton
2022-02-02 09:46:00 +01:00
Johanna Amann
95f1565498 Match DPD TLS signature on one-sided connections.
This commit changes DPD matching for TLS connections. A one-sided match
is enough to enable DPD now.

This commit also removes DPD for SSLv2 connections. SSLv2 connections do
basically no longer happen in the wild. SSLv2 is also really finnicky to
identify correctly - there is very little data required to match it, and
basically all matches today will be false positives. If DPD for SSLv2 is
still desired, the optional signature in policy/protocols/ssl/dpd-v2.sig
can be loaded.

Fixes GH-1952
2022-02-01 16:51:21 +00:00
Robin Sommer
9b0d525728
Let our TCP-based application analyzers operate without any TCP parent analyzer.
Conceptually, a TCP-based application analyzer should not need any
knowledge about the underlying TCP analysis; it's supposed to just
process its reassembled input stream as it's handed over. But our
analyzers break that assumption at a few places because sometimes
knowledge about the TCP state of the connection can be helpful for
heuristics. This is fine as long as there actually *is* a TCP parent
analyzer available. Sometimes, however, there isn't: if the payload
stream is encapsulated inside another application-layer protocol, the
semantic link to TCP is broken. And if the outer connection is even
UDP, then we don't have a TCP analyzer at all.

We didn't handle this situation well so far. Most analyzers needing
TCP state would just crash if there's no TCP analyzer (in debug mode
with an `assert`, in release mode with a null pointer deref ...). Only
HTTP did the right thing already: check if TCP is available and adapt
accordingly.

We know extend that check to all other analyzers as well: all accesses
to `TCP()` are guarded, with reasonable defaults if not available.
It's actually a pretty small change overall, which is evidence for how
little this layering violation actually matters.

The existing behavior is what's causing
https://github.com/corelight/zeek-spicy-openvpn/issues/3.
2022-01-28 16:25:27 +01:00
Tim Wojtulewicz
0793a38cc5 Merge remote-tracking branch 'origin/topic/vern/vec-slice-bug'
* origin/topic/vern/vec-slice-bug:
  btest to catch vector slice assignment issues
  bug fix for vector slice assignment
2022-01-25 13:52:19 -07:00
Vern Paxson
c378017269 btest to catch vector slice assignment issues 2022-01-25 10:47:33 -08:00
Zeke
7ec2fa2ac9 Consistently warn about mixing vector and scalar operand depreciaton
Resolves #1890
2022-01-21 14:34:48 -08:00
Johanna Amann
b78f30339f TLS decryption: refactoring, more comments, less bare pointers
This commit refactors TLS decryption, adds more comments in scripts and
in C++ source-code, and removes use of bare pointers, instead relying
more on stl data types.
2022-01-17 15:04:44 +00:00
Johanna Amann
689b06d9bd Merge remote-tracking branch 'origin/master' into topic/johanna/tls12-decryption 2022-01-17 10:56:06 +00:00
Johanna Amann
becc966106 Merge remote-tracking branch 'origin/topic/vern/vec-del-bug'
* origin/topic/vern/vec-del-bug:
  new btest to catch regressions to previous behavior/crash
  fix for adding a non-managed type to an empty vector
2022-01-17 10:35:51 +00:00
Vern Paxson
d6a68ada22 new btest to catch regressions to previous behavior/crash 2022-01-14 14:10:15 -08:00
Tim Wojtulewicz
3d9d6e953b Merge remote-tracking branch 'origin/topic/vern/when-lambda'
* origin/topic/vern/when-lambda:
  explicitly provide the frame for evaluating a "when" timeout expression
  attempt to make "when" btest deterministic
  tests for new "when" semantics/errors
  update existing test suite usage of "when" statements to include captures
  update uses of "when" in base scripts to include captures
  captures for "when" statements update Triggers to IntrusivePtr's and simpler AST traversal introduce IDSet type, migrate associated "ID*" types to "const ID*"
  logic (other than in profiling) for assignments that yield separate values
  option for internal use to mark a function type as allowing non-expression returns
  removed some now-obsolete profiling functionality
  minor commenting clarifications
2022-01-14 14:41:42 -07:00
Johanna Amann
543c992e66 Small code fix and test baseline update.
After this, tests hopefully should pass consistently.
2022-01-11 11:20:05 +00:00
Johanna Amann
304a06bb88 Merge remote-tracking branch 'origin/master' into topic/johanna/tls12-decryption 2022-01-11 11:04:20 +00:00
Robin Sommer
964293209b
Merge remote-tracking branch 'origin/topic/robin/gh1844-host'
* origin/topic/robin/gh1844-host:
  Fix host header normalization in intel framework.
  Switch to recording unmodified HTTP header.
2022-01-10 14:43:30 +01:00
Vern Paxson
fa848167bb attempt to make "when" btest deterministic 2022-01-07 21:52:11 -08:00
Vern Paxson
c5ab916710 tests for new "when" semantics/errors 2022-01-07 14:54:47 -08:00
Vern Paxson
b59ee83979 update existing test suite usage of "when" statements to include captures 2022-01-07 14:54:06 -08:00
Tim Wojtulewicz
4c1b3c82d9 Merge remote-tracking branch 'origin/topic/vern/record-constructor-bug'
* origin/topic/vern/record-constructor-bug:
  bug fix for reporting poorly formed record constructors
2022-01-06 15:07:13 -07:00
Vern Paxson
16be867fef test suite alternative baseline fixes for recent test renaming 2022-01-06 13:54:07 -07:00
Tim Wojtulewicz
03b2adb312 Fixed local-compat test and added NEWS section for 5.0 2022-01-05 09:11:45 -07:00
Johanna Amann
d1e7134156 Merge remote-tracking branch 'origin/master' into topic/johanna/tls12-decryption 2022-01-05 10:27:55 +00:00
Christian Kreibich
e0e779ade1 Bump the zeek-testing-cluster testsuite 2022-01-04 16:17:33 -08:00
Tim Wojtulewicz
5400d789fe Merge remote-tracking branch 'origin/topic/vern/local-scope-work'
* origin/topic/vern/local-scope-work:
  added notice of deprecation to NEWS
  test suite update
  deprecation warning on use of out-of-scope local
2022-01-03 13:56:27 -07:00
Tim Wojtulewicz
a75b46bd12 Merge remote-tracking branch 'origin/topic/robin/gh1822-bittorrent-re'
* origin/topic/robin/gh1822-bittorrent-re:
  Switch BitTorrent analyzer to Zeek's regex engine
  Adding test for BitTorrent tracker.
2022-01-03 13:55:18 -07:00
Vern Paxson
38c6c8f073 test suite update 2021-12-25 16:04:08 -08:00
Vern Paxson
4f566f35ee bug fix for reporting poorly formed record constructors 2021-12-22 14:26:03 -08:00