Commit graph

16738 commits

Author SHA1 Message Date
Arne Welzel
0a1568f1a1 mysql: Introduce mysql_ssl_request event
This should've been added with fa48c885 for completion. Do it now.
The MySQL spec calls it SSLRequest packet, so keep SSL in the name for
consistency.
2024-07-25 11:53:41 +02:00
Arne Welzel
6ea1045245 mysql: Fix EOFIfLegacyThenResultSet
Only expect a result next if an EOF was consumed.
2024-07-25 11:53:41 +02:00
Arne Welzel
320923418c mysql: Add data parameter to mysql_auth_plugin
This may contain salt from the server or a hashed password from the client.
2024-07-25 11:53:41 +02:00
Arne Welzel
40f1c2cb6d mysql: Add mysql_auth_plugin, mysql_auth_more_data and mysql_auth_switch_request events
Remove caching_sha2_password parsing/state from the analyzer and implement
the generic events. If we actually want to peak into the authentication
mechanism, we could write a separate analyzer for it. For now, treat it
as opaque values that are exposed to script land.

The added tests show the --get-server-public-key in use where
mysql_auth_more_data contains an RSA public key.
2024-07-25 11:53:41 +02:00
Arne Welzel
8a92945b06 mysql: AuthSwitchRequest: &enforce a 0xfe / 254 status 2024-07-25 11:53:41 +02:00
Arne Welzel
48e76f38cb mysql: Make auth_plugin_ a std::string 2024-07-25 11:53:40 +02:00
Arne Welzel
e98b80d140 mysql: Fix auth_plugin_data_part2 length computation 2024-07-25 11:53:40 +02:00
Fupeng Zhao
c82756bda4 Refactored connection phase state handling
Added `ConnectionExpected` enum for expected packet types during the connection phase.
2024-07-25 11:53:40 +02:00
Fupeng Zhao
e8bdf149f2 Add support for "auth switch" and "query attrs"
Also fix the issue where Resultset could not correctly distinguish between EOF_Packet and OK_Packet.
2024-07-25 11:53:40 +02:00
Fupeng Zhao
9cb618c718 Add support for parsing the "caching_sha2_password" auth plugin 2024-07-25 11:53:35 +02:00
Tim Wojtulewicz
6527850487 Merge remote-tracking branch 'origin/topic/timw/format-binpac-output-code'
* origin/topic/timw/format-binpac-output-code:
  Update binpac submodule to better format output code [nomail]
2024-07-24 15:29:08 -07:00
Tim Wojtulewicz
c4907c3f77 Update binpac submodule to better format output code [nomail] 2024-07-24 13:33:54 -07:00
Tim Wojtulewicz
bd208f4c54 Merge remote-tracking branch 'origin/topic/timw/smb2-ioctl-errors'
* origin/topic/timw/smb2-ioctl-errors:
  Update 7.0 NEWS with blurb about multi-PDU parsing causing increased load [nomail] [skip ci]
  Fix handling of zero-length SMB2 error responses
2024-07-24 13:26:07 -07:00
Tim Wojtulewicz
73fd12a76e Update 7.0 NEWS with blurb about multi-PDU parsing causing increased load [nomail] [skip ci] 2024-07-24 13:20:47 -07:00
Tim Wojtulewicz
2844d54f67 Fix handling of zero-length SMB2 error responses 2024-07-24 12:44:46 -07:00
Arne Welzel
52bcc92e40 Merge remote-tracking branch 'origin/topic/vern/script-opt-maint.Aug24'
* origin/topic/vern/script-opt-maint.Aug24:
  minor optimization of boolean comparisons
  fix & regression test for GH-3839 (spurious warnings for "when" constructs)
2024-07-24 11:18:18 +02:00
Christian Kreibich
c9d8ceaafa Merge branch 'topic/christian/bump-zeek-testing-cluster'
* topic/christian/bump-zeek-testing-cluster:
  Bump zeek-testing-cluster to reflect deprecation of prometheus.zeek
