Commit graph

756 commits

Author SHA1 Message Date
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
Arne Welzel
004dce2cf2 Merge remote-tracking branch 'origin/topic/awelzel/zeekctl-multiple-loggers'
* origin/topic/awelzel/zeekctl-multiple-loggers:
  NEWS: Add entry for ZeekControl and multi-loggers
  Bump zeekctl to multi-logger version
  logging: Support rotation_postprocessor_command_env
2023-04-27 12:17:02 +02:00
Arne Welzel
8f262df192 Merge remote-tracking branch 'origin/topic/awelzel/bump-af-packet'
* origin/topic/awelzel/bump-af-packet:
  Update AF-Packet submodule
  btest: Add af_packet to TestDirs
  Update AF-Packet submodule
2023-04-26 15:38:17 +02:00
Tim Wojtulewicz
965b36fe65 Update docs and NEWS to include LLC, SNAP, and Novell packet analyzers 2023-04-25 13:00:12 -07:00
Tim Wojtulewicz
43a2b39c05 Add NEWS entry about 802.11 and ARUBA changes 2023-04-25 11:37:30 -07:00
Arne Welzel
e856e953b8 Merge remote-tracking branch 'origin/topic/christian/sync-ignore_checksums-from-cli'
* origin/topic/christian/sync-ignore_checksums-from-cli:
  Given the -C flag, set script-layer ignore_checksums to true.
  Add btest for "-C" flag vs the script-layer ignore_checksums global.
2023-04-25 12:39:27 +02:00
Arne Welzel
ef7e714afd Update AF-Packet submodule
* Mask VLAN ID from tp_vlan_tci field to fix vlan > 4095 reported by Zeek
  when PCP and/or DEI bits are set.
* Descriptive error message when interface is down. Instead of
  "Invalid argument", Zeek now reports "interface is down".
2023-04-25 11:15:53 +02:00
Arne Welzel
1b69b4d26f Merge branch 'topic/amazingpp/irc-fuid-missing' of github.com:AmazingPP/zeek
* 'topic/amazingpp/irc-fuid-missing' of github.com:AmazingPP/zeek:
  Add irc_dcc_send_ack event and fix missing fields

I've moved IRC_Data back into the zeek::analyzer::file namespace, but
we did move the declaration from protocol/file/File.h to protocol/irc/IRC.h.
But, if someone actually customized IRC_Data and didn't include protocol/irc/IRC.h
for other reasons, I'll be surprised (and also just suggest to update the include).
2023-04-24 18:22:50 +02:00
Arne Welzel
ffb73e4de9 Merge remote-tracking branch 'origin/topic/awelzel/add-community-id'
* origin/topic/awelzel/add-community-id:
  testing/external: Bump hashes for community_id addition
  NEWS: Add entry for Community ID
  policy: Import zeek-community-id scripts into protocols/conn frameworks/notice
  Add community_id_v1() based on corelight/zeek-community-id
2023-04-24 10:12:56 +02:00
Arne Welzel
547e1b6280 NEWS: Add entry for Community ID 2023-04-24 09:43:22 +02:00
Jan Grashoefer
2cf16ccf81 Update NEWS to cover cluster framework changes. 2023-04-21 19:04:52 +02:00
Christian Kreibich
1c047786b4 Edit pass over the current 6.0 NEWS entries. [nomail] [skip ci] 2023-04-20 15:59:52 -07:00
Arne Welzel
4bcf5f4b76 NEWS: Add entry for ZeekControl and multi-loggers 2023-04-18 15:41:46 +02:00
Arne Welzel
d89f16dfc9 logging: Support rotation_postprocessor_command_env
This new table provides a mechanism to add environment variables to the
postprocessor execution. Use case is from ZeekControl to inject a suffix
to be used when running with multiple logger.
2023-04-17 13:10:14 +00:00
Arne Welzel
f0b9c59adb Add experimental JavaScript support when libnode is available
zeek.on('zeek_init', () => {
        console.log('Hello, Zeek!');
    });

For interaction with external systems and HTTP APIs, JavaScript and the
Node.js ecosystem beat Zeek script. Make it more easily accessible by
including ZeekJS with Zeek directly.

When a recent enough libnode version is found on the build system, ZeekJS is
added as a builtin plugin. This behavior can be disabled via
``--disable-javascript``. Linux distributions providing such a package are
Ubuntu (22.10) and Debian (testing/bookworm) as libnode-dev.
Fedora provides it as nodejs-devel.

This plugin takes over loading of .js or .cjs files. When no such files
are provided to Zeek, Node and the V8 engine are not initialized and
should not get into the way.

