Commit graph

16612 commits

Author SHA1 Message Date
Robin Sommer
747e26297b
Spicy: Update for https://github.com/zeek/spicy/pull/1738. 2024-05-13 09:25:37 +02:00
Tim Wojtulewicz
a9649026ae Merge remote-tracking branch 'origin/topic/timw/ci-ubuntu-24-lts'
* origin/topic/timw/ci-ubuntu-24-lts:
  CI: Update asan and ubsan tasks to use Ubuntu 22.04 VM
  CI: Replace Ubuntu 23.10 with Ubuntu 24.04
2024-05-10 10:19:53 -07:00
Robin Sommer
82be6425e6
Merge remote-tracking branch 'origin/topic/robin/gh-3561-forward-to-udp'
* origin/topic/robin/gh-3561-forward-to-udp:
  Update docs.
  Add explicit children life-cycle management method to analyzers.
  Spicy: Support UDP in Spicy's `protocol_*` runtime functions.
  Add method to analyzer to retrieve direct child by name.
  Extend PIA's `FirstPacket` API.
  Spicy: Prepare for supporting forwarding to protocols other than TCP.
2024-05-10 11:15:20 +02:00
Robin Sommer
4a63495b1d
Merge remote-tracking branch 'origin/topic/robin/gh-3725-service'
* origin/topic/robin/gh-3725-service:
  Spicy: Fix service reporting for replaced analyzers.
  Fix include of private file in public header
2024-05-10 11:07:40 +02:00
Tim Wojtulewicz
7de30a4c80 CI: Update asan and ubsan tasks to use Ubuntu 22.04 VM 2024-05-08 17:23:17 -07:00
Tim Wojtulewicz
e72714410a CI: Replace Ubuntu 23.10 with Ubuntu 24.04 2024-05-08 15:17:35 -07:00
Tim Wojtulewicz
0301d2eb22 Merge remote-tracking branch 'origin/topic/timw/update-zeekctl-zkg'
* origin/topic/timw/update-zeekctl-zkg:
  Update package-manager submodule [nomail]
  Update zeekctl submodule [nomail]
2024-05-08 13:10:43 -07:00
Tim Wojtulewicz
b2e4fbe58d Merge remote-tracking branch 'origin/topic/vern/gen-zam-multi-files'
* origin/topic/vern/gen-zam-multi-files:
  enable ZAM operation specifications to reside in multiple files (not yet used)
2024-05-08 13:09:35 -07:00
Vern Paxson
1989dc5e5a enable ZAM operation specifications to reside in multiple files (not yet used) 2024-05-08 12:50:49 -07:00
Tim Wojtulewicz
336ce01f73 Update package-manager submodule [nomail] 2024-05-08 12:22:31 -07:00
Tim Wojtulewicz
0de454b499 Update zeekctl submodule [nomail] 2024-05-08 12:22:17 -07:00
Tim Wojtulewicz
2c46d3139c Merge remote-tracking branch 'origin/topic/timw/3417-packet-analysis-detail'
* origin/topic/timw/3417-packet-analysis-detail:
  Move packet_analysis::Dispatcher to detail namespace
2024-05-08 09:55:16 -07:00
Robin Sommer
93a424b28a
Spicy: Fix service reporting for replaced analyzers.
We accidentally applied analyzer mappings when looking up an
analyzer's name from scriptland.

Closes #3725.
2024-05-08 14:01:46 +02:00
Benjamin Bannier
4e6bbd9756
Fix include of private file in public header 2024-05-08 12:50:42 +02:00
Robin Sommer
2f78a93ee3
Update docs. 2024-05-08 08:50:06 +02:00
zeek-bot
8e06e1cad0 Update doc submodule [nomail] [skip ci] 2024-05-08 00:19:30 +00:00
Tim Wojtulewicz
554294bb84 Merge remote-tracking branch 'origin/topic/vern/ssh-half-duplex'
* origin/topic/vern/ssh-half-duplex:
  make SSH analyzer robust to half-duplex connections
2024-05-07 12:02:43 -07:00
Vern Paxson
a0888b7e36 make SSH analyzer robust to half-duplex connections 2024-05-07 11:40:47 -07:00
Tim Wojtulewicz
29f5a49baf Merge remote-tracking branch 'origin/topic/christian/private_address_clarification'
* origin/topic/christian/private_address_clarification:
  Clarify membership in the Site::private_address_space prefix list. [skip ci]
2024-05-07 10:26:50 -07:00
Tim Wojtulewicz
d463141ded Merge remote-tracking branch 'origin/topic/christian/fix-zeekygen-crash'
* origin/topic/christian/fix-zeekygen-crash:
  Avoid segfault when generating Zeekygen docs on Zeek-internal identifiers.
  Add btest for Zeekygen docs extraction on identifiers defined by the Zeek core.
