Commit graph

15378 commits

Author SHA1 Message Date
Christian Kreibich
e73b561dca Update Management framework to new Supervisor::NodeConfig script fields 2022-09-02 12:12:19 -07:00
Christian Kreibich
412c150c63 Suppress deprecation warnings for the Supervisor's own NodeConfig::script access
These spots involve our own usage of the deprecated "scripts" field, required to
keep the deprecation functional.
2022-09-02 12:12:19 -07:00
Christian Kreibich
c7860e3238 Expand Supervisor to support loading additional scripts before user scripts
In supervised nodes, the Supervisor's NodeConfig$scripts vector adds scripts to
the end of the user-provided scripts (options.scripts_to_load), so they load
_after_ any user-provided ones. This can cause confusing redef pitfalls when
users expect their customizations to run last, as they normally do.

This adds two members in Supervisor::NodeConfig, `addl_base_scripts` and
`addl_user_scripts`, to store scripts to load before and after the user scripts,
respectively. The latter serves the same purpose as the old `scripts` member,
which is still there but deprecated (in scriptland only). It functions as
before, after any scripts added via `addl_user_scripts`.
2022-09-02 10:23:35 -07:00
zeek-bot
61c001a57e Update doc submodule [nomail] [skip ci] 2022-09-01 00:52:02 +00:00
Tim Wojtulewicz
4ed0acb006 Fix warning in modbus analyzer
This was introduced in 8d7a156109
2022-08-31 23:46:35 +00:00
Tim Wojtulewicz
0a0dd7143b Add is_used attribute to an ID if used in a signature eval statement 2022-08-31 14:58:23 -07:00
Christian Kreibich
a726418d38 Merge branch 'topic/awelzel/cluster-telemetry-defaults'
* topic/awelzel/cluster-telemetry-defaults:
  telemetry: Use dynamic metrics port, remove broker topic mentioning from NEWS entry
  telemetry: In a cluster, open port 9911 for Prometheus by default
2022-08-31 10:53:47 -07:00
Tim Wojtulewicz
9ccbf9063a Merge remote-tracking branch 'origin/topic/awelzel/topic/to-port-empty-string'
* origin/topic/awelzel/topic/to-port-empty-string:
  bifs/to_port: Avoid ASAN errors when calling to_port("")
2022-08-31 08:17:04 -07:00
Arne Welzel
c89be2a13b bifs/to_port: Avoid ASAN errors when calling to_port("")
Ran into this when using to_port(getenv(...)) for an undefined/empty
environment variable. ASAN doesn't like that the slash variable ends
up being access behind the string.
2022-08-31 17:15:50 +02:00
Arne Welzel
654fd9c7da Remove @load base/frameworks/dpd from tests
Now that it's loaded in bare mode, no need to load it explicitly.

The main thing that tests were relying on seems to be tracking of
c$service for conn.log baselines. Very few were actually checking
for dpd.log
2022-08-31 17:00:55 +02:00
Arne Welzel
9e7f2a04c1 frameworks/dpd: Move to frameworks/analyzer/dpd, load by default
* Because frameworks/analyzer is loaded via init-frameworks-and-bifs the
  dpd functionality (really just dpd.log and disabling of analyzers) is
  now enabled even in bare mode.
* Not sure we need to keep frameworks/base/dpd/__load__.zeek around
  or can just remove it right away.
2022-08-31 16:50:47 +02:00
Arne Welzel
b60a4e3a1f scripts/dce-rpc,ntlm: Do not load base/frameworks/dpd
DPD will work without loading this explicitly and these are the only
scripts that do load it explicitly.
2022-08-31 16:50:37 +02:00
Arne Welzel
b2d33db3d9 btest: Remove unnecessary loading of frameworks/dpd
These tests do not test conn.log or dpd.log, so they don't actually
need to @load dpd - dynamic-protocol-detection is enabled anyway.
2022-08-31 16:50:37 +02:00
zeek-bot
e580a8b356 Update doc submodule [nomail] [skip ci] 2022-08-31 00:44:58 +00:00
Arne Welzel
65b31c525d telemetry: Use dynamic metrics port, remove broker topic mentioning from NEWS entry 2022-08-30 11:20:14 +02:00
Tim Wojtulewicz
28f6705e06 Merge remote-tracking branch 'origin/topic/timw/2382-string-cat-type-check'
* origin/topic/timw/2382-string-cat-type-check:
  Add type checking to string_cat arguments
