Commit graph

18275 commits

Author SHA1 Message Date
Arne Welzel
135acc7c6d Merge remote-tracking branch 'origin/topic/awelzel/fix-flaky-terminate-while-queueing'
* origin/topic/awelzel/fix-flaky-terminate-while-queueing:
  cluster/websocket: Stop and wait for reply thread during Terminate()
2025-05-07 13:22:13 +02:00
Arne Welzel
ca02316671 cluster/websocket: Stop and wait for reply thread during Terminate()
The terminate-while-queueing test added for #4428 failed spuriously
indicating that sometimes WebSocket clients receive code 1000 instead of 1001.
This happens if the ixwebsocket server is shutdown before the reply thread had a
chance to process queued close messages.

Fix by signaling and waiting for the dispatcher's reply thread to terminate
before returning from Terminate().
2025-05-07 12:45:01 +02:00
zeek-bot
ac1230fcbe Update doc submodule [nomail] [skip ci] 2025-05-07 00:15:52 +00:00
Tim Wojtulewicz
1da414ec3d Update paraglob submodule [nomail] 2025-05-06 13:19:49 -07:00
Johanna Amann
f293d5a852 Fix policy/protocols/conn/failed-service-logging.zeek
In GH-4422 it was pointed out that the protocols/conn/failed-service-logging.zeek
policy script only works when
`DPD::track_removed_services_in_connection=T` is set.

This was caused by a logic error in the script. This commit fixes this
logic error and introduces an additional test that checks that
failed-service-logging works even when the option is not set to true.
2025-05-06 13:37:12 +01:00
Arne Welzel
3be7a9ce91 Merge remote-tracking branch 'origin/topic/awelzel/double-commented-btest-lines'
* origin/topic/awelzel/double-commented-btest-lines:
  testing/btest: Fix double commented @TEST- lines
2025-05-06 14:21:03 +02:00
Arne Welzel
4afb0ffeeb Merge remote-tracking branch 'origin/topic/awelzel/4420-simeon-breaking-websockets'
* origin/topic/awelzel/4420-simeon-breaking-websockets:
  Websocket: Close onloop during Terminate()
  OnLoop: notify_all() instead of notify_one()
2025-05-06 14:20:38 +02:00
Arne Welzel
bb06af601f Websocket: Close onloop during Terminate()
Terminate() is called when Zeek shuts down. If WebSocket client threads
were blocked in QueueForProcessing() due to reaching queue limits, these
previously would not exit QueueForProcessing() and instead block
indefinitely, resulting in the ixwebsocket library blocking and its
garbage collection thread running at 100%. Not great.

Closing the onloop instance will unblock the WebSocket client threads
for a timely shutdown.

Closes #4420
2025-05-06 14:19:08 +02:00
Arne Welzel
0e327a0c12 testing/btest: Fix double commented @TEST- lines
sed -i 's/^# # @/# @/g'
2025-05-06 14:06:29 +02:00
Arne Welzel
6ebec6dde7 OnLoop: notify_all() instead of notify_one()
There might be more than one thread blocked waiting for room in the
queue, ensure they all wake up when shutting down.
2025-05-06 12:23:08 +02:00
zeek-bot
e986caddf0 Update doc submodule [nomail] [skip ci] 2025-05-06 00:16:07 +00:00
Tim Wojtulewicz
0393e4b84a Merge remote-tracking branch 'XueSongTap/master'
* XueSongTap/master:
  Add baseline for find_first test, update comments, and reorder function imports
  Add find_first string function
2025-05-05 13:40:40 -07:00
Tim Wojtulewicz
f9aa9a430d Merge remote-tracking branch 'origin/topic/timw/storage-check-redis-server-version'
* origin/topic/timw/storage-check-redis-server-version:
  Add commands to the static methods for the Redis implementation
  Redis: Check server version when connecting
2025-05-05 11:12:09 -07:00
Tim Wojtulewicz
dda319fd53 Add commands to the static methods for the Redis implementation 2025-05-05 11:10:06 -07:00
Tim Wojtulewicz
ecd603516f Redis: Check server version when connecting 2025-05-05 10:49:37 -07:00
Tim Wojtulewicz
58d71d2fa3 Merge remote-tracking branch 'origin/topic/timw/storage-redis-expire-string-view'
* origin/topic/timw/storage-redis-expire-string-view:
  Use std::string_view in Redis::DoExpire to avoid copies