2024-07-23 19:18:52 -07:00
zeek-bot
8526914e4c Update doc submodule [nomail] [skip ci] 2024-07-24 00:19:23 +00:00
Christian Kreibich
146cf99ff6 Bump zeek-testing-cluster to reflect deprecation of prometheus.zeek 2024-07-23 16:58:52 -07:00
Vern Paxson
ff7466df6e minor optimization of boolean comparisons 2024-07-23 16:05:24 -07:00
Vern Paxson
e960c29acb fix & regression test for GH-3839 (spurious warnings for "when" constructs) 2024-07-23 15:18:21 -07:00
Tim Wojtulewicz
cb88f6316c Merge remote-tracking branch 'origin/topic/johanna/update-the-ct-list-and-the-ca-list-again'
* origin/topic/johanna/update-the-ct-list-and-the-ca-list-again:
  Update Mozilla CA list and CT list
2024-07-23 08:54:33 -07:00
Tim Wojtulewicz
da7c3d9138 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2024-07-23 08:51:55 -07:00
Johanna Amann
da131fae60 Update Mozilla CA list and CT list 2024-07-23 16:05:30 +01:00
Arne Welzel
6a6a5c3d0d Merge remote-tracking branch 'origin/topic/awelzel/ldap-extended-request-response-starttls'
* origin/topic/awelzel/ldap-extended-request-response-starttls:
  ldap: Add heuristic for wrap tokens
  ldap: Ignore ec/rrc for sealed wrap tokens
  ldap: Add LDAP sample with SASL-SRP mechanism
  ldap: Reintroduce encryption after SASL heuristic
  ldap: Fix assuming GSS-SPNEGO for all bindResponses
  ldap: Implement extended request/response and StartTLS support
2024-07-23 12:39:14 +02:00
Benjamin Bannier
dc61cd7a54 Bump auxil/spicy to latest development snapshot 2024-07-23 11:43:01 +02:00
Arne Welzel
d4778f451c ldap: Add heuristic for wrap tokens
Instead of dissecting the GSSAPI handshake, add another heuristic
into MaybeEncrypted to check for the WRAP token identifier.