2024-05-07 10:26:19 -07:00
Robin Sommer
b4f68a2681
Add explicit children life-cycle management method to analyzers. 2024-05-07 18:19:47 +02:00
Robin Sommer
a2ae9c4b02
Spicy: Support UDP in Spicy's protocol_* runtime functions.
This extends the ability to feed new payload back into Zeek's analyzer
pipeline from TCP to now also UDP.

Note: We don't extend this further to ICMP because the ICMP analyzer
cannot be dynamically instantiated (Zeek aborts when trying so). As
ICMP isn't very interesting from use-case perspective anyways, that
seems fine.

Closes #3561.
2024-05-07 18:19:46 +02:00
Robin Sommer
df3d50ea07
Add method to analyzer to retrieve direct child by name. 2024-05-07 18:19:46 +02:00
Robin Sommer
2ec44f098f
Extend PIA's FirstPacket API.
`FirstPacket()` so far supported only TCP. To extend this to UDP, we
move the method into the PIA base class; give it a protocol parameter
for the case that there's no actual packet is available; and add the
ability to create fake UDP packets as well, not just TCP.

This whole thing is pretty ugly to begin with, and this doesn't make
it nicer, but we need this extension that so we can feed UDP data into
the signature engine that's tunneled over other protocols. Without the
fake packets, DPD signatures in particular wouldn't have anything to
match on.
2024-05-07 18:19:46 +02:00
Robin Sommer
8dd3debeae
Spicy: Prepare for supporting forwarding to protocols other than TCP.
So far the Spicy runtime supported forwarding data into other
analyzers only for TCP analyzers. This puts branching logic in place
that let the relevant runtime functions dispatch differently based on
the target transport-layer protocol. We don't implement anything else
than TCP yet; that will come next.

Along with the internal changes, this also updates the user-visible
runtime function to pass protocol information in. For now, this
likewise remains limited to TCP. The function signatures are chosen so
that they stay backwards-compatible to previous Spicy version. In
particular, they default to TCP where not otherwise specified.
2024-05-07 14:44:52 +02:00
Robin Sommer
9c1ecd205c
Updating CHANGES and VERSION, and bump Spicy and docs. 2024-05-07 10:03:17 +02:00
Robin Sommer
8ce3c877ff
Merge remote-tracking branch 'origin/topic/robin/gh-3573-replaces-cleanup'
* origin/topic/robin/gh-3573-replaces-cleanup:
  Fix packet analyzer replacement.
  Spicy: Wenn replacing an analyzer add a component mapping.
  Add component API to transparently remap one component to another one.
  Move enabled/disabled functionality from analyzers into `Component` base class API.
2024-05-07 09:45:25 +02:00
Robin Sommer
083c682878
Merge remote-tracking branch 'origin/topic/robin/gh-3440-file-handles'
* origin/topic/robin/gh-3440-file-handles:
  Spicy: Query Zeek scriptland for file handles.
2024-05-07 09:44:41 +02:00
Robin Sommer
383a77dab7
Merge remote-tracking branch 'origin/topic/robin/gh-3606-port-enum'
* origin/topic/robin/gh-3606-port-enum:
  Spicy: Cleanup some runtime code.
  Spicy: Map Spicy's `Protocol` enum to Zeek's `transport_proto`.
2024-05-07 09:42:04 +02:00
zeek-bot
b3fbe50c7f Update doc submodule [nomail] [skip ci] 2024-05-07 00:10:28 +00:00
Tim Wojtulewicz
fc0d4d2216 Merge remote-tracking branch 'origin/topic/timw/update-broker'
* origin/topic/timw/update-broker:
  Update broker submodule [nomail]
2024-05-06 17:00:01 -07:00
Tim Wojtulewicz
03c5f18ad0 Update broker submodule [nomail] 2024-05-06 16:04:12 -07:00
Tim Wojtulewicz
fb0dab2fb2 Merge remote-tracking branch 'origin/topic/timw/3389-tuning-defaults-deprecation'
* origin/topic/timw/3389-tuning-defaults-deprecation:
  Move the options from policy/tuning/defaults to actual Zeek defaults, deprecate that package
2024-05-06 11:16:34 -07:00
Tim Wojtulewicz
6821a41c4e Move the options from policy/tuning/defaults to actual Zeek defaults, deprecate that package 2024-05-06 11:13:04 -07:00
Robin Sommer
ccfeffaf2b
Fix packet analyzer replacement.
Also reworking the existing test, which was pretty odd/broken.
2024-05-06 09:45:11 +02:00
Robin Sommer
3a469b3619
Spicy: Wenn replacing an analyzer add a component mapping.
This uses the new API to replace components internally.

With these changes in place, replacing protocol analyzers now don't
need to register their ports anymore if they match what the original
analyzer was using (because the old one's registrations will map
over).

Packet analyzer replacement doesn't quite work yet but will be fixed
in next commit.

Closes #3573.
2024-05-06 09:45:11 +02:00
Robin Sommer
5d0c61e68b
Add component API to transparently remap one component to another one.
When a specific component is requested through its tag or name, one
can now have the component manager transparently return a different
one that has been registered to replace the original one. We limit
this to disabled components to avoid unnecessary confusion. That also
means that remappings are currently only supported for analyzers
(because other types of components cannot be disabled for now, per the
previous change).
2024-05-06 09:45:11 +02:00
Robin Sommer
ac1a7508ee
Move enabled/disabled functionality from analyzers into Component base class API.
The different analyzers types all had their own methods for
enabling/disabling their availability. This change abstracts that into
a new API inside their base class (`plugin::Component`) so that they
can be toggled in a unified way.

In principle, other types of components could/should use this as well
now, so that, e.g., an input reader's availability could be toggled at
runtime. The code doesn't make that broader change for now because it
would requires a series of changes wherever these other component
types are being used. However, that means that one now could try
toggling some other component through the new API without that having
any effect. To catch that, there's a runtime check in place that turns
any such attempt into an internal error.
2024-05-06 09:45:11 +02:00
Robin Sommer
56b9a79a65
Spicy: Query Zeek scriptland for file handles.
Like traditional file analyzers, we now query Zeek's
`get_file_handle()` event for handles when a connection begins
analyzing an embedded file. That means that Spicy-side protocol
analyzers that are forwarding data into file analysis now need to call
Zeek's `Files::register_protocol()` and provide a callback for
computing file handles. If that's missing, Zeek will now issue a
warning. This aligns with the requirements Zeek's traditional protocol
analyzers. (If the EVT file defines a protocol analyzer to `replace`
an existing one, that one's `register_protocol()` will be consulted.)

Because Zeek's `get_file_handle()` event requires a current
connection, if a Spicy file analyzer isn't directly part of a
connection context (e.g., with nested files), we continue to use
hardcoded, built-in file handle. Scriptland won't be consulted in
that case, just like before.

Closes #3440.
2024-05-06 09:20:38 +02:00
Christian Kreibich
0554951cb6 Clarify membership in the Site::private_address_space prefix list. [skip ci]
IANA's IPv6 special-purpose address registry now has members that technically
meet the definition of not being globally reachable, but don't imply operating
locally. An example: https://datatracker.ietf.org/doc/draft-ietf-6man-sids/06/

This change just explains that distinction.
2024-05-04 11:21:26 -07:00
zeek-bot
966d411ed5 Update doc submodule [nomail] [skip ci] 2024-05-04 00:21:41 +00:00
Christian Kreibich
0bde62efec Avoid segfault when generating Zeekygen docs on Zeek-internal identifiers.
Identifiers that Zeek generates explicitly in-core for example during component management
("Analyzer::ANALYZER_FOO", "Input::READER_FOO", etc), aren't associated with any
scripts and would lead to nullpointer derefs when trying to identify
modification time.

This fix returns a zero timestamp in such cases, ensuring it never triggers docs
refreshes. We do the same e.g. in PackageInfo instances.
2024-05-03 12:23:49 -07:00
Christian Kreibich
9d89b1156c Add btest for Zeekygen docs extraction on identifiers defined by the Zeek core.
Mainly, this should not crash. :-) The baseline output file also should remain
empty, since Zeekygen's staleness test should conclude that it's sufficiently
fresh.
2024-05-03 12:22:42 -07:00
Tim Wojtulewicz
da705c1199 Revert "Install gcc9 on CentOS Stream 8"
This reverts commit 09cc5c37e0.
2024-05-02 19:12:03 -07:00
Tim Wojtulewicz
09cc5c37e0 Install gcc9 on CentOS Stream 8 2024-05-02 19:10:58 -07:00
Tim Wojtulewicz
cdcd83c8cc Merge remote-tracking branch 'origin/topic/vern/val-footprint-strings'
* origin/topic/vern/val-footprint-strings:
  refine Val "footprint" to equate long strings with multiple objects
2024-05-02 19:01:06 -07:00
Tim Wojtulewicz
404c756286 Merge remote-tracking branch 'origin/topic/timw/const-rulematcher'
* origin/topic/timw/const-rulematcher:
  Constify classes in RuleMatcher, fixes c++20 build failure
2024-05-02 10:21:55 -07:00
Tim Wojtulewicz
38dae684bd Constify classes in RuleMatcher, fixes c++20 build failure 2024-05-01 16:59:54 -07:00
Vern Paxson
1f9fa4304d refine Val "footprint" to equate long strings with multiple objects 2024-04-29 12:39:36 -07:00
Tim Wojtulewicz
d7e30d9ee2 Merge remote-tracking branch 'origin/topic/johanna/gh-3700'
* origin/topic/johanna/gh-3700:
  Fix cid propagation into files.log
2024-04-29 09:09:41 -07:00