Commit graph

996 commits

Author SHA1 Message Date
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
Johanna Amann
3d257e52e2 Merge branch 'topic/johanna/dtls13'
* topic/johanna/dtls13:
  DTLS1.3 - address review feedback
  DTLS 1.3: Update test baseline
  DTLS 1.3: finish implementation, add connection_id extension
  Add basic DTLSv1.3 support
  SSL: Fix logging of Hello Retry Requests
2023-05-11 15:04:26 +01:00
Arne Welzel
11776d60e0 Merge remote-tracking branch 'jgras/topic/jgras/event-ts'
* jgras/topic/jgras/event-ts:
  Add compatibility tests for timestamped events.
  Add timestamps to auto published broker events.
  Add timestamps to manually published broker events.
  Annotate scheduled events with intended timestamp.
  Add timestamp to events.

One timestamp to ts rename during the merge.
2023-05-11 14:02:08 +02:00
Johanna Amann
527c0dc09f Merge remote-tracking branch 'origin/master' into topic/johanna/dtls13
* origin/master: (35 commits)
  Update doc submodule [nomail] [skip ci]
  Updating submodule(s) [nomail]
  zeek.bif: Add log2() and ceil()
  Use the same rules as cmake submodule to reformat Zeek
  Update cmake submodule after reformat
  Fixup Val.h/Val.cc: Actually move ValFromJSON into zeek::detail
  Implement from_json bif
  Revert "Skip version.h by default for Zeek sources"
  BTest baseline updates for -O gen-C++
  updates to C++ maintenance scripts to better handle uncompilable BTests
  added ZEEK_REPORT_UNCOMPILABLE environment variable for "-O report-uncompilable"
  Skip version.h by default for Zeek sources
  core.network_time.broker: Test reliability improvement
  cluster/supervisor: Multi-logger awareness
  Bump zeek-archiver submodule
  ci: Add public-ecr-vacuum.sh
  Update doc submodule [nomail] [skip ci]
  generate-docs: Only update submodule pointer during scheduled builds
  BTest baseline updates for ZAM
  NTP: Detect out-of-order packets
  ...
2023-05-10 13:02:08 +01:00
Johanna Amann
a8e84c6192 DTLS 1.3: finish implementation, add connection_id extension
This commit adds support for the connection_id extension, adds a trace
that uses DTLS 1.3 connection IDs, and adds parsing for the DTLS 1.3
unified header, in case connection IDs are not used.

In case connection IDs are used, parsing of the DTLS 1.3 unified header
is skipped. This is due to the fact, that the header then contains a
variable length element, with the length of the element not given in the
header. Instead, the length is given in the client/server hello message
of the opposite side of the connection (which we might have missed).

Furthermore, parsing is not of a high importance, since we are not
passing the connection ID, or any of the other parsed values of the
unified header into scriptland.
2023-05-10 11:17:24 +01:00
Arne Welzel
6cb391f9a2 zeek.bif: Add log2() and ceil()
Closes #2930, #2931.
2023-05-09 18:57:57 +02:00
Arne Welzel
9330a74fe1 Merge remote-tracking branch 'origin/topic/awelzel/zeek-archiver-multiple-loggers'
* origin/topic/awelzel/zeek-archiver-multiple-loggers:
  cluster/supervisor: Multi-logger awareness
  Bump zeek-archiver submodule
2023-05-09 15:20:53 +02:00
Arne Welzel
264284150b Merge remote-tracking branch 'amazing-pp/topic/fupeng/from_json_bif'
* amazing-pp/topic/fupeng/from_json_bif:
  Implement from_json bif

Minor updates during merge: Moved ValFromJSON into zeek::detail for the
time being, removed gotos, normalized some error messages to lower case,
minimal test extension and added a raw reader input framework test reading
"json lines" as a demo, adding notes about the implicit type
conversions.
2023-05-09 10:36:58 +02:00
Arne Welzel
c813872915 cluster/supervisor: Multi-logger awareness
When multiple loggers are configured in a Supervisor controlled cluster
configuration, encode extra information into the rotated filename to
identify which logger produced the log.