After this change, the pcap on the following ticket is processed
nicely: https://gitlab.com/wireshark/migration-test/-/issues/9398
2024-07-23 11:29:00 +02:00
Arne Welzel
ca25516e03 ldap: Ignore ec/rrc for sealed wrap tokens
It shouldn't matter for the encrypted payload that we'll
just consume and ignore.
2024-07-23 11:29:00 +02:00
Arne Welzel
a70ccc51ab ldap: Add LDAP sample with SASL-SRP mechanism
This is what @dopheide-esnet actually saw. Produced with a custom
cyrus-sasl and openldap build :-(
2024-07-23 11:29:00 +02:00
Arne Welzel
3846db6ccf ldap: Reintroduce encryption after SASL heuristic
@dopheide-esnet provided sample captures where SASL SRP is used as
a SASL mechanism and the follow-up LDAP messages are encrypted. It's
not clear how to determine whether encryption will or will not happen,
so re-add a heuristic to determine this based on the first byte of
the first message *after* the successful bindResponse handshake. If
that byte is 0x30, assume cleartext.

I haven't been able to produce such pcaps, unfortunately, but the
cleartext path is tested via the existing sasl-ntlm.pcap.
2024-07-23 11:29:00 +02:00
Arne Welzel
724c08f286 ldap: Fix assuming GSS-SPNEGO for all bindResponses
In retrospect that's an obvious bug.
2024-07-23 11:29:00 +02:00
Arne Welzel
09a48c7028 ldap: Implement extended request/response and StartTLS support
PCAP was produced with a local OpenLDAP server configured to support StartTLS.

This puts the Zeek calls into a separate ldap_zeek.spicy file/module
to separate it from LDAP.
2024-07-23 11:29:00 +02:00
Arne Welzel
f4a79fa703 Merge remote-tracking branch 'origin/topic/awelzel/deprecate-prometheus-script'
* origin/topic/awelzel/deprecate-prometheus-script:
  telemetry: Deprecate prometheus.zeek policy script
2024-07-23 10:03:13 +02:00
Tim Wojtulewicz
f500c424fe Update broker submodule [nomail] 2024-07-22 14:59:17 -07:00
Arne Welzel
bf9704f339 telemetry: Deprecate prometheus.zeek policy script
With Cluster::Node$metrics_port being optional, there's not really
a need for the extra script. New rule, if a metrics_port is set, the
node will attempt to listen on it.

Users can still redef Telemetry::metrics_port *after*
base/frameworks/telemetry was loaded to change the port defined
in cluster-layout.zeek.
2024-07-21 17:49:21 +02:00
Arne Welzel
e982a18792 Merge remote-tracking branch 'origin/topic/awelzel/3836-input-create-any-abort-crash'
* origin/topic/awelzel/3836-input-create-any-abort-crash:
  input/Manager: Improve type checks of record fields with type any
2024-07-19 19:51:52 +02:00
Arne Welzel
3797622152 input/Manager: Improve type checks of record fields with type any
Calling AsRecordType() or AsFunc() on a Val of type any isn't safe.

Closes #3836
2024-07-19 11:35:54 +02:00
Christian Kreibich
0ba80d13b4 Merge branch 'topic/christian/bump-cluster-testsuite'
* topic/christian/bump-cluster-testsuite:
  Bump zeek-testing-cluster to pull in tee SIGPIPE fix
2024-07-17 15:37:29 -07:00
Christian Kreibich
b51a46f94d Bump zeek-testing-cluster to pull in tee SIGPIPE fix 2024-07-17 15:34:24 -07:00
Arne Welzel
2ea3a651bd Merge remote-tracking branch 'origin/topic/awelzel/spicy-ldap-krb-wrap-tokens'
* origin/topic/awelzel/spicy-ldap-krb-wrap-tokens:
  ldap: Remove MessageWrapper with magic 0x30 searching
  ldap: Harden parsing a bit
  ldap: Handle integrity-only KRB wrap tokens
2024-07-17 16:48:58 +02:00
Arne Welzel
e7aca5b388 ldap: Remove MessageWrapper with magic 0x30 searching
This unit implements a heuristic to search for the 0x30 sequence
byte if Message couldn't readily be parsed. Remove it with the
idea of explicit and predictable support for SASL mechanisms.
2024-07-17 15:28:27 +02:00
Arne Welzel
0cab87c185 ldap: Harden parsing a bit
ASN1Message(True) may go off parsing arbitrary input data as
"something ASN.1" This could be GBs of octet strings or just very
long sequences. Avoid this by open-coding some top-level types expected.

This also tries to avoid some of the &parse-from usages that result
in unnecessary copies of data.

Adds a locally generated PCAP with addRequest/addResponse that we
don't currently handle.
2024-07-17 15:27:14 +02:00
Arne Welzel
31122f335f ldap: Handle integrity-only KRB wrap tokens
Mostly staring at the PCAPs and opened a few RFCs. For now, only if the
MS_KRB5 OID is used and accepted in a bind response, start stripping
KRB5 wrap tokens for both, client and server traffic.

Would probably be nice to forward the GSS-API data to the analyzer...

Closes zeek/spicy-ldap#29.
2024-07-17 15:26:30 +02:00
Tim Wojtulewicz
9ba7c2ddaf Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2024-07-16 10:16:15 -07:00
Benjamin Bannier
41db05238b Bump auxil/spicy to latest development snapshot
This patch bump Spicy to the latest development snapshot. This
introduces a backwards-incompatible change in that it removes support
for a never officially supported syntax to specify unit fields (so I
would argue: not strictly a breaking change).
2024-07-16 08:17:31 +02:00
Tim Wojtulewicz
cb56837f07 Merge remote-tracking branch 'origin/topic/timw/fetchcontent_mkdir'
* origin/topic/timw/fetchcontent_mkdir:
  CI: Set FETCH_CONTENT_FULLY_DISCONNECTED flag for configure
  Update broker and cmake submodules [nomail]
2024-07-12 16:02:37 -07:00
Tim Wojtulewicz
4757536d7d CI: Set FETCH_CONTENT_FULLY_DISCONNECTED flag for configure 2024-07-12 15:14:31 -07:00
Tim Wojtulewicz
a46be1ea29 Update broker and cmake submodules [nomail] 2024-07-12 15:14:31 -07:00
Tim Wojtulewicz
f3bcf1a55d Fix a broken merge
I merged an old version of the branch on accident and then merged the right
one over top of it, but git ended up including both versions. This fixes
that mistake.
2024-07-12 10:00:13 -07:00
Tim Wojtulewicz
b935d2f59a Merge remote-tracking branch 'origin/topic/bbannier/lib-spicy-hooks'
* origin/topic/bbannier/lib-spicy-hooks:
  Do not emit hook files for builtin modules
2024-07-12 09:51:55 -07:00