Commit graph

12419 commits

Author SHA1 Message Date
Tim Wojtulewicz
02206f3215 clang-format: Other minor formatting changes 2021-09-27 10:49:48 -07:00
Tim Wojtulewicz
e97c14add5 clang-format: Other include ordering changes 2021-09-27 10:49:48 -07:00
Robin Sommer
c8f48385c1 Update doc submodule. 2021-09-27 14:06:01 +02:00
Christian Kreibich
94f5c0333f Merge branch 'topic/christian/oh-come-on'
* topic/christian/oh-come-on:
  Fix space issue in docker tag computation
2021-09-26 10:27:34 -07:00
Christian Kreibich
2734db2941 Fix space issue in docker tag computation
This fixes image uploads in the Github action introduced in ddae1398f1.

Co-authored-by: Benjamin Bannier <benjamin.bannier@corelight.com>
2021-09-26 10:22:59 -07:00
Tim Wojtulewicz
cb99ae2b7c clang-format: Enforce ordering of includes in ZBody 2021-09-25 11:52:55 -07:00
Tim Wojtulewicz
07e276ab2e clang-format: A few minor comment-spacing fixes 2021-09-25 11:52:55 -07:00
Tim Wojtulewicz
9cb54f5d44 clang-format: Force zeek-config.h to be earlier in the config ordering 2021-09-25 11:52:55 -07:00
Tim Wojtulewicz
016ac0f199 Merge remote-tracking branch 'origin/topic/timw/damnit-homebrew'
* origin/topic/timw/damnit-homebrew:
  Fixing homebrew, again.
2021-09-25 11:47:56 -07:00
Tim Wojtulewicz
dc4e273153 Fixing homebrew, again.
Homebrew apparently requires you to now specify the version of the package
you're updating. We previously could just run `brew update openssl` and it
would work. Now we must run `brew update openssl@1.1` for the command to
succeed.
2021-09-25 11:45:22 -07:00
Christian Kreibich
fc96f6a147 Merge branch 'topic/christian/fix-docker-doublebuild'
* topic/christian/fix-docker-doublebuild:
  Add .dockerignore to suppress btest artifacts
2021-09-24 20:49:35 -07:00
Christian Kreibich
3bd9748289 Add .dockerignore to suppress btest artifacts
We run btest in CI between image build and upload, and since its artifacts
weren't suppressed, the discrepancy caused the Dockerfile COPY to cache-miss.
2021-09-24 17:04:26 -07:00
Christian Kreibich
b5e9488389 Merge branch 'topic/bbannier/issue-1625'
* topic/bbannier/issue-1625:
  Switch published container image to debian:bullseye-slim
  Test container with BTest instead of container-structure-tests
  Add a minimal containerized environment
2021-09-24 11:15:35 -07:00
Tim Wojtulewicz
e5b163290d Merge remote-tracking branch 'origin/topic/vern/remove-uu'
* origin/topic/vern/remove-uu:
  fix up for linking w/ doc update
  documentation update
  script simplification that removes an unnecessary &is_assigned
  removing -uu functionality and associated script analysis now no longer needed
2021-09-24 10:31:56 -07:00
Benjamin Bannier
2db1ebb2a2 Switch published container image to debian:bullseye-slim 2021-09-24 11:48:49 +02:00
Christian Kreibich
d6c80f6d2c Test container with BTest instead of container-structure-tests
This patch replaces the container-strucuture-tests for the Zeek
container with a BTest-driven approach to provide a more familiar
experience. In addtion to `python3` for `btest` we also rely on `make`
being available in Github-hosted runners which at least currently seems
to be hold (probably pulled in as a dependency of CMake which is
officially included, see
https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md).
2021-09-24 11:48:49 +02:00
Benjamin Bannier
ddae1398f1 Add a minimal containerized environment
This patch adds a minimal Zeek environment packaged as a container.
Since this is intended both as a base layer for other images and as a
quick way to explore Zeek we install only zeek and zkg as basic
functionality.

Closes #1625.
2021-09-24 11:48:19 +02:00
zeek-bot
f50df2dda6 Update doc submodule [nomail] [skip ci] 2021-09-24 00:36:09 +00:00
Robin Sommer
dd5d6e1756 Merge branch 'topic/foxds/dcerpc_auth' of ssh://github.com/fox-ds/zeek
* 'topic/foxds/dcerpc_auth' of ssh://github.com/fox-ds/zeek:
  Fix protocol forwarding in dce_rpc-auth
  Fix protocol forwarding in dce_rpc-auth