2022-08-29 09:27:05 -07:00
Tim Wojtulewicz
ed4521af60 Add type checking to string_cat arguments 2022-08-29 08:45:59 -07:00
Tim Wojtulewicz
686eb54f95 Merge remote-tracking branch 'origin/topic/awelzel/gtpv1-no-protocol-detection'
* origin/topic/awelzel/gtpv1-no-protocol-detection:
  gtpv1: Do not register for protocol detection
2022-08-26 14:49:54 -07:00
Tim Wojtulewicz
d3e95c938f Merge remote-tracking branch 'origin/topic/timw/generic-fuzzer'
* origin/topic/timw/generic-fuzzer:
  Move fuzzer corpus files to another directory
  Add a way to create generic fuzzers without creating new files
2022-08-26 14:36:13 -07:00
Tim Wojtulewicz
d8b31de1a2 Move fuzzer corpus files to another directory 2022-08-26 13:51:30 -07:00
Tim Wojtulewicz
52431bc55c Add a way to create generic fuzzers without creating new files 2022-08-26 13:51:30 -07:00
Tim Wojtulewicz
b9f63173bc Check for valid ip_hdr length before trying to make a Val out of it 2022-08-26 13:39:29 -07:00
Tim Wojtulewicz
8d7a156109 Fix potential overflow in modbus analyzer's bytestring_to_coils 2022-08-26 10:59:59 -07:00
Tim Wojtulewicz
4993a51c29 Add some sanity checking to BadARPEvent method 2022-08-26 10:59:49 -07:00
Tim Wojtulewicz
519d0d810d Swap DNS EDNS field order to match script-land type 2022-08-26 10:59:21 -07:00
Tim Wojtulewicz
719e0a0f4f Reset packet cap_len before returning from IP::AnalyzePacket 2022-08-26 10:59:10 -07:00
Tim Wojtulewicz
2d7bfb4ca7 Merge remote-tracking branch 'origin/topic/neverlord/ssl-auth-test'
* origin/topic/neverlord/ssl-auth-test:
  Revert to regular peering fn for ssl_auth_failure
2022-08-26 09:09:36 -07:00
Dominik Charousset
456efd8082 Revert to regular peering fn for ssl_auth_failure
With the fixed Broker version, the `ssl_auth_failure` btest can use the
regular `peer` function again.
2022-08-26 17:00:45 +02:00
Arne Welzel
42be2444a7 gtpv1: Do not register for protocol detection
While reviewing/understanding the analyzer setup, it didn't seem like
GTPv1 implements packet_analysis::Analyzer::DetectProtocol(), so
should not register it for protocol_detection either.

Alternatively, maybe DetectProtocol() should've been implemented in
which case maybe this should be an issue?
2022-08-26 10:47:38 +02:00
Arne Welzel
171846a37a parse.y/directives: Reject directives as statements
Avoid the issue outlined in #2289 where the @if or @else is taken as the
statement of an `if`, `for` or `while` by rejecting such constructs.

Effectively this means the following scripts are now rejected:

    # Print's "cond true" with Zeek 5.0 even though the `if ( F )`
    # should be in effect.

    if ( F )
        @if ( T )
            print "cond true";
        @else
            print "cond false";
        @endif

or

    # Print's "hello" once with Zeek 5.0
    local v = vector( 1, 2, 3 );

    for ( i in v )
        @if ( T )
        print("hello")
        @endif

To make above work as intended, additional braces can be used.

    if ( T )
        {
    @if ( cond )
            print "cond true";
    @else
            print "cond false";
    @endif
        }

    for ( i in v )
        {
    @if ( T )
        print("hello")
    @endif
        }
2022-08-26 09:42:50 +02:00
Arne Welzel
7310952358 telemetry: In a cluster, open port 9911 for Prometheus by default
Port 9911 has been allocated here:

https://github.com/prometheus/prometheus/wiki/Default-port-allocations

