Commit graph

865 commits

Author SHA1 Message Date
Arne Welzel
96a0312ad2 NEWS: Add small table[pattern] section 2023-11-21 10:34:17 +01:00
Arne Welzel
a5a79d3f3a Merge remote-tracking branch 'origin/topic/awelzel/3453-dnssec-ed448-ed25519'
* origin/topic/awelzel/3453-dnssec-ed448-ed25519:
  DNS: Add Ed25519 and Ed448 enum values to parser
2023-11-21 10:08:34 +01:00
Arne Welzel
e339e93e69 strings.bif/sub,gsub: Respect anchors in pattern
Anchors within pattern passed to sub() or gsub() were previously ignored,
replacing any occurrence of '<text>' even when '^<text>' was used as a
pattern.

This is a pretty user-visible change (and we even have anchored patterns
within the base scripts), but seems "the right thing to do".

Relates to #3455
2023-11-17 14:37:25 +01:00
Arne Welzel
d9b8154c4e Merge remote-tracking branch 'origin/topic/awelzel/3455-do-split-string-2'
* origin/topic/awelzel/3455-do-split-string-2:
  strings.bif/do_split_string: Pass bol and eol to MatchPrefix()
  RE_Matcher: Add MatchPrefix with bol/eol control
2023-11-17 13:01:47 +01:00
Arne Welzel
de5fa1087a Add deprecations to NEWS [nomail] [skipci] 2023-11-08 11:27:53 +01:00
Arne Welzel
e56ef0fd9b packet_analysis: Avoid shared_ptr copying for analyzer lookups
For deeply encapsulated connections (think AWS traffic mirroring format
like IP,UDP,GENEVE,IP,UDP,VXLAN,ETH,IP,TCP), the Dispatcher::Lookup()
method is fairly visible in profiles when running in bare mode.

This changes the Analyzer::Lookup() and Dispatcher::Lookup() return value
breaking the API in favor of the performance improvement.

Relates to zeek/zeek#3379.
2023-11-01 12:03:02 +01:00
Arne Welzel
560f8a4a84 ssl: Prevent unbounded ssl_history growth
The ssl_history field may grow unbounded (e.g., ssl_alert event). Prevent this
by capping using a configurable limit (default 100) and raise a weird once reached.
2023-10-25 09:35:45 +02:00
Arne Welzel
c960d279a2 ssl: Cap number of alerts parsed from SSL record
Limit the number of events raised from an SSL record with content_type
alert (21) to a configurable maximum number (default 10). For TLS 1.3,
the limit is set to 1 as specified in the RFC. Add a new weird cases
where the limit is exceeded.

OSS-Fuzz managed to generate a reproducer that raised ~660k ssl_plaintext
and ssl_alert events given ~810kb of input data. This change prevents this
with hopefully no negative side-effect in the real-world.
2023-10-25 09:35:10 +02:00
Tim Wojtulewicz
738c39379f Start of 6.2.0 development 2023-10-13 10:58:29 -07:00
Tim Wojtulewicz
a4da0c64a1 Add missing NEWS entries for upcoming 6.1 release, reformat slightly 2023-10-13 10:00:34 -07:00
Arne Welzel
007bcefd09 Merge remote-tracking branch 'origin/topic/awelzel/2326-import-quic'
* origin/topic/awelzel/2326-import-quic:
  ci/btest: Remove spicy-quic helper, disable Spicy on CentOS 7
  btest/core/ppp: Run test in bare mode
  btest/quic: Update other tests
  testing/quic: Fixups and simplification after Zeek integration
  quic: Integrate as default analyzer
  quic: Include Copyright lines to the analyzer's source code contributed by Fox-IT
  quic: Squashed follow-ups: quic.log, tests, various fixes, performance
  quic: Initial implementation
