Commit graph

13809 commits

Author SHA1 Message Date
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
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
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
Tim Wojtulewicz
f02475d01a Update broker submodule 2022-09-19 16:35:42 -07:00
Tim Wojtulewicz
94a315ad97 Update NEWS for 5.1.0 [nomail] [skip ci] 2022-09-19 16:34:56 -07:00
Tim Wojtulewicz
7d3a8edb9c Update docs submodule [nomail] [skip ci] 2022-09-19 15:40:56 -07:00
Tim Wojtulewicz
f04f070d9f Merge remote-tracking branch 'origin/topic/vern/cpp-maint-Sep22'
* origin/topic/vern/cpp-maint-Sep22:
  oof more manual fixups
  undo inadvertently committed tweak to test
  update for btest only run in some environments
  btest tweaks for recent changes
  updates to notes for compile-to-C++ maintenance
  newly-created btest files
  baseline updates for -a cpp alternative (compile-to-C++)
  tweak btest so it's recognized as a candidate for C++ compilation testing
  split basic "int" btests into main part versus now-separate overflow part
  fix deprecated "local" scoping in test scripts
  annotated scripts to skip when testing compilation-to-C++
  C++ script generation fix for lambdas that have identical bodies
  fix for C++ scripts that refer to "opaque" types
  C++ compilation support for 2-valued vector "for" loops
  C++ compilation support for RE /s operator
  run-time checking of vector operations for overflows and division-by-zero
  error propagation fix to avoid a crash
2022-09-19 13:51:41 -07:00
Tim Wojtulewicz
ee4a232c25 Merge remote-tracking branch 'origin/topic/vern/ZAM-maint-Aug22.final'
* origin/topic/vern/ZAM-maint-Aug22.final:
  updates to ZAM btest baselines
  specialized ZAM operators for speeding up cat() operations
  ZAM support for two-valued "for" loops over vectors
  make it non-fatal for optimized scripts to encounter an empty "for" body
  script optimization fix for new-style table constructors
2022-09-19 13:44:23 -07:00
Tim Wojtulewicz
95e758e012 Add better length check to BuildOptionsVal() 2022-09-19 12:41:42 -07:00
Arne Welzel
4c00c3c4ca smb: Unify transaction_data_to_val() usage
the data/string handling in smb1-com-transaction.pcac was improved
with c75519ca88, re-use the added
functionality also for smb1-com-transaction-secondary.pac to avoid
buffer overflows.
2022-09-19 12:41:28 -07:00
Tim Wojtulewicz
56f9110eca Add some additional checks for caplen in ICMP analyzer 2022-09-19 12:41:27 -07:00
Arne Welzel
6b6bd7e9f6 irc: Check parts.size() before removing the nick
...also, don't remove the nick twice.
2022-09-19 12:41:24 -07:00
Tim Wojtulewicz
ef81116278 Check IP payload length before casting to transport structure 2022-09-19 12:38:06 -07:00
Vern Paxson
2dfaa00c61 oof more manual fixups 2022-09-16 18:45:46 -07:00
Vern Paxson
bf0a74264a undo inadvertently committed tweak to test 2022-09-16 18:44:09 -07:00
Vern Paxson
3c0b07d149 update for btest only run in some environments 2022-09-16 18:43:05 -07:00
Vern Paxson
9d24e9f71a btest tweaks for recent changes 2022-09-16 17:04:06 -07:00
Vern Paxson
eec733beae updates to notes for compile-to-C++ maintenance 2022-09-16 16:53:42 -07:00