2025-05-05 10:44:51 -07:00
Tim Wojtulewicz
df9b396ee6 Use std::string_view in Redis::DoExpire to avoid copies 2025-05-05 10:44:06 -07:00
Arne Welzel
50ac8d1468 Merge remote-tracking branch 'origin/topic/awelzel/4405-quic-fragmented-crypto'
* origin/topic/awelzel/4405-quic-fragmented-crypto:
  Bump external/zeek-testing
  QUIC: Extract reset_crypto() function
  QUIC: Rename ConnectionIDInfo to Context
  QUIC: Switch initial_destination_conn_id to optional
  QUIC: Use initial destination conn_id for decryption
  QUIC: Handle CRYPTO frames across multiple INITIAL packets
  QUIC: Do not consume EncryptedLongPacketPayload
  QUIC: Fix ACK frame parsing
2025-05-05 14:40:59 +02:00
Arne Welzel
8fd3cbf7cc Bump external/zeek-testing 2025-05-05 14:34:38 +02:00
Arne Welzel
39d0610ce1 QUIC: Extract reset_crypto() function 2025-05-05 14:34:38 +02:00
Arne Welzel
c19e79246f QUIC: Rename ConnectionIDInfo to Context
Lets just call it what it is given that it contains more than just
connection IDs.
2025-05-05 14:34:38 +02:00
Arne Welzel
fd29b48803 QUIC: Switch initial_destination_conn_id to optional 2025-05-05 14:34:38 +02:00
Arne Welzel
fe89a521d1 QUIC: Use initial destination conn_id for decryption
Ensure the client side also uses the initial destination connection ID
for decryption purposes instead of the one from the current long header
packet. PCAP from local WiFi hotspot.
2025-05-05 14:34:11 +02:00
Arne Welzel
ae90524027 QUIC: Handle CRYPTO frames across multiple INITIAL packets
Instead of sending the accumulated CRYPTO frames after processing an
INITIAL packet, add logic to determine the total length of the TLS
Client or Server Hello (by peeking into the first 4 byte). Once all
CRYPTO frames have arrived, flush the reassembled data to the TLS
analyzer at once.
2025-05-05 14:34:11 +02:00
Arne Welzel
e459d96fb6 QUIC: Do not consume EncryptedLongPacketPayload
The payload is already consumed within the InitialPacket unit. Consuming
it again resulted in UDP datagrams with multiple packets to ignore
the remaining packets in the same UDP datagram. The baseline changes
showing I being followed by a new H indicates that the INITIAL packet
was followed by a HANDSHAKE packet, but previously Zeek discarded
these.
2025-05-05 14:34:11 +02:00
zeek-bot
823abe2d90 Update doc submodule [nomail] [skip ci] 2025-05-03 00:12:50 +00:00
yexiaochuan
fd7045e274 Add baseline for find_first test, update comments, and reorder function imports 2025-05-02 11:51:45 +08:00
Arne Welzel
d655c64e0b Merge remote-tracking branch 'origin/topic/awelzel/event-publish-hook'
* origin/topic/awelzel/event-publish-hook:
  NEWS: Add HookPublishEvent() note
  btest/plugin: Test for PublishEventHook()
  broker and cluster: Wire up HookPublishEvent
  plugin: Add HookPublishEvent hook
2025-04-30 17:57:46 +02:00
Arne Welzel
48d965f85c NEWS: Add HookPublishEvent() note 2025-04-30 17:26:33 +02:00
Arne Welzel
0bf3417d4c btest/plugin: Test for PublishEventHook() 2025-04-30 17:26:33 +02:00
Arne Welzel
53236a184a broker and cluster: Wire up HookPublishEvent 2025-04-30 17:26:33 +02:00
Arne Welzel
621fd2ab39 plugin: Add HookPublishEvent hook 2025-04-30 17:26:33 +02:00
Arne Welzel
f8b75426ee Merge remote-tracking branch 'origin/topic/awelzel/bif-tracking-no-zeromq'
* origin/topic/awelzel/bif-tracking-no-zeromq:
  ZAM-bif-tracking: Remove ZeroMQ dependency