This is similar to the approach taken for ZeekControl, re-using the
log_suffix terminology, but as there's only a single zeek-archiver
process and no postprocessors and no other side-channel for additional
information, we encode extra metadata into the filename. zeek-archiver
is extended to recognize the special metadata part of the filename.

This also solves the issue that multiple loggers in a supervisor setup
overwrite each others log files within a single log-queue directory.
2023-05-05 12:27:25 +02:00
Arne Welzel
2c8b97c522 NTP: Detect out-of-order packets
The NTP mode provides us with the identity of the endpoints. For the
simple CLIENT / SERVER modes, flip the connection if we detect
orig/resp disagreeing with what the message says. This mainly
results in the history getting a ^ and the ntp.log / conn.log
showing the corrected endpoints.

Closes #2998.
2023-05-04 19:44:02 +02:00
Arne Welzel
12252743b1 Merge remote-tracking branch 'origin/topic/awelzel/smb2-state-handling'
* origin/topic/awelzel/smb2-state-handling:
  NEWS: Add entry about SMB::max_pending_messages and state discarding
  scripts/smb2-main: Reset script-level state upon smb2_discarded_messages_state()
  smb2: Limit per-connection read/ioctl/tree state
2023-05-04 09:40:19 +02:00
Tim Wojtulewicz
7305f2ba9b Merge remote-tracking branch 'origin/topic/timw/2997-ding-dong-bro-init-is-dead'
* origin/topic/timw/2997-ding-dong-bro-init-is-dead:
  Remove parser error message for bro_init, et al
2023-05-03 09:31:26 -07:00
Johanna Amann
9742d9a76e Merge branch 'topic/johanna/no-error-message-durning-tls-or-dtls-protocol-violations'
* topic/johanna/no-error-message-durning-tls-or-dtls-protocol-violations:
  SSL: failing analyzer handling - address review feedback
  SSL: do not try to disable failed analyzer

Also folds in minor feedback from GH-3012
2023-05-03 14:20:44 +01:00
Arne Welzel
042aa1383b NEWS: Add entry about SMB::max_pending_messages and state discarding 2023-05-03 11:22:01 +02:00
Tim Wojtulewicz
e07f3f305d Remove parser error message for bro_init, et al 2023-05-02 12:06:41 -07:00
Arne Welzel
df0788252e Merge remote-tracking branch 'origin/topic/awelzel/2994-ip-mf-df-offset'
* origin/topic/awelzel/2994-ip-mf-df-offset:
  ip4_hdr: Add DF, MF, offset and sum fields
2023-05-02 20:45:43 +02:00
Arne Welzel
f227b30d30 Merge remote-tracking branch 'origin/topic/awelzel/2791-pcap-stat-overflow'
* origin/topic/awelzel/2791-pcap-stat-overflow:
  pcap/Source: Allow more than 32bit for link and dropped stats
2023-04-28 10:02:30 +02:00
Arne Welzel
5541066660 pcap/Source: Allow more than 32bit for link and dropped stats
The PktSrc::Stats object works with 64bit unsigned integers. Unfortunately,
libpcap's struct pcap_stat is using 32bit values and users have reported
the wrapping of these values being visible in their stats.log roughly every
7.5 hours (~160kpps).

This change moves tracking of link and drop counters into the PktSrc::Stats
object (like is done for received and bytes_received) and updates them
on a call to PcapSource::Statistics() with the difference to the
previous stats values to prevent the wrap from becoming visible to
script land.

This doesn't cover the case of the stats counters wrapping around multiple
times between two invocations of PktSrc::Statistics(). With the default
interval of 5 minutes for the stats script, this seems acceptable.

Closes #2791.
2023-04-28 09:59:26 +02:00
Arne Welzel
f4bb8fae33 record_fields: Include information about optionality of fields
This was reported as a wish for log schema generation, so add it...
2023-04-27 21:18:35 +02:00
Arne Welzel
a3ef8783b1 Merge remote-tracking branch 'origin/topic/neverlord/gh-2806'
* origin/topic/neverlord/gh-2806:
  test/builtin-plugins: Add plugin using ZEEK_VERSION_NUMBER
  Revert putting plugins into a fresh scope for now
  Propagate zeek-version.h skip via CMake properties
2023-04-27 13:23:14 +02:00