Commit graph

15378 commits

Author SHA1 Message Date
Tim Wojtulewicz
93278de984 Merge remote-tracking branch 'origin/topic/timw/coverity-fixes'
* origin/topic/timw/coverity-fixes:
  Fix some Coverity issues in the recent ZAM updates
2022-10-03 09:08:52 -07:00
dependabot[bot]
18f6ecec51
Bump dawidd6/action-send-mail from 3.6.1 to 3.7.0
Bumps [dawidd6/action-send-mail](https://github.com/dawidd6/action-send-mail) from 3.6.1 to 3.7.0.
- [Release notes](https://github.com/dawidd6/action-send-mail/releases)
- [Commits](https://github.com/dawidd6/action-send-mail/compare/v3.6.1...v3.7.0)

---
updated-dependencies:
- dependency-name: dawidd6/action-send-mail
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 04:27:48 +00:00
zeek-bot
19632925e6 Update doc submodule [nomail] [skip ci] 2022-10-01 00:45:54 +00:00
Christian Kreibich
d59bb8cc2c Merge remote-tracking branch 'origin/topic/vern/CPP-standalone-maint'
* origin/topic/vern/CPP-standalone-maint:
  fixes for compiling "standalone" C++ scripts
2022-09-30 16:40:31 -07:00
Christian Kreibich
5a01b38757 Merge remote-tracking branch 'origin/topic/vern/deprecated-when-fix'
* origin/topic/vern/deprecated-when-fix:
  fix for deprecated when's where the inner frame is larger than the outer frame
2022-09-30 12:43:47 -07:00
Arne Welzel
81fe46f123 analyzer: Add file_analyzer support to enable_analyzer()/disable_analyzer()
This allows to enable/disable file analyzers through the same interfaces
as packet and protocol analyzers, specifically Analyzer::disable_analyzer
could be interesting.
2022-09-30 11:47:56 +02:00
Robin Sommer
4c788f1717 Merge remote-tracking branch 'origin/topic/awelzel/2399-packet-analyzer-disabling'
* origin/topic/awelzel/2399-packet-analyzer-disabling:
  const: Deprecate tunnel-specific enable_* flags
  packet_analysis: Introduce PacketAnalyzer::__disable_analyzer()
2022-09-30 10:03:19 +02:00
Arne Welzel
3e0374f564 const: Deprecate tunnel-specific enable_* flags
With packet analyzers being toggle-able at runtime these can go.
They hadn't been consistently implemented either (VXLAN, Geneve).
2022-09-30 09:31:02 +02:00
Arne Welzel
af5a0215c0 packet_analysis: Introduce PacketAnalyzer::__disable_analyzer()
This adds machinery to the packet_analysis manager for disabling
and enabling packet analyzers and implements two low-level bifs
to use it.

Extend Analyzer::enable_analyzer() and Analyzer::disable_analyzer()
to transparently work with packet analyzers, too. This also allows
to add packet analyzers to Analyzer::disabled_analyzers.
2022-09-30 09:27:22 +02:00
Vern Paxson
403efd4052 updates to -O C++ user and maintenance documentation 2022-09-29 15:12:04 -07:00
Vern Paxson
0687959f1c use dynamic rather than static initialization of globals for scripts compiled to C++ 2022-09-29 15:11:05 -07:00
Vern Paxson
6ad28b37e6 safety checking for initializing scripts compiled to C++ 2022-09-29 15:10:28 -07:00
Vern Paxson
5c21240daf fixes for initializing scripts compiled to C++ 2022-09-29 15:09:37 -07:00
Vern Paxson
1af905a14f restructured tracking of initializations of globals for script compilation 2022-09-29 15:08:53 -07:00
zeek-bot
0d5c669c1c Update doc submodule [nomail] [skip ci] 2022-09-29 00:58:36 +00:00
Robin Sommer
396e407be1 Bump doc submodule. 2022-09-28 10:35:15 +02:00
Robin Sommer
876c367c2d Bump bifcl submodule. 2022-09-28 10:09:58 +02:00
Robin Sommer
5a5e16c031 Merge remote-tracking branch 'origin/topic/awelzel/analyzer-violation-info'
(+small tweaks to NEWS).

* origin/topic/awelzel/analyzer-violation-info:
  packet_analysis: Protect from nullptr sessions
  packet_analysis: Raise violations once (and don't raise confirmations after violations)
  Introduce basic test triggering when zeek -r triggers script errors
  file_analysis: Implement AnalyzerViolation() for file_analysis/Analyzer
  Introduce generic analyzer_confirmation_info and analyzer_violation_info
2022-09-28 10:08:13 +02:00
Arne Welzel
fbf379b757 packet_analysis: Protect from nullptr sessions
Passing nullptr sessions to AnalyzerConfirmation and AnalyzerViolation
of protocol analyzers previously blew up - protect from that.

Related to zeek/spicy-plugin#133.
2022-09-27 17:49:58 +02:00
Arne Welzel
fdedc6b200 packet_analysis: Raise violations once (and don't raise confirmations after violations)
This is mostly to avoid per-packet violations for packet analyzers that
have sessions attached to them.
2022-09-27 17:49:58 +02:00
Arne Welzel
700a9a4f37 Introduce basic test triggering when zeek -r triggers script errors
I wonder if there's another one that covers errors during a basic zeek -r,
but didn't seem like.
2022-09-27 17:49:58 +02:00
Arne Welzel
d5cd023dff file_analysis: Implement AnalyzerViolation() for file_analysis/Analyzer
Add a test parsing a malformed PE file showing that analyzer_violation_info
is raised with the fa_file object set.

It could be interesting to pass through an optional connection if one
exists, but access is provided through f$conns, too.
2022-09-27 17:49:58 +02:00
Arne Welzel
bc8fd5a4c6 Introduce generic analyzer_confirmation_info and analyzer_violation_info
Introduce two new events for analyzer confirmation and analyzer violation
reporting. The current analyzer_confirmation and analyzer_violation
events assume connection objects and analyzer ids are available which
is not always the case. We're already passing aid=0 for packet analyzers
and there's not currently a way to report violations from file analyzers
using analyzer_violation, for example.

These new events use an extensible Info record approach so that additional
(optional) information can be added later without changing the signature.
It would allow for per analyzer extensions to the info records to pass
analyzer specific info to script land. It's not clear that this would be
a good idea, however.

The previous analyzer_confirmation and analyzer_violation events
continue to exist, but are deprecated and will be removed with Zeek 6.1.
2022-09-27 17:49:51 +02:00
Robin Sommer
2e58d6a1a9 Merge remote-tracking branch 'origin/topic/awelzel/2422-exclude-empty-dirs'
* origin/topic/awelzel/2422-exclude-empty-dirs:
  cmake: Exclude empty directories due to headers install
2022-09-27 13:33:02 +02:00
Robin Sommer
5e5a309b5f Merge remote-tracking branch 'origin/topic/awelzel/vxlan-per-packet-analyzer-confirmation'
* origin/topic/awelzel/vxlan-per-packet-analyzer-confirmation:
  packet_analysis: Do not raise analyzer_confirmation per-packet for tunnels
2022-09-27 13:30:47 +02:00
Arne Welzel
3a320fc6b6 packet_analysis: Do not raise analyzer_confirmation per-packet for tunnels
There's a logic error in the packet analyzer's AnalyzerConfirmation()
method that causes analyzer_confirmation() events to be raised for every
packet rather than stopping after the first confirmation which appears to
have been the intention. This affects, for example, VXLAN and Geneve tunnels.

The optional arg_tag parameter was used for short-circuit'ing, but the return
value of GetAnalyzerTag() used for setting the session state causing the
disconnect.

In scenarios where Zeek receives purely tunneled monitoring traffic, this may
result in a non-negligible performance impact.

Somewhat related, ensure the session state is set to violated before
short-circuiting if no analyzer_violations are installed.

Suggesting this as a 5.0.3 candidate.
2022-09-27 12:49:56 +02:00
Arne Welzel
38e226bf75 http: Prevent script errors when http$current_entity is not set
The current_entity tracking in HTTP assumes that client/server never
send HTTP entities at the same time. The attached pcap (generated
artificially) violates this and triggers:

    1663698249.307259 expression error in <...>base/protocols/http/./entities.zeek, line 89: field value missing (HTTP::c$http$current_entity)

For the http-no-crlf test, include weird.log as baseline. Now that weird is
@load'ed from http, it is actually created and seems to make sense
to btest-diff it, too.
2022-09-26 10:18:24 +02:00
Vern Paxson
71d1022269 fix for deprecated when's where the inner frame is larger than the outer frame 2022-09-25 19:55:47 -07:00
Vern Paxson
96668ca0d3 fixes for compiling "standalone" C++ scripts 2022-09-24 14:56:42 -07:00
Arne Welzel
d704b27e81 cmake: Exclude empty directories due to headers install
This followed some pointers from here and opted for explicit exclusion:

https://stackoverflow.com/questions/55451084/cmake-files-matching-pattern-copies-empty-directories

Fixes #2422
2022-09-24 17:01:29 +02:00
Tim Wojtulewicz
19ba30d77a Merge remote-tracking branch 'origin/topic/timw/skip-darwin-builds'
* origin/topic/timw/skip-darwin-builds:
  Skip darwin builds on zeek-security repo
2022-09-23 13:33:27 -07:00
Tim Wojtulewicz
a7070aae9d Skip darwin builds on zeek-security repo 2022-09-23 13:03:46 -07:00
zeek-bot
aa4031ea22 Update doc submodule [nomail] [skip ci] 2022-09-22 00:52:42 +00:00
Tim Wojtulewicz
157a859104 Fix some Coverity issues in the recent ZAM updates 2022-09-21 10:52:29 -07:00
Christian Kreibich
c05d61d6e2 Merge branch 'topic/awelzel/dpd-ditch-service-negation'
* topic/awelzel/dpd-ditch-service-negation:
  scripts/conn: Open-code determine_service()
  Make connection$service_violation a set[string]
  strings: Implement join_string_set() as bif
  dpd: Replace negated service fmt() magic with dedicated field
2022-09-20 21:11:23 -07:00
zeek-bot
fdf8bf8bac Update doc submodule [nomail] [skip ci] 2022-09-21 00:50:27 +00:00
Arne Welzel
660172013b scripts/conn: Open-code determine_service()
...and avoid doing it as suggested by Justin to avoid the extra over-head
in scan scenarios where c$service is empty.
2022-09-20 23:07:26 +02:00
Arne Welzel
7ed6cbeee5 Make connection$service_violation a set[string]
To stay consistent with connection$service.
2022-09-20 23:07:26 +02:00
Arne Welzel
0e28a7faf5 strings: Implement join_string_set() as bif
Haven't measured speed, but this is probably faster than
the cat() and string invocations.
2022-09-20 23:07:26 +02:00
Arne Welzel
31aeb58e10 dpd: Replace negated service fmt() magic with dedicated field
...the only known cases where the `-` for `connection$service` was
handled is to skip/ignore these analyzers.

Slight suspicion that join_string_set() should maybe become a bif
now determine_service() runs once for each connection.

Closes #2388
2022-09-20 23:07:26 +02:00
Tim Wojtulewicz
20226f084b Merge remote-tracking branch 'origin/topic/timw/2387-cleanup'
* origin/topic/timw/2387-cleanup:
  Dict: Mark iterator move operator/constructors as noexcept
  Remove unused headers from Dict.cc
  Dict: Reduce some math required in repeatedly-called functions
  Dict: use std::log2, remove custom Log2 method
2022-09-20 13:05:07 -07:00
Tim Wojtulewicz
f2ae1da764 Dict: Mark iterator move operator/constructors as noexcept 2022-09-20 13:04:19 -07:00
Tim Wojtulewicz
02cc4fd1b8 Remove unused headers from Dict.cc 2022-09-20 13:04:04 -07:00
Tim Wojtulewicz
1befb9ba6f Dict: Reduce some math required in repeatedly-called functions 2022-09-20 13:04:04 -07:00
Tim Wojtulewicz
25a280d6a1 Dict: use std::log2, remove custom Log2 method 2022-09-20 13:03:50 -07:00
Tim Wojtulewicz
7e65b285ea Fix some typos in the 5.1.0 NEWS 2022-09-20 13:01:40 -07:00
Tim Wojtulewicz
2b60f63123 Start of 5.2.0 development 2022-09-20 09:23:50 -07:00
Tim Wojtulewicz
b3c2988c90 Update broker submodule 2022-09-20 09:02:50 -07:00
Christian Kreibich
d20ffb100c Merge branch 'topic/amazingpp/2384-record-deprecation' of github.com:/AmazingPP/zeek
* 'topic/amazingpp/2384-record-deprecation' of github.com:/AmazingPP/zeek:
  Replace all the Warning() calls after IsFieldDeprecated() over to Warn()
  Fix deprecation not flagged and incorrect line number in record
2022-09-19 18:15:39 -07:00
Tim Wojtulewicz
a32609a5b2 Updating submodule(s) [nomail] 2022-09-19 18:01:33 -07:00