2025-04-30 17:23:22 +02:00
Arne Welzel
90eb22ce73 ZAM-bif-tracking: Remove ZeroMQ dependency
Vern didn't have ZeroMQ installed and the test was skipped for him.
Generally would recommend anyone working on core Zeek to install
libzmq-dev or the equivalent for their environment, but until it is a
real required dependency, loosen the requirements on the test.
2025-04-30 17:08:21 +02:00
Arne Welzel
f63677fcd5 QUIC: Fix ACK frame parsing
Later tests will exercise this.
2025-04-30 15:54:42 +02:00
Tim Wojtulewicz
e56de061f9 Merge remote-tracking branch 'origin/topic/vern/zam-inlining-temps'
* origin/topic/vern/zam-inlining-temps:
  fixed incorrect ZAM optimization of expressions seen in single-statement inlined functions
2025-04-29 17:50:39 -07:00
Vern Paxson
d2762fb247 fixed incorrect ZAM optimization of expressions seen in single-statement inlined functions 2025-04-29 14:29:07 -07:00
yexiaochuan
6c240dc0bb Add find_first string function 2025-04-30 00:15:34 +08:00
Tim Wojtulewicz
2cf8497bf7 Merge remote-tracking branch 'origin/topic/timw/update-ct-ca-lists'
* origin/topic/timw/update-ct-ca-lists:
  External tests: add removed logs to CT list to prevent baseline changes
  Update Mozilla CA list and CT list to NSS 3.110
2025-04-29 08:53:04 -07:00
Arne Welzel
d5e1dc27c6 Merge branch 'topic/mohan/intel-event-groups' of https://github.com/Mohan-Dhawan/zeek
* 'topic/mohan/intel-event-groups' of https://github.com/Mohan-Dhawan/zeek:
  coalesce smtp handlers for ADDR
  Add fine-grained groups for Intel events
2025-04-29 15:00:58 +02:00
Mohan Dhawan
36c4d112c8
coalesce smtp handlers for ADDR 2025-04-29 16:30:31 +05:30
Arne Welzel
5bf660a9ce Merge remote-tracking branch 'origin/topic/awelzel/cluster-coverity-fixes'
* origin/topic/awelzel/cluster-coverity-fixes:
  broker/WebSocketShim: Check RegisterFd() return
  cluster/OnLoop: Fix coverity report about proc accessed without lock
2025-04-28 19:41:10 +02:00
Arne Welzel
540baa89af Merge remote-tracking branch 'origin/topic/awelzel/3045-no-holes-in-vectors'
* origin/topic/awelzel/3045-no-holes-in-vectors:
  broker/Data/data_to_val: Fail on vectors/lists with holes
2025-04-28 18:24:25 +02:00
Arne Welzel
7092db6318 broker/Data/data_to_val: Fail on vectors/lists with holes
Instead of simply removing holes from vectors or lists when converting
from Val to Broker format, error out as the receiver has no chance to
reconstruct where the hole might have been.

We could encode holes with broker::none, but this will put unnecessary
burden on language bindings and users due to the potential optionality.
Think a std::vector<uint64_t> that technically needs to be a
std::vector<std::optional<uint64_t>> to represent optional elements
properly.

Closes #3045
2025-04-28 18:23:37 +02:00
Johanna Amann
28ec4e2f2a External tests: add removed logs to CT list to prevent baseline changes 2025-04-28 16:42:52 +01:00
Arne Welzel
d02588d25c broker/WebSocketShim: Check RegisterFd() return 2025-04-28 16:24:25 +02:00
Arne Welzel
4101efed4f cluster/OnLoop: Fix coverity report about proc accessed without lock
Coverity complains proc is set under a lock, but accessed in Process()
without a lock. Fix this by setting it in Close() also without locking.
The proc member should only ever be accessed my the main thread.
2025-04-28 16:23:08 +02:00
Tim Wojtulewicz
b9b268bd86 Merge remote-tracking branch 'origin/topic/timw/use-after-move'
* origin/topic/timw/use-after-move:
  Fix use-after-move in recent broker changes
2025-04-25 16:11:56 -07:00
Tim Wojtulewicz
f8d2f30cec Fix use-after-move in recent broker changes 2025-04-25 13:48:14 -07:00
Tim Wojtulewicz
223c5ab955 Start of 8.0.0 development 2025-04-25 11:59:08 -07:00