Commit graph

15389 commits

Author SHA1 Message Date
Tim Wojtulewicz
5b0d20b565 CI: remove FreeBSD 13.0, update FreeBSD 12 to 12.3 2022-09-08 10:13:09 -07:00
zeek-bot
015abc2f6f Update doc submodule [nomail] [skip ci] 2022-09-08 00:43:25 +00:00
Robin Sommer
627b97c8ff Merge remote-tracking branch 'origin/topic/awelzel/2289-at-if-else-if-no-way'
* origin/topic/awelzel/2289-at-if-else-if-no-way:
  parse.y/directives: Reject directives as statements
2022-09-07 14:33:15 +02:00
Robin Sommer
a60d569f7b Merge remote-tracking branch 'origin/topic/awelzel/dpd-analyzer-merger'
* origin/topic/awelzel/dpd-analyzer-merger:
  analyzer/dpd: Address review comments
  Remove @load base/frameworks/dpd from tests
  frameworks/dpd: Move to frameworks/analyzer/dpd, load by default
  scripts/dce-rpc,ntlm: Do not load base/frameworks/dpd
  btest: Remove unnecessary loading of frameworks/dpd
2022-09-07 14:30:28 +02:00
Tim Wojtulewicz
7cc876d84a Merge remote-tracking branch 'origin/topic/timw/2338-signature-eval-unused'
* origin/topic/timw/2338-signature-eval-unused:
  Add is_used attribute to an ID if used in a signature eval statement
2022-09-06 07:44:34 -07:00
Arne Welzel
4aaebf613e analyzer/dpd: Address review comments
* word-smith deprecation message
* do not load scripts/base/analyzer in segment logging policy script
2022-09-06 14:32:10 +02:00
zeek-bot
875e81883c Update doc submodule [nomail] [skip ci] 2022-09-04 00:45:50 +00:00
AmazingPP
970f45d686 Replace all the Warning() calls after IsFieldDeprecated() over to Warn() 2022-09-03 19:15:47 +08:00
AmazingPP
997d3ed126 Fix deprecation not flagged and incorrect line number in record 2022-09-03 10:36:01 +08:00
Christian Kreibich
0cce283086 Merge branch 'topic/christian/supervisor-pre-user-scripts'
* topic/christian/supervisor-pre-user-scripts:
  Update Management framework to new Supervisor::NodeConfig script fields
  Suppress deprecation warnings for the Supervisor's own NodeConfig::script access
  Expand Supervisor to support loading additional scripts before user scripts
2022-09-02 14:11:08 -07:00
Christian Kreibich
feefdf02b1 Updating CHANGES and VERSION. 2022-09-02 13:57:26 -07:00
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