2023-10-11 18:05:14 +02:00
Arne Welzel
94a8cf2a09 Merge remote-tracking branch 'origin/topic/awelzel/pcap-reading-configurable-buffer'
* origin/topic/awelzel/pcap-reading-configurable-buffer:
  iosource/pcap: Support configurable buffer size
  util/setvbuf: Respect buf argument
2023-10-11 15:20:17 +02:00
Arne Welzel
72df1a0216 Merge remote-tracking branch 'origin/topic/bbannier/issue-3234'
* origin/topic/bbannier/issue-3234:
  Introduce dedicated `LDAP::Info`
  Remove redundant storing of protocol in LDAP logs
  Use LDAP `RemovalHook` instead of implementing `connection_state_remove`
  Tidy up LDAP code by using local references
  Pluralize container names in LDAP types
  Move LDAP script constants to their own file
  Name `LDAP::Message` and `LDAP::Search` `*Info`
  Make ports for LDAP analyzers fully configurable
  Require have-spicy for tests which log spicy-ldap information
  Fix LDAP analyzer setup for when Spicy analyzers are disabled
  Bump zeek-testing-private
  Integrate spicy-ldap test suite
  Move spicy-ldap into Zeek protocol analyzer tree
  Explicitly use all of spicy-ldap's modules
  Explicitly list `asn1.spicy` as spicy-ldap source
  Remove uses of `zeek` module in spicy-ldap
  Fix typos in spicy-ldap
  Remove project configuration files in spicy-ldap
  Integrate spicy-ldap into build
  Import zeek/spicy-ldap@57b5eff988
2023-10-10 20:07:03 +02:00
Arne Welzel
7fac5837c3 iosource/pcap: Support configurable buffer size
On Linux with a default ext4 or tmpfs filesystem, the default buffer size for
reading a pcap is chosen as 4k (strace/gdb validated). When reading large pcaps
containing raw data transfers, the syscall overhead for read becomes visible
in profiles. Support configurability of the buffer size and default to 128kb.

When processing a ~830M PCAP (16 UDP connections, each transferring ~50MB) in
bare mode, this change improves runtime from 1.39 sec to 1.29 sec. Increasing
the buffer further didn't provide a noticeable boost.
2023-10-10 15:08:51 +02:00
Arne Welzel
51cbdc53f3 NEWS: Polish external plugins message [nomail] [skip ci] 2023-10-09 16:35:11 +02:00
Arne Welzel
2ed89ff84f Bump cmake submodule for 3.15 requirement 2023-10-09 16:23:12 +02:00
Arne Welzel
0630bdbbd5 Merge remote-tracking branch 'origin/topic/awelzel/3314-lambda-redefinition-segfault'
* origin/topic/awelzel/3314-lambda-redefinition-segfault:
  Var/Func: Render function parameters using comma, not semicolon
  Var: Fix null-pointer deref on redefinition of lambdas
2023-10-04 20:16:29 +02:00
Arne Welzel
55475af34c NEWS: Add entry for dot directory changes 2023-09-26 17:46:33 +02:00
Arne Welzel
cca5a8ca5d Merge remote-tracking branch 'origin/topic/awelzel/deferred-default-non-const-v4'
* origin/topic/awelzel/deferred-default-non-const-v4:
  CreationInitsOptimizer: Use PreTypedef() instead of PreType()
  Fix deferred record initialization
  testing/btest: Un-deferred record initalization tests
2023-09-12 20:52:17 +02:00
Arne Welzel
14a2c02f9d Merge remote-tracking branch 'origin/topic/awelzel/1705-http-pending-requests'
* origin/topic/awelzel/1705-http-pending-requests:
  http: Prevent request/response de-synchronization and unbounded state growth
2023-09-01 11:54:10 +02:00
Vern Paxson
e8f4e54475 change Trigger constructor to not potentially auto-delete itself 2023-08-28 10:17:26 -07:00
Arne Welzel
ba04f4c31d IPBasedAnalyzer: Don't flip connections when destination is broadcast
Closes #3235
2023-08-28 12:15:55 +02:00
Arne Welzel
de65671a0a Merge remote-tracking branch 'origin/topic/vern/GH-3191'
* origin/topic/vern/GH-3191:
  BTests for any/vector-of-any fixes
  fixes for vector assignments involving "any"/"vector of any" types
