Commit graph

14939 commits

Author SHA1 Message Date
Christian Kreibich
e25d9bdee9 Merge branch 'topic/christian/gh-2761-default-localnets'
* topic/christian/gh-2761-default-localnets:
  Update NEWS to cover new Site::local_nets behavior.
  Bump external testsuites to reflect updated baselines
  Add btests for new Site::local_nets behavior
  Update plugins.hooks baseline to reflect added config framework activity
  Update scripts.policy.misc.dump-events baseline
  Update btest baselines to reflect the use of local address ranges.
  Tighten local-nets filtering in the logging framework's path-func-column-demote test
  Fix scripts.policy.frameworks.intel.removal test given address locality info
  Treat private address space as site-local by default
  Provide a mechanism to suppress logging of internal config framework activity
2023-03-15 20:05:40 -07:00
Christian Kreibich
7a21a90f19 Updating CHANGES and VERSION. 2023-03-15 20:00:10 -07:00
zeek-bot
edf726f84a Update doc submodule [nomail] [skip ci] 2023-03-16 00:41:33 +00:00
Christian Kreibich
c456f0206d Update NEWS to cover new Site::local_nets behavior. 2023-03-15 17:33:00 -07:00
Christian Kreibich
fa15d1b258 Bump external testsuites to reflect updated baselines 2023-03-15 17:32:56 -07:00
Christian Kreibich
b2319ba5d9 Add btests for new Site::local_nets behavior 2023-03-15 17:11:08 -07:00
Christian Kreibich
c3cde56a0a Update plugins.hooks baseline to reflect added config framework activity 2023-03-15 17:11:08 -07:00
Christian Kreibich
f73c4e91d1 Update scripts.policy.misc.dump-events baseline 2023-03-15 17:11:08 -07:00
Christian Kreibich
1843e2daae Update btest baselines to reflect the use of local address ranges. 2023-03-15 17:11:04 -07:00
Christian Kreibich
4281d704c1 Tighten local-nets filtering in the logging framework's path-func-column-demote test
With private addresses treated as local ones, this picked up some private-range
flows in the test pcap involved.
2023-03-15 17:01:01 -07:00
Christian Kreibich
d387da9f71 Fix scripts.policy.frameworks.intel.removal test given address locality info
This test used `Site::is_local_addr()` as part of a filtering criterion, perhaps
unintentionally. The fact that it applied to all tested addresses kept a Zeek
process from exiting, failing the test. It also doesn't need to prioritize its
zeek_init() handler.
2023-03-15 17:01:00 -07:00
Christian Kreibich
693d8e9251 Treat private address space as site-local by default
This makes Site::private_address_space work like a subset of Site::local_nets,
to match many user's intuition of how we should treat site locality out of the
box. As config options, changes/redefs to Site::private_address_space propagate
to Site::local_nets, while changes to the latter don't affect the former.

A new global bit `Site::private_address_space_is_local` controls the behavior.
It defaults to true, and redefing to false brings back the original behavior.
2023-03-15 17:01:00 -07:00
Christian Kreibich
19829765d4 Provide a mechanism to suppress logging of internal config framework activity 2023-03-15 17:01:00 -07:00
Tim Wojtulewicz
a16bd28284 Move port_masked variable inside #else block 2023-03-15 12:30:02 -07:00
Tim Wojtulewicz
266d36bee6 Merge remote-tracking branch 'origin/topic/timw/2571-portval-caching'
* origin/topic/timw/2571-portval-caching:
  Add configure option for preallocating PortVal objects
2023-03-15 10:48:00 -07:00
Tim Wojtulewicz
4f902c0f39 Add configure option for preallocating PortVal objects 2023-03-15 10:12:32 -07:00
Johanna Amann
aa3053db00 Merge remote-tracking branch 'origin/topic/johanna/fix-scripts.base.protocols.ssl.x509-invalid-extension-on-openssl-3.1'
* origin/topic/johanna/fix-scripts.base.protocols.ssl.x509-invalid-extension-on-openssl-3.1:
  Fix the x509-invalid-extension test on OpenSSL 3.1
2023-03-15 14:11:10 +01:00
Johanna Amann
dcbc809189 Merge remote-tracking branch 'origin/topic/johanna/certificate-req'
* origin/topic/johanna/certificate-req:
  SSL/TLS CertificateRequest message: Address review feedback
  SSL/TLS: Parse CertificateRequest message
2023-03-15 10:03:25 +01:00
Johanna Amann
3524883008 Fix the x509-invalid-extension test on OpenSSL 3.1
OpenSSL 3.1 switched from outputting UNDEF to not giving a short name in
this case. Luckily this only requires a tiny test change.

We might consider pulling this into older versions, for ease of CI
testing.