2021-09-23 17:50:00 +02:00
FOX-DS
fef4531f78 Fix protocol forwarding in dce_rpc-auth 2021-09-23 08:50:11 -04:00
Robin Sommer
c5ebe299b1 Merge remote-tracking branch 'origin/topic/justin/conn-remove-empty-string-allocation'
* origin/topic/justin/conn-remove-empty-string-allocation:
  Avoid allocation of 0 length strings on new conns
2021-09-23 12:32:42 +02:00
Robin Sommer
47c35190a4 Sanity-check the method passed into ActiveHTTP.
Reported by Pierre Gaulon.
2021-09-23 12:21:23 +02:00
zeek-bot
ce143d78b0 Update doc submodule [nomail] [skip ci] 2021-09-23 00:42:02 +00:00
Tim Wojtulewicz
0a0ed65306 Merge remote-tracking branch 'origin/topic/robin/gh-54-sanitize'
* origin/topic/robin/gh-54-sanitize:
  Sanitize log files names before they go into system().
2021-09-22 12:17:05 -07:00
Tim Wojtulewicz
a49dcc8954 Merge remote-tracking branch 'origin/topic/johanna/dpd-packet-limit'
* origin/topic/johanna/dpd-packet-limit:
  PIA - switch size to int64_t
  Introduce dpd_max_packets
2021-09-22 12:16:56 -07:00
Vern Paxson
e2a5101d9d fix up for linking w/ doc update 2021-09-22 12:13:18 -07:00
Vern Paxson
1ff7ff06a8 documentation update 2021-09-22 11:21:46 -07:00
Vern Paxson
385e49491b script simplification that removes an unnecessary &is_assigned 2021-09-22 11:18:52 -07:00
Vern Paxson
509428a9dc removing -uu functionality and associated script analysis now no longer needed 2021-09-22 11:17:28 -07:00
Justin Azoff
971808ba3f Avoid allocation of 0 length strings on new conns
New connections already do

    conn_val->Assign(6, val_mgr->EmptyString());

This second assignment was effectively doing

    conn_val->Assign(6, "")

for all new connections, causing a new empty ZeekString to be allocated.

On a pcap containing 100% syn packets this gives a noticeable perf improvement.

    Benchmark #1: zeek.orig -r /data/pcaps/scan.pcap
      Time (mean ± σ):     47.082 s ±  0.547 s    [User: 57.555 s, System: 9.114 s]
      Range (min … max):   46.516 s … 47.834 s    5 runs

    Benchmark #2: zeek -r /data/pcaps/scan.pcap
      Time (mean ± σ):     45.260 s ±  0.378 s    [User: 55.438 s, System: 8.537 s]
      Range (min … max):   44.783 s … 45.789 s    5 runs

    Summary
      'zeek -r /data/pcaps/scan.pcap' ran
        1.04 ± 0.01 times faster than 'zeek.orig -r /data/pcaps/scan.pcap'
2021-09-22 07:53:03 -04:00
zeek-bot
8a1b32c877 Update doc submodule [nomail] [skip ci] 2021-09-22 00:32:30 +00:00
Tim Wojtulewicz
c87e290bf1 Merge remote-tracking branch 'origin/topic/timw/fixing-homebrew-again'
* origin/topic/timw/fixing-homebrew-again:
  Use `brew update` instead of `brew update-reset` in CI macOS prepare script
2021-09-21 14:13:30 -07:00
Tim Wojtulewicz
1a4af90389 Use brew update instead of brew update-reset in CI macOS prepare script
Using `brew update-reset` causes homebrew to reset to homebrew's HEAD commit, which may
be buggy and broken. It appears whatever Cirrus was doing previously on their Catalina
VM is no longer a problem, and so update-reset isn't required anymore. Switch to
`brew update` to make sure we still get newer versions of the packages, but is
actually a versioned release of homebrew.
2021-09-21 13:05:33 -07:00
Tim Wojtulewicz
a507d4294d Merge remote-tracking branch 'origin/topic/timw/test-disabling-profiling'
* origin/topic/timw/test-disabling-profiling:
  Disable script profiling/coverage on sanitizer builds
2021-09-21 09:44:55 -07:00
Tim Wojtulewicz
8354bff91c Disable script profiling/coverage on sanitizer builds 2021-09-21 09:43:08 -07:00
Robin Sommer
74680bf4e6 Merge remote-tracking branch 'origin/topic/justin/software-framework-parse-cache'
* origin/topic/justin/software-framework-parse-cache:
  Restore behavior of Software::register event
  Optimzie software framework version parsing
