Commit graph

16194 commits

Author SHA1 Message Date
Arne Welzel
14949941ce SMTP: Add BDAT support
Closes #3264
2024-01-12 10:18:07 +01:00
Arne Welzel
ffffd88bef Merge remote-tracking branch 'origin/topic/christian/mmdb-configurability'
* origin/topic/christian/mmdb-configurability:
  Modernize various C++/Zeek-isms in the MMDB code.
  Fix MMDB code to re-open explicitly opened DBs correctly
  Add btest to verify behavior of re-opened MMDBs opened directly via BIFs
  Simplify MMDB code by moving more lookup functionality into MMDB class
  Move MMDB logic out of mmdb.bif and into MMDB.cc/h.
  Fix mmdb.temporary-error testcase when MMDBs are installed on system
  Adapt MMDB BiF code to new script-layer variables
  Update btest baselines to reflect introduction of mmdb.bif
  Move MaxMind/GeoIP BiF functionality into separate file
  Provide script-level configurability of MaxMind DB placement on disk
  Sort toplevel .bif list in CMakeLists
2024-01-12 09:28:36 +01:00
Christian Kreibich
dbad072f06 Modernize various C++/Zeek-isms in the MMDB code. 2024-01-11 17:13:41 -08:00
zeek-bot
5c61d1e551 Update doc submodule [nomail] [skip ci] 2024-01-12 00:20:45 +00:00
Arne Welzel
2ce4823c7a Merge remote-tracking branch 'origin/topic/awelzel/3540-known-hosts-expire-time'
* origin/topic/awelzel/3540-known-hosts-expire-time:
  Known: Keep &create_expire on local tables/sets valid
2024-01-11 20:18:22 +01:00
Johanna Amann
46e54bab76 Fix ssl-log-ext omitting data in some cases
ssl-log-ext had a bug that caused data present in the SSL connection to
not be logged in some cases. Specifically, the script relied on the base
ssl script to initialize some data structures; however, this means that
protocol messages that arrive before a message is handled by the base
ssl script are not logged.

This commit changes the ssl-log-ext script to also initialize the data
structures; now messages are correctly included in the log in all cases.
2024-01-11 17:12:33 +00:00
Arne Welzel
28b33b5c0d Merge remote-tracking branch 'origin/topic/neverlord/backward-compatibility'
* origin/topic/neverlord/backward-compatibility:
  Document upcoming breaking change for OpaqueVal
  Integrate review feedback
  Fix formatting
  Backward compatibility for OpaqueVal serialization
2024-01-11 12:38:39 +01:00
Arne Welzel
1ba0d4e31c Merge remote-tracking branch 'origin/topic/awelzel/3439-bump-tunnel-max-depth'
* origin/topic/awelzel/3439-bump-tunnel-max-depth:
  NEWS: Update news for tunnel depth changes
  tunnels: Add 'X' to history when reaching Tunnel::max_depth
  Session/TCP/UDP: Reserve HIST_UNKNOWN_PKT mask
  Conn: Deprecated AppendAddl
  Conn/Session: Lift history logic into Session
  init-bare: Default Tunnel::max_depth to 4
2024-01-11 11:03:15 +01:00
Arne Welzel
040068f390 NEWS: Update news for tunnel depth changes 2024-01-11 10:22:46 +01:00
Arne Welzel
7325bc945f tunnels: Add 'X' to history when reaching Tunnel::max_depth 2024-01-11 10:22:44 +01:00
Arne Welzel
ad9446d799 Session/TCP/UDP: Reserve HIST_UNKNOWN_PKT mask
This is meant to be used for a new 'X' code in the history in scenarios when
packets are knowingly not processed or an unexpected unknown situation
is recognized.

Usually, these situations are currently reported via weirds or analyzer violations,
but being able to include it in the history field allows them to be more visible.

Will be used for exceeding tunnel depths first.
2024-01-11 10:22:44 +01:00
Arne Welzel
c8a032ac70 Conn: Deprecated AppendAddl 2024-01-11 10:22:44 +01:00
Arne Welzel
b4e86f28b8 Conn/Session: Lift history logic into Session
This should allow to mangle a Session's history also from packet
analyzers without necessarily knowing the concrete connection type.