This should be considered experimental.
2023-04-14 11:26:41 +02:00
Dominik Charousset
2704934267 Add NEWS entry for the CMake changes 2023-04-13 22:31:05 +02:00
Tim Wojtulewicz
6ac72a31bf Merge remote-tracking branch 'origin/topic/arne.welzel/fix-poll-interval-is-live'
* origin/topic/arne.welzel/fix-poll-interval-is-live:
  iosource/Manager: Fix poll_interval updating using not-yet valid IsLive()
2023-04-12 13:23:46 -07:00
Tim Wojtulewicz
50c3d0f474 Add NEWS entries for filtered packet statistics and telemetry 2023-04-06 13:41:09 -07:00
Arne Welzel
c390c0203d iosource/Manager: Fix poll_interval updating using not-yet valid IsLive()
Testing io_poll_interval_live tweaks with @dopheide-esnet on a Myricom based
system to reduce CPU usage showed no visible effect.

It turns out, the pkt_src->IsLive() call used to update poll_interval is only
valid *after* calling ->Register() with the source. The conditional updating
of the poll_interval introduced in 4fa3e4b9b4
never worked out how it was intended to.

The fix ensures that

* we actually use a poll_interval of 10 in the live case
* changing io_poll_interval_live does have an effect

This is a bit of a major change due to lowering the default poll_interval
by a magnitude, but that seemed to have been the intention always. It's also
tunable via redef, so worst case it can be adapted via configuration.

As reference, with the default a Pcap::non_fd_timeout of 20usec *and* a
poll_interval of 100, theoretically we'd be trying to ask a non-selectable
packet source 500000 per second for a new packet. This is not a likely packet
rate that a single worker would currently observe or manage to process.
2023-04-06 11:44:50 +02:00
Arne Welzel
d9611132e8 scan.l: Support @pragma, specifically push/pop ignore-deprecations
This allows to ignore-deprecations as follows:

    @pragma push ignore-deprecations
    print r$deprecated;
    @pragma pop

A bit of infrastructure is put in place for the push and pop, but
nothing overly generalized for future pragmas.
2023-04-05 10:24:30 +02:00
Arne Welzel
daa6fff154 Merge remote-tracking branch 'origin/topic/awelzel/pkt-src-timeout-setting'
* origin/topic/awelzel/pkt-src-timeout-setting:
  PktSrc: Introduce Pcap::non_fd_timeout
2023-04-03 13:24:30 +02:00
Arne Welzel
2f5b9ce038 Merge remote-tracking branch 'origin/topic/awelzel/broker-no-network-time-init'
* origin/topic/awelzel/broker-no-network-time-init:
  btest/broker: Add test using Python bindings and zeek -r
  Broker: Remove network time initialization
2023-03-27 21:33:14 +02:00
Arne Welzel
fd15a33f8c NEWS: Some notes about timing related changes 2023-03-23 12:41:56 +01:00
Arne Welzel
93305ad9f4 Merge remote-tracking branch 'origin/topic/awelzel/make-some-deprecations-errors'
* origin/topic/awelzel/make-some-deprecations-errors:
  Expr: Factor out type tag extraction
  Var: Add version to deprecated initialization
  Stmt: Error on deprecated when/local usage
  Expr: Remove vector scalar operations
  parse.y: Make out-of-scope use errors
  scan.l: Remove unused deprecated_attr
2023-03-21 19:18:41 +01:00
Arne Welzel
63be88a1f8 Merge remote-tracking branch 'origin/topic/awelzel/supervisor-pcap-file'
* origin/topic/awelzel/supervisor-pcap-file:
  Add pcap_file option to supervised nodes.
2023-03-21 16:40:51 +01:00
Arne Welzel
2b14503c3d NEWS: main-loop changes around zero-timeout sources 2023-03-21 09:25:15 +01:00
Arne Welzel
cf2da5160b dns: Remove AD and CD flags from log
There was a misunderstanding whether to include them by default in
the dns.log, so remove them again.

There had also been a discussion and quirk that AD of a request would
always be overwritten by reply in the dns.log unless the reply is
missing. For now, let users extend dns.log themselves for what best
fits their requirements, rather than adding these flags by default.

Add a btest to print AD and CD flags for smoke testing still.
2023-03-16 10:09:27 +01:00
Christian Kreibich
c456f0206d Update NEWS to cover new Site::local_nets behavior. 2023-03-15 17:33:00 -07:00
Tim Wojtulewicz
4f902c0f39 Add configure option for preallocating PortVal objects 2023-03-15 10:12:32 -07:00
Johanna Amann
dcbc809189 Merge remote-tracking branch 'origin/topic/johanna/certificate-req'
* origin/topic/johanna/certificate-req:
  SSL/TLS CertificateRequest message: Address review feedback
  SSL/TLS: Parse CertificateRequest message