2021-09-21 18:00:46 +02:00
Robin Sommer
2fc12d5bed Merge branch 'topic/foxds/dce_itype_opnums' of ssh://github.com/fox-ds/zeek
* 'topic/foxds/dce_itype_opnums' of ssh://github.com/fox-ds/zeek:
  Add IType opnum mapping
2021-09-21 17:56:13 +02:00
Tim Wojtulewicz
5c0669d9a4 Merge remote-tracking branch 'origin/topic/christian/rehash-comphash'
* origin/topic/christian/rehash-comphash:
  Add btests for new functionality
  Remove unused HashKey constructor and reorder for consistency
  Refactor CompHash class to use new HashKey buffering features
  Add debug string and ODesc support to HashKey class
  Refactor HashKey class to support read/write operations
  Add unit tests for memory helpers
  Add memory sizing/alignment helpers to util.cc/h
  Ensure table/set HashKey buffer reservation and writes happen in same order
2021-09-21 07:45:38 -07:00
Christian Kreibich
cfcf1f83cc Add btests for new functionality
- Expand language.set to cover sets of sets
- Expand language.table to cover tables indexed with tables
- Add language.table-nested-set-ordering to capture the reproducer from GHI-1753
2021-09-20 17:51:43 -07:00
Christian Kreibich
10e8d36340 Remove unused HashKey constructor and reorder for consistency
One of the HashKey constructors was only used in the old CompHash code.
This aso reorders some constructors and the destructor for readability.
2021-09-20 17:51:43 -07:00
Christian Kreibich
4d58b98c70 Refactor CompHash class to use new HashKey buffering features
This preserves the previous hash key buffer layout (so the testsuite still
passes) and overall approach but gets rid of the codepath for writing singleton
serializations. This code path required a fourth switch block over all types
(besides reads, writes, and size computation) and was inconsistent with the one
for writing non-atomic types.
2021-09-20 17:51:43 -07:00
Christian Kreibich
b6a11a69db Add debug string and ODesc support to HashKey class
This allows tracing of hash key buffer reservations, reads, and writes via a new
debug stream, and supports printing a summary of a HashKey object via
Describe(). The latter comes in handy e.g. in TableVal::Describe() (where
including the hash key is now available but commented out).
2021-09-20 17:51:43 -07:00
Christian Kreibich
82822b1e07 Refactor HashKey class to support read/write operations
This preserves the optimization of storing values directly in the key_u member
union when feasible, and using a variable size buffer otherwise. It also adds
bounds-checking for that buffer, moves size arguments to size_t, decouples
construction from hash computation, emulates the tagging feature found in
SerializationFormat to assist troubleshooting, and switches feasible
reinterpret_casts to static_casts.
2021-09-20 17:51:43 -07:00
Christian Kreibich
2585ccd873 Add unit tests for memory helpers 2021-09-20 17:51:43 -07:00
Christian Kreibich
c5cceaf5ad Add memory sizing/alignment helpers to util.cc/h
This functionality previously lived in the CompHash class, with one difference:
this removes a discrepancy between the offset aligner and the memory pointer
aligner/padder. The size aligner used to align the provided offset and then add an
additional alignment size (for example, 1 aligned to 4 wouldn't yield 4 but 8).
Like the memory aligners it now only rounds up as needed.

Includes unit tests.
2021-09-20 17:51:43 -07:00
Christian Kreibich
5fc8d89897 Ensure table/set HashKey buffer reservation and writes happen in same order
This takes the existing sorting for table index hashkeys we had in place during
hash key writes and applies it also during buffer size reservation. It changes
the approach slightly: the underlying map now points to the TableVal entry index
vals directly, rather than to the numerical index into an additional list that
gets built up to store those indexes. Doing so removes the need for that list.
2021-09-20 17:51:43 -07:00
zeek-bot
1260f6b585 Update doc submodule [nomail] [skip ci] 2021-09-21 00:43:52 +00:00
Justin Azoff
ef5fb790ef Restore behavior of Software::register event
Use an intermediary event to ensure that software versions are parsed
before calling Software::register.
2021-09-20 14:38:47 -04:00
Robin Sommer
31d3fb0f6c Merge https://github.com/gpotter2/zeek.
Changes during merge:
  - Add dedicated test (w/ trace "client_timestamp_enabled.pcapng" from Cloudshark)
  - Change types from signed to unsigned.
  - Add cast for bit-shifting operand.
  - clang-format run
2021-09-20 11:41:29 +02:00
FOX-DS
4a19acbef2 Add IType opnum mapping 2021-09-20 03:56:20 -04:00