Given Connection is a subclass of Session, I don't think this
changes much.
2024-01-11 10:22:36 +01:00
Arne Welzel
fddbdf6232 init-bare: Default Tunnel::max_depth to 4
In AWS GLB environments, the max_depth of 2 is easily reached due to packets
being encapsulated with GENEVE and VXLAN [1]. Any additional encapsulation
layer causes Zeek raise a weird and ignore the inner traffic. Bump the default
maximum depth to 4, while not common it's not unusual either to observe
this in the wild.

[1] https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-packet-formats.html

Closes #3439
2024-01-11 10:22:36 +01:00
Dominik Charousset
717799f45b Document upcoming breaking change for OpaqueVal 2024-01-11 09:02:49 +01:00
Christian Kreibich
e8f0f727cd Fix MMDB code to re-open explicitly opened DBs correctly
The filename from which a DB first gets opened (either via an explicitly
specified filename, or via the path sequence now configurable at the script
layer) is now "sticky", meaning re-opening won't switch to a different file.

This was easiest by moving most state into the MMDB class itself. The previous
approach of tracking the two DB instances via a smart pointer and blowing the
pointed-to objects away as needed is now instead one of two objects fixed over
the lifetime of Zeek, able to open/close/reopen their underlying Maxmind DBs.

The MMDB class now only has one Lookup() method since there was no need to break
them apart -- it saves the return of a MMDB_lookup_result_s over the stack and
there's no need for throwing an exception.
2024-01-10 20:44:40 -08:00
Christian Kreibich
2e3270d7ec Add btest to verify behavior of re-opened MMDBs opened directly via BIFs
The mmdb_open_location_db() and mmdb_open_asn_db() BiFs were untested, and Zeek
has a bug that makes any DBs opened that way fall back to looking up DBs via the
existing script-level config mechanism (via mmdb_dir), which is at least
unexpected and might well be unconfigured if somebody uses the direct BiFs.
2024-01-10 20:44:40 -08:00
Christian Kreibich
07499cd2e5 Simplify MMDB code by moving more lookup functionality into MMDB class 2024-01-10 20:44:40 -08:00
Christian Kreibich
a06053ce75 Move MMDB logic out of mmdb.bif and into MMDB.cc/h.
This does not change the implementation except for some light renaming where
things are now naturally scoped within MMDB.cc.
2024-01-10 20:44:35 -08:00
Christian Kreibich
20841ac689 Fix mmdb.temporary-error testcase when MMDBs are installed on system
The test would previously fail in settings where the user has Maxmind DBs
installed in the hardwired system locations, because the fallback logic still
picked those up.
2024-01-10 20:28:41 -08:00
Christian Kreibich
ba98ddc4f2 Adapt MMDB BiF code to new script-layer variables 2024-01-10 20:28:41 -08:00
Christian Kreibich
4e45a3462b Update btest baselines to reflect introduction of mmdb.bif 2024-01-10 20:28:41 -08:00
Christian Kreibich
8406959ae2 Move MaxMind/GeoIP BiF functionality into separate file 2024-01-10 20:28:37 -08:00
Christian Kreibich
06642d185b Provide script-level configurability of MaxMind DB placement on disk
This lifts the list of fallback directories in which Zeek will look for Maxmind
DBs into the script layer, and makes the names of the DB files themselves
(previously hardwired) configurable as well.

This does not yet change the in-core code; that commit follows.
2024-01-10 20:14:24 -08:00
Christian Kreibich
b4725c113f Sort toplevel .bif list in CMakeLists
Not important, but here it is safe to do so and the list is getting lengthy.
2024-01-10 20:14:24 -08:00
zeek-bot
4c960fd7d5 Update doc submodule [nomail] [skip ci] 2024-01-11 00:12:54 +00:00
Tim Wojtulewicz
2b4005b820 Merge branch 'topic/timw/move-bifs'
* topic/timw/move-bifs:
  Use std::move in return values from bif methods to avoid copies
  Use bool return values instead of int in a couple zeek.bif static methods