Fixes GH-2869
2023-03-15 09:35:10 +01:00
Johanna Amann
b8d658ac77 SSL/TLS CertificateRequest message: Address review feedback
Minor stylistic changes; see https://github.com/zeek/zeek/pull/2855 for
details
2023-03-15 09:19:26 +01:00
zeek-bot
13648c88aa Update doc submodule [nomail] [skip ci] 2023-03-15 00:17:01 +00:00
Arne Welzel
33090d7a27 Merge branch 'dnssec-flag-parse' of github.com:micrictor/zeek-codespace
* 'dnssec-flag-parse' of github.com:micrictor/zeek-codespace:
  Update external testing commit hash for DNS flag changes
  Parse DNSSEC AD and CD bits

Updated dump-events baseline which seemed unrelated.
2023-03-14 10:35:50 +01:00
Michael
33a6dd131d Update external testing commit hash for DNS flag changes
Update external testing commit hash to match
https://github.com/zeek/zeek-testing/pull/11
2023-03-13 14:35:43 -07:00
Michael R. Torres
fe8390c646 Parse DNSSEC AD and CD bits
Parse authentic data (AD) and checking disabled (CD) bits according to
RFC 2535. Leaves the Z field as-is, in case users are already handling
this elsewhere and depend on the value being the integer for all 3 bits.

https://www.rfc-editor.org/rfc/rfc2535#section-6.1

Fixes #2672
2023-03-13 14:35:06 -07:00
Arne Welzel
c29b98b224 Merge remote-tracking branch 'origin/topic/awelzel/http-content-range-parsing-robustness'
* origin/topic/awelzel/http-content-range-parsing-robustness:
  HTTP: Make Content-Range parsing more robust
2023-03-13 18:41:16 +01:00
Arne Welzel
b21e6f72da HTTP: Make Content-Range parsing more robust
This was exposed by OSS-Fuzz after the HTTP/0.9 changes in zeek/zeek#2851:
We do not check the result of parsing the from and last bytes of a
Content-Range header and would reference uninitialized values on the stack
if these were not valid.

This doesn't seem as bad as it sounds outside of yielding non-sensible values:
If the result was negative, we weird/bailed. If the result was positive, we
already had to treat it with suspicion anyway and the SetPlainDelivery()
logic accounts for that.
2023-03-13 18:00:39 +01:00
Arne Welzel
e62e57a7cf Merge remote-tracking branch 'origin/topic/awelzel/http09-reset-reply-message'
* origin/topic/awelzel/http09-reset-reply-message:
  HTTP: Reset reply_message for HTTP/0.9
2023-03-13 17:54:29 +01:00
Tim Wojtulewicz
c72b163f0f Merge remote-tracking branch 'origin/topic/timw/coverity-issues'
* origin/topic/timw/coverity-issues:
  dlclose() handle if the library loaded wasn't a plugin
  Fix uninitialized variables in Ascii writer
  Fix use-after-move bug in Scope constructor
  Add missing field initializations for ConnTuple
  Fix possible resource leak in analyzer unit tests
2023-03-13 09:02:58 -07:00
Tim Wojtulewicz
ada22fbf42 dlclose() handle if the library loaded wasn't a plugin 2023-03-13 08:08:40 -07:00
Tim Wojtulewicz
6a2e43635f Fix uninitialized variables in Ascii writer 2023-03-13 08:08:40 -07:00
Tim Wojtulewicz
9eaa2cb45b Fix use-after-move bug in Scope constructor 2023-03-13 08:08:40 -07:00
Tim Wojtulewicz
06bac61607 Add missing field initializations for ConnTuple 2023-03-13 08:08:40 -07:00
Tim Wojtulewicz
78636e9c30 Fix possible resource leak in analyzer unit tests 2023-03-13 08:08:40 -07:00
Arne Welzel
fbf9d53c44 HTTP: Reset reply_message for HTTP/0.9
OSS-Fuzz tickled an assert when sending a HTTP response before a HTTP/0.9
request. Avoid this by resetting reply_message upon seeing a HTTP/0.9 request.

PCAP was generated artificially: Server sending a reply providing a
Content-Length. Because HTTP/0.9 processing would remove the ContentLine
support analyzer, more data was delivered to the HTTP_Message than
expected, triggering an assert.

This is a follow-up for zeek/zeek#2851.
2023-03-13 14:13:50 +01:00
Arne Welzel
c5a9eb920c Merge remote-tracking branch 'origin/topic/awelzel/pkt-src-get-next-timeout-rework'
* origin/topic/awelzel/pkt-src-get-next-timeout-rework:
  Allow offline packet sources to register FDs.
  PktSrc: Avoid calling ExtractNextPacketInternal() in GetNextTimeout()
2023-03-13 09:56:44 +01:00
Arne Welzel
32ddeac540 cirrus: Do not run builtin-plugin CI during PRs 2023-03-13 09:47:06 +01:00
Arne Welzel
dc068270ea Merge remote-tracking branch 'origin/topic/awelzel/2837-builtin-plugin-ci-take-two'
* origin/topic/awelzel/2837-builtin-plugin-ci-take-two:
  cirrus: Add smoke testing for builtin plugins
  ci/collect-repo-info: Make plugin VERSION reading more robust
  configure: Quote --include-plugins argument
  Fix --no-install-recommends typo