2023-03-15 10:03:25 +01:00
Arne Welzel
33090d7a27 Merge branch 'dnssec-flag-parse' of github.com:micrictor/zeek-codespace
* 'dnssec-flag-parse' of github.com:micrictor/zeek-codespace:
  Update external testing commit hash for DNS flag changes
  Parse DNSSEC AD and CD bits

Updated dump-events baseline which seemed unrelated.
2023-03-14 10:35:50 +01:00
Johanna Amann
b56b856da9 SSL/TLS: Parse CertificateRequest message
This commit introduces parsing of the CertificateRequest message in the
TLS handshake. It introduces a new event ssl_certificate_request, as
well as a new function parse_distinguished_name, which can be used to
parse part of the ssl_certificate_request event parameters.

This commit also introduces a new policy script, which appends
information about the CAs a TLS server requests in the
CertificateRequest message, if it sends it.
2023-03-09 09:12:29 +01:00
Arne Welzel
b58a2d3822 Revert "Merge branch 'topic/jgras/iosource-offline-fd' of https://github.com/J-Gras/zeek"
This reverts commit 957825441a, reversing
changes made to c8cdc75f2b.

Caused spurious CI failures in the external testing baselines. See zeek/zeek#2842.
2023-03-08 12:32:14 +01:00
Arne Welzel
957825441a Merge branch 'topic/jgras/iosource-offline-fd' of https://github.com/J-Gras/zeek
* 'topic/jgras/iosource-offline-fd' of https://github.com/J-Gras/zeek:
  Allow offline packet sources to register FDs.
2023-03-08 11:05:32 +01:00
Arne Welzel
802d24cad7 Merge remote-tracking branch 'origin/topic/awelzel/try-log-stream-metrics'
* origin/topic/awelzel/try-log-stream-metrics:
  Bump external test suites, filter some telemetry.log entries
  logging/Manager: Remove unused variable
  logging: Add telemetry for streams and log writers
2023-03-02 10:45:54 +01:00
Johanna Amann
989e9c29d2 X.509: expose the signature type inside the tbs certificate
This change exposes the signature tyope inside the signed portion of an
X.509 certificate. In the past, we only exposed the signature type that
is contained inside the signature, which is outside the signed portion
of the X.509 certificate.

In theory, both signature fields should have the same value; it is,
however, possible to encode differing values in both fields. The new
field is not logged by default.
2023-02-28 19:24:16 +00:00
Arne Welzel
d32ef970a9 Bump zeekctl and add NEWS entries
These are added to the 5.2 section of NEWS. This is for backporting
into release/5.2.
2023-02-27 16:26:30 +01:00
Arne Welzel
69a98e2cbb logging: Add telemetry for streams and log writers
This adds one metric per log stream and one metric per log writer (path based)
to track the number of writes on a stream level as well as on a writer level.

    $ curl -sSf localhost:8181/metrics | grep Conn
    zeek_log_writer_writes_total{endpoint="",filter-name="default",module="HTTP",path="http",stream="HTTP::LOG",writer="Log::WRITER_SQLITE"} 1 1677497572770
    zeek_log_stream_writes_total{endpoint="",module="HTTP",stream="HTTP::LOG"} 1 1677497572770

The initial version of this change also included metrics around log
write vetoes, but given no log policies exist in the default configuration
and they are mostly interesting for a few streams/writers only, skip this
for now. These can always be added by the script writer, too.

The difference between the stream level writes and concrete writers can
be used to deduce the number of vetoes (or errors) as a starting point.
2023-02-27 12:51:03 +01:00
Arne Welzel
352da9adc4 NEWS: Add paragraph about repo-info.json to Breaking Changes
This came up for OBS and following discussions in Slack indicate that
custom source tarballs might not be too uncommon.
2023-02-22 19:20:18 +01:00
Arne Welzel
d23b1331e5 zeek-config: Move ZEEK_VERSION* out of zeek-config.h
When bumping the VERSION file, everything that includes the auto-generated
zeek/zeek-config.h needs to rebuild and ccache usage is voided due the file
changing. Split the mutable version information into a new zeek-version.h
file to avoid this.

Further, do not include zeek-version.h within Plugin.h and avoid the reference
to ZEEK_VERSION_FUNCTION unless we're building an external plugin.

Closes #2776.
2023-02-22 16:48:39 +01:00
Arne Welzel
b2c4f8fd92 TableVal: Propagate &on_change attribute through copy()
Mostly for consistency with &default, &expire_func and other attributes
being propagated through a copy(). Seems this was just missed during
the implementation and/or was never tested for.
2023-02-17 16:21:32 +01:00