Logic is put into telemetry/cluster.zeek. Doing it in `cluster/nodes/`
seemed like quite some extra splitting for just those few settings.
2022-08-26 09:42:12 +02:00
Tim Wojtulewicz
6721248da5 Merge remote-tracking branch 'origin/topic/timw/bump-spicy'
* origin/topic/timw/bump-spicy:
  Bump Spicy dependencies to spicy-1.5.1 and spicy-plugin-1.3.17.
2022-08-25 15:26:55 -07:00
Tim Wojtulewicz
bde34016cf Merge remote-tracking branch 'origin/topic/timw/new-macos-ci'
* origin/topic/timw/new-macos-ci:
  Switch macOS Monterey build to new m1-based VM
2022-08-25 15:15:52 -07:00
Benjamin Bannier
3b2b327d7d Bump Spicy dependencies to spicy-1.5.1 and spicy-plugin-1.3.17.
(cherry picked from commit 7e1840f5fe)
2022-08-25 12:55:37 -07:00
Tim Wojtulewicz
a927c4a998 Switch macOS Monterey build to new m1-based VM 2022-08-25 12:54:12 -07:00
Tim Wojtulewicz
0e9c7c77e0 Merge remote-tracking branch 'origin/topic/timw/2367-broker-ssl_auth_failure'
* origin/topic/timw/2367-broker-ssl_auth_failure:
  Avoid race conditions in broker.ssl_auth_failure btest
2022-08-25 12:46:11 -07:00
Tim Wojtulewicz
c88a362d1b Avoid race conditions in broker.ssl_auth_failure btest 2022-08-24 12:10:42 -07:00
Tim Wojtulewicz
011cfc2aaa Update docs submodule [nomail] [skip ci] 2022-08-24 09:51:49 -07:00
Tim Wojtulewicz
5ff189e234 Merge remote-tracking branch 'origin/topic/bbannier/issue-2363'
* origin/topic/bbannier/issue-2363:
  Use correct variable to pass existing Spicy root to spicy-plugin.
2022-08-24 09:34:10 -07:00
Tim Wojtulewicz
76b6cf7afa Merge remote-tracking branch 'simeonmiteff/master'
* simeonmiteff/master:
  Pull changes from zeek/cmake fork
  Skip test based on preprocessor flag set by cmake
  Set flag for libpcap without DLT_LINUX_SLL2
  Force event order in core/init-error btest
  Update some coverage baselines
  Update plugins/hooks baseline
  Add support for DLT_LINUX_SLL2 PCAP link-type
2022-08-24 09:23:01 -07:00
Johanna Amann
0968322c5f Merge remote-tracking branch 'origin/topic/neverlord/gh-2343'
* origin/topic/neverlord/gh-2343:
  Add missing bits for Broker::metrics_import_topics
  Try adding Broker::metrics_import_topics, stuck
2022-08-24 13:26:20 +01:00
Tim Wojtulewicz
8829490045 Merge remote-tracking branch 'origin/topic/awelzel/2075-if-conditional-parsing'
* origin/topic/awelzel/2075-if-conditional-parsing:
  parse.y/anonymous_function: Allow conditionals between begin_lambda and lambda_body
2022-08-23 20:28:17 -07:00
Simeon Miteff
3582e41838 Pull changes from zeek/cmake fork 2022-08-24 12:47:32 +10:00
Simeon Miteff
74cc5dcd6b Skip test based on preprocessor flag set by cmake
Relies on change in d42dcb2d55029975a6a6b2e6378fc49a268631ec
2022-08-24 12:47:32 +10:00
Simeon Miteff
e9eed20169 Set flag for libpcap without DLT_LINUX_SLL2
Requires
6fd82a7e1d

Submodule edited until that can be merged.
2022-08-24 12:47:32 +10:00
Simeon Miteff
bfcc457093 Force event order in core/init-error btest
See https://github.com/zeek/zeek/pull/2340#issuecomment-1218131444
2022-08-24 12:47:25 +10:00
zeek-bot
05a071c7e8 Update doc submodule [nomail] [skip ci] 2022-08-24 00:48:47 +00:00
Simeon Miteff
2a22eb4078 Update some coverage baselines 2022-08-24 10:38:51 +10:00
Simeon Miteff
0bfec34732 Update plugins/hooks baseline 2022-08-24 10:38:51 +10:00
Simeon Miteff
b8f0acb5f1 Add support for DLT_LINUX_SLL2 PCAP link-type 2022-08-24 10:38:31 +10:00