2023-08-25 21:43:03 +02:00
Arne Welzel
9bbc3a55d4 Merge remote-tracking branch 'origin/topic/awelzel/serial-ppp-0x9'
* origin/topic/awelzel/serial-ppp-0x9:
  PPP: Add PPP analyzer to handle LINKTYPE_PPP (0x9)
2023-08-24 13:49:33 +02:00
Johanna Amann
70c76977cf Merge remote-tracking branch 'origin/topic/johanna/gh-3242'
* origin/topic/johanna/gh-3242:
  Community-id: load main script in notice script, fix notice script
2023-08-23 12:46:21 +01:00
Tim Wojtulewicz
e8ef169b27 Merge remote-tracking branch 'origin/topic/timw/3059-set-vector-conversion'
* origin/topic/timw/3059-set-vector-conversion:
  Fix conversion with record types
  Add conversion between set and vector using 'as' keyword
  Add std::move for a couple of variables passed by value
2023-08-11 10:35:06 -07:00
Tim Wojtulewicz
af9e852c28 Add conversion between set and vector using 'as' keyword 2023-08-09 14:41:54 -07:00
Arne Welzel
431767d04b Add &default_insert attribute for tables
This is based on the discussion in zeek/zeek#2668. Using &default with tables
can be confusing as the default value is not inserted. The following example
prints an empty table at the end even new Service records was instantiated.

    type Service: record {
        occurrences: count &default=0;
        last_seen: time &default=network_time();
    };

    global services: table[string] of Service &default=Service();

    event zeek_init()
        {
        services["http"]$occurrences += 1;
        services["http"]$last_seen = network_time();

        print services;
        }

Changing above &default to &default_insert will insert the newly created
default value upon a missed lookup and act less surprising.

Other examples that caused confusion previously revolved around table of sets
 or table of vectors and `add` or `+=` not working as expected.

    tbl_of_vector["http"] += 1
    add tbl_of_set["http"][1];
2023-08-04 12:30:36 +02:00
Tim Wojtulewicz
1f415a7775 Rename magic __bro_plugin__ file to __zeek_plugin__ 2023-08-02 10:10:44 -07:00
Arne Welzel
12a5616f4d Support :: prefix to reference global namespace, deprecate GLOBAL::
Closes #2709
2023-07-11 12:51:21 +02:00
Tim Wojtulewicz
d1ed0e577b Merge remote-tracking branch 'origin/topic/awelzel/3028-connection-flipped'
* origin/topic/awelzel/3028-connection-flipped:
  Update dump-events baseline, not running with OpenSSL 3
  Conn: In-place val flip and connection_flipped()
  Conn: Remove is_version_sep()
  Remove icmp_conn leftovers
2023-07-05 13:32:34 -07:00
Arne Welzel
4cde1c3c3f global_ids(): Include module names
Ad-hoc include module names in the global_ids() table. Table values will
have the type_name field set to "module" and their key in the table is
prefixed with "module " to avoid clashes with existing global identifiers
shadowing module names (Management::Node being an existing example).

Closes #3136
2023-07-05 14:09:20 +02:00
Arne Welzel
a2214ad611 Conn: In-place val flip and connection_flipped()
Avoids loosing state on a connection value when a connection is flipped.

Fixes up the NTP baseline as well where this was visible: analyzer_confirmation_info()
was raised for a connection value which was immediately forgotten due to
the subsequent connection flipping.

Closed #3028
2023-07-04 20:01:17 +02:00
Arne Welzel
480d52ca1f from_json: Support function to normalize key names
When a JSON document contains key names containing colons or other
special characters that are not valid in Zeek identifiers, from_json()
cannot be used to parse such input.