2024-01-10 12:32:58 -07:00
Tim Wojtulewicz
010306f6f6 Use std::move in return values from bif methods to avoid copies 2024-01-10 12:32:15 -07:00
Tim Wojtulewicz
d0cb3888b4 Use bool return values instead of int in a couple zeek.bif static methods 2024-01-10 12:32:15 -07:00
Arne Welzel
bddd74dcc1 Merge remote-tracking branch 'origin/topic/awelzel/quic-draft-mvfst-versions'
* origin/topic/awelzel/quic-draft-mvfst-versions:
  quic: Handle and log unhandled_version
  quic: Support decryption of a few more versions
2024-01-10 14:08:01 +01:00
Arne Welzel
8de7808cf9 Merge remote-tracking branch 'origin/topic/awelzel/3531-at-if-record-definition'
* origin/topic/awelzel/3531-at-if-record-definition:
  parse: Support @if conditionals in record definitions
2024-01-10 14:05:22 +01:00
Arne Welzel
60d8872969 Known: Keep &create_expire on local tables/sets valid
After switching the known scripts away from broker stores, the
&create_expire value of the local tables/sets of the known scripts
wasn't in effect due to Cluster::node_up() and Cluster::node_down()
re-assigning these without keeping the &create_expire attribute
intact. This broke the "log hosts every 24h" behavior.

Closes #3540
2024-01-10 09:07:43 +01:00
Arne Welzel
ec9ed81250 quic: Handle and log unhandled_version 2024-01-09 17:10:11 +01:00
Arne Welzel
4ca6f690d7 quic: Support decryption of a few more versions 2024-01-09 17:10:11 +01:00
Arne Welzel
f1e94594f9 Merge remote-tracking branch 'origin/topic/awelzel/3523-expiration-iteration-at-termination'
* origin/topic/awelzel/3523-expiration-iteration-at-termination:
  Dict: Invalidate iterators during Clear()
2024-01-09 09:16:01 +01:00
Arne Welzel
96823dab73 Dict: Invalidate iterators during Clear()
If we don't do this, a RobustDictIterator owned by someone else holds
dangling pointers to the Dictionary that is being cleared.

Closes #3523
2024-01-09 09:12:21 +01:00
Tim Wojtulewicz
985e1f9024 Merge branch 'topic/timw/werror'
* topic/timw/werror:
  CI: Remove unused openssl30_config
  CPP-gen: Don't emit extra braces if only one element
  Use <poll.h> instead of <sys/poll.h>
  ZAM: Create ListValPtr directly instead of a stack object
  Bump zeekjs to pick up dprintf warning fix
  Avoid unused-result warning in Supervisor
  Update src/3rdparty submodule to fix sprintf warning in modp
  Fix warning with attribute string lookup
  Set -Werror / /WX via target_compile_options to force warnings as errors
2024-01-08 14:10:55 -07:00
Tim Wojtulewicz
652ba502aa CI: Remove unused openssl30_config 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
df65b668b7 CPP-gen: Don't emit extra braces if only one element 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
016121b6f7 Use <poll.h> instead of <sys/poll.h> 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
ca29793ecc ZAM: Create ListValPtr directly instead of a stack object 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
ac59b11f33 Bump zeekjs to pick up dprintf warning fix 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
d87e2ec70c Avoid unused-result warning in Supervisor 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
3d5aaf9aec Update src/3rdparty submodule to fix sprintf warning in modp 2024-01-08 13:26:57 -07:00
Tim Wojtulewicz
b639f1426f Fix warning with attribute string lookup 2024-01-08 13:25:08 -07:00
Tim Wojtulewicz
bbcc4b00fb Set -Werror / /WX via target_compile_options to force warnings as errors 2024-01-08 13:25:05 -07:00
Tim Wojtulewicz
3f70998896 Merge remote-tracking branch 'origin/topic/timw/update-broker'
* origin/topic/timw/update-broker:
  Update broker to pick up Windows 2-minute exception fix
2024-01-08 10:05:14 -07:00
Tim Wojtulewicz
3ae6a56c00 Update broker to pick up Windows 2-minute exception fix 2024-01-08 09:28:28 -07:00
Arne Welzel
dd42e00fc5 Bump cmake submodule 2024-01-08 16:00:14 +01:00
Arne Welzel
f3cbfa9c25 parse: Support @if conditionals in record definitions
Closes #3531
2024-01-08 15:21:48 +01:00