2023-03-13 09:41:12 +01:00
zeek-bot
0907c78e42 Update doc submodule [nomail] [skip ci] 2023-03-13 00:25:46 +00:00
Tim Wojtulewicz
0567d336d2 Merge remote-tracking branch 'origin/topic/timw/centos-7-ci-install-git'
* origin/topic/timw/centos-7-ci-install-git:
  Force rebuild of CentOS 7 CI image to pick up git install
2023-03-12 13:52:26 -07:00
Tim Wojtulewicz
dfde432a37 Force rebuild of CentOS 7 CI image to pick up git install 2023-03-12 13:34:12 -07:00
Tim Wojtulewicz
22b98e16aa Merge remote-tracking branch 'origin/topic/awelzel/more-dns-stats'
* origin/topic/awelzel/more-dns-stats:
  get_dns_stats: Expose total cache size and cached text entries
2023-03-12 13:09:53 -07:00
Tim Wojtulewicz
b14cc413d8 Merge remote-tracking branch 'origin/topic/timw/2845-http-09'
* origin/topic/timw/2845-http-09:
  Add weird for unknown HTTP/0.9 request method
  Special case HTTP 0.9 early on
  Remove a couple unnecessary break statements
2023-03-10 15:50:17 -07:00
Tim Wojtulewicz
9cb6de7447 Add weird for unknown HTTP/0.9 request method 2023-03-10 15:45:11 -07:00
Tim Wojtulewicz
5feb3a89dc Merge remote-tracking branch 'origin/topic/timw/windows-conan-profile'
* origin/topic/timw/windows-conan-profile:
  Pin conan to 1.58 on Windows until conan.cmake supports 2.0
2023-03-10 15:38:12 -07:00
Tim Wojtulewicz
3cc72c1c1b Pin conan to 1.58 on Windows until conan.cmake supports 2.0 2023-03-10 13:35:46 -07:00
Tim Wojtulewicz
0003495a9b Special case HTTP 0.9 early on
Mostly, treat HTTP0.9 completely separate. Because we're doing raw
delivery of a body directly, fake enough (connection_close=1, and finish
headers manually) so that the MIME infrastructure thinks it is seeing a
body.

This deals better with the body due to accounting for the first line. Also
it avoids the content line analyzer to strip CRLF/LF and the analyzer
then adding CRLF unconditionally by fully bypassing the content line
analyzer.

Concretely, the vlan-mpls test case contains a HTTP response with LF only,
but the previous implementation would use CRLF, accounting for two many bytes.
Same for the http.no-version test which would previously report a body
length of 280 and now is at 323 (which agrees with wireshark).

Further, the mime_type detection for the http-09 test case works because
it's now seeing the full body.

Drawback: We don't extract headers when a server actually replies with
a HTTP/1.1 message, but grrr, something needs to give I guess.
2023-03-10 09:52:34 -07:00
Tim Wojtulewicz
220d8a2795 Remove a couple unnecessary break statements 2023-03-10 09:52:34 -07:00
Jan Grashoefer
26d3a81c09 Allow offline packet sources to register FDs. 2023-03-10 15:11:34 +01:00
Arne Welzel
39c3bb797c PktSrc: Avoid calling ExtractNextPacketInternal() in GetNextTimeout()
This reworks 2aec7640dd (zeek/zeek#2039) to
avoid calling ExtractNextPacketInternal() within GetNextTimeout() for
the non-pseudo-realtime case. Also relates to zeek/zeek#2842.

The intention of the referenced change was to avoid a 0.00002 timeout when
a non-selectable packet source has more packets queued. This was implemented
by checking for a new packet within GetNextTimeout().

The proposed change switches to an predictive approach: Use the result of
the previous ExtractNextPacket() call (stored as had_packet) as an indication
whether more packets are to be expected.

Calling ExtractNextPacketInternal() within GetNextTimeout() may cause
surprising behavior as some packet source may block [1] or spent a significant
amount of time (e.g. applying BPF filters [2]) within ExtractNextPacket().
The result of GetNextTimeout() should be available immediately as guidance
for the main-loop and the actual work should happen within the ->Process()
method.

This change also attempts to separate the pseudo-realtime logic from the
non-pseudo-realtime in an attempt show pseudo-realtime as special.

[1] 00c4d657e0/src/Napatech.cc (L116)
[2] 58b25c8eba/src/Myricom.cc (L250)
2023-03-10 15:11:30 +01:00
Arne Welzel
2251c67e56 get_dns_stats: Expose total cache size and cached text entries
It wasn't possible from script land to determine the total size
of the cache table held by the DNS_Mgr. Add the total and also
also the TEXT entries count.
2023-03-10 09:22:45 +01:00