This change allows a customizable normalization function.

Closes #3142.
2023-06-29 15:57:49 +02:00
Tim Wojtulewicz
999e7d2380 Merge remote-tracking branch 'origin/topic/awelzel/3143-no-more-zeekurity' into release/6.0
* origin/topic/awelzel/3143-no-more-zeekurity:
  cirrus: Stop pushing container images to zeekurity

(cherry picked from commit 6a033d5aed)
2023-06-27 09:34:15 -07:00
Arne Welzel
0b317aced3 telemetry: Disable metrics centralization by default
Move the telemetry/cluster.zeek file over into policy/frameworks/telemetry/prometheus.zeek.

Mention it in local.zeek.

Relates to zeek/broker#366.
2023-06-21 20:13:55 +02:00
Robin Sommer
647b2d0446
Add Spicy updates to NEWS for 6.0. 2023-06-15 14:02:36 +02:00
Arne Welzel
84d605602f Merge remote-tracking branch 'origin/topic/awelzel/3115-debian-12'
* origin/topic/awelzel/3115-debian-12:
  NEWS: Add entry about Debian 12
  docker: Add libnode to enable JavaScript support
  docker: Bump images to Debian 12
2023-06-14 18:56:00 +02:00
Arne Welzel
c873857953 NEWS: Fix enumeration in Breaking Changes 2023-06-14 13:16:01 +02:00
Arne Welzel
0fe32715c0 Merge remote-tracking branch 'origin/topic/awelzel/pre-commit-typos'
* origin/topic/awelzel/pre-commit-typos:
  all: Fix typos identified by typos pre-commit hook
  NEWS typo fixes
  Start with a typos pre-commit file
2023-06-14 13:06:47 +02:00
Arne Welzel
f83e96d1a6 NEWS: Add entry about Debian 12 2023-06-13 20:11:38 +02:00
Arne Welzel
260c868f26 NEWS typo fixes 2023-06-13 17:57:32 +02:00
Arne Welzel
30c084d39f NEWS: Small section about assert statement 2023-06-13 16:18:54 +02:00
Tim Wojtulewicz
6bfc2ea83d Start of 6.1.0 development 2023-05-31 12:10:35 +02:00
Arne Welzel
3efb27c963 Add NEWS entry about negative vector index 2023-05-24 10:51:37 +02:00
Arne Welzel
8967e347df Merge remote-tracking branch 'origin/topic/awelzel/telemetry-net-lag'
* origin/topic/awelzel/telemetry-net-lag:
  stats: Add zeek-net-packet-lag-seconds metric
2023-05-24 09:58:00 +02:00
Arne Welzel
f396c2b16e stats: Add zeek-net-packet-lag-seconds metric
While writing documentation about troubleshooting and looking a bit
at the older stats.log, realized we don't have the packet lag metric
exposed as metric/telemetry. Add it.

This is a Zeek instance lagging behind in network time ~6second because
it's very overloaded:

    zeek_net_packet_lag_seconds{endpoint=""} 6.169406 1684848998092
2023-05-24 09:12:01 +02:00
Arne Welzel
e9cd849843 Fix crashing when disable_analyzer() called on root analyzers
Closes #3071.
2023-05-23 15:44:14 +02:00
Arne Welzel
2bd1ae9c92 Merge remote-tracking branch 'origin/topic/awelzel/zeekygen-param-doc-field'
* origin/topic/awelzel/zeekygen-param-doc-field:
  Bump doc submodule
  zeekygen: Render function parameters as :param x: instead of 
2023-05-17 09:03:27 +02:00
Arne Welzel
cfd239ad2c Merge remote-tracking branch 'origin/topic/awelzel/zeek-seed-env-2'
* origin/topic/awelzel/zeek-seed-env-2:
  Introduce ZEEK_SEED_VALUES environment variable
2023-05-12 23:45:47 +02:00