Commit graph

16811 commits

Author SHA1 Message Date
Tim Wojtulewicz
15d404dd19 Remove deprecated port/ports fields for spicy analyzers 2024-08-07 11:58:22 -07:00
Tim Wojtulewicz
4e9d843cec Remove deprecated Cluster::Node::interface field 2024-08-07 11:58:22 -07:00
Tim Wojtulewicz
9142a48725 Remove deprecated signature definition format 2024-08-07 11:58:22 -07:00
Tim Wojtulewicz
2d68b1d834 Return an error if GLOBAL:: prefix is used 2024-08-07 11:58:22 -07:00
Tim Wojtulewicz
ca69d9fb8f Remove deprecated BloomFilter serialization methods 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
dd982ee6c4 Remove deprecated OpaqueVal serialization methods 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
cbe612400c Remove deprecated DECLARE_OPAQUE_VALUE macro 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
260a8afebe Make TypePtr::Capture member variables private
The public versions were marked as deprecated for 7.0, and accessors
should be used to manage them now.
2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
a53cc4d01b Remove deprecated Trigger constructor 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
535df5e263 Remove deprecated Controller::auto_assign_ports and Controller::auto_assign_start_port 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
7a5b29ea81 Remove deprecated load-balacing policy script 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
1d0f01d6bc Remove deprecated prometheus telemetry policy script 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
85b4dc773e Remove deprecated policy/tuning/default package 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
a716903f3a Remove deprecated time machine settings 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
aba1f431cf Remove deprecated json NullDoubleWriter class 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
401a074036 Remove deprecated modbus event definitions 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
6bb00f9e01 Remove Connection::AppendAddl 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
1d4bd2c70a Remove STMT_ANY statement type 2024-08-07 11:58:21 -07:00
Tim Wojtulewicz
e2b03681d1 Remove EventRegistry::Used and EventRegistry::SetUsed 2024-08-07 11:58:21 -07:00
Arne Welzel
97fa7cdc0a Merge remote-tracking branch 'origin/topic/awelzel/ldap-fix-uint8-shift'
* origin/topic/awelzel/ldap-fix-uint8-shift:
  ldap: Promote uint8 to uint64 before shifting
2024-08-07 14:11:30 +02:00
Arne Welzel
2be39cf0d0 ldap: Promote uint8 to uint64 before shifting
Relates to zeek/spicy#1829
2024-08-07 13:47:12 +02:00
Arne Welzel
2c62ecf57d Merge remote-tracking branch 'origin/topic/awelzel/ci-ubuntu-24-new-ccache'
* origin/topic/awelzel/ci-ubuntu-24-new-ccache:
  ci/ubuntu-24.04: Use ccache 4.10.2
2024-08-07 11:43:33 +02:00
Arne Welzel
84c9daafd1 ci/ubuntu-24.04: Use ccache 4.10.2
The ccache version shipped with Ubuntu 24.04 does not yet recognize
--fprofile-update=atomic, install one that does.

Now that the asan_sanitizer build also includes building Spicy and
running the spicyz test suite, ccache is quite important.

Reference ccache/ccache#1408 and zeek/zeek#3777.
2024-08-07 11:36:00 +02:00
Arne Welzel
b0df736ba7 Merge remote-tracking branch 'origin/topic/awelzel/threading-manager-metrics-follow-up'
* origin/topic/awelzel/threading-manager-metrics-follow-up:
  telemetry/Manager: Check RegisterFd() return value
  telemetry/Manager: Track sent_in and sent_out totals without callback
  threading/Manager: Switch inf bucket from infinity() to max()
  threading/Manager: "lt" to "le" and do not break
2024-08-07 10:55:13 +02:00
Arne Welzel
4fe9580a7e telemetry/Manager: Check RegisterFd() return value
Please coverity.
2024-08-07 09:48:29 +02:00
zeek-bot
60bdaffe0b Update doc submodule [nomail] [skip ci] 2024-08-07 00:20:16 +00:00
Arne Welzel
c845c7cce0 Merge remote-tracking branch 'origin/topic/awelzel/3860-ldap-fuzzer'
* origin/topic/awelzel/3860-ldap-fuzzer:
  Bump auxil/spicy to latest development snapshot
  spicy/runtime-support: Switch ParameterMismatch::_fmt to static
  coverage/lcov_html: Ignore testing/btest/.tmp
  cirrus: Do not disable Spicy for sanitizer builds
  ldap: Avoid unset m$opcode
  fuzzers: Add LDAP fuzzing
2024-08-06 20:09:09 +02:00
Arne Welzel
821d460c2e Bump auxil/spicy to latest development snapshot 2024-08-06 18:20:09 +02:00
Arne Welzel
9f5f8b809a spicy/runtime-support: Switch ParameterMismatch::_fmt to static
UBSAN's vptr sanitize isn't happy with the call to _fmt()
in its member initializer list.

    $ zeek -r Traces/ssh/single-conn.trace .tmp/spicy.event-args-mismatch/test.hlto .tmp/spicy.event-args-mismatch/event-args-mismatch.zeek
    <...>/src/include/zeek/spicy/runtime-support.h:80:29: runtime error: member call on address 0x511000369540 which does not point to an object of type 'zeek::spicy::rt::ParameterMismatch'
    0x511000369540: note: object has invalid vptr
     00 00 00 00  be be be be be be be be  be be be be be be be be  be be be be be be be be  be be be be
                  ^~~~~~~~~~~~~~~~~~~~~~~
                  invalid vptr
        #0 0x7f9c9977b019 in zeek::spicy::rt::ParameterMismatch::ParameterMismatch(std::basic_string_view<char, std::char_traits<char>>, zeek::IntrusivePtr<zeek::Type> const&, std::basic_string_view<char, std::char_traits<char>>) <...>/src/include/zeek/spicy/runtime-support.h:80:29
         #1 0x7f9c9977a6a2 in zeek::spicy::rt::to_val(hilti::rt::Bytes const&, zeek::IntrusivePtr<zeek::Type> const&) <...>/src/include/zeek/spicy/runtime-support.h:562:15
2024-08-06 18:20:09 +02:00
Arne Welzel
11bc233f45 coverage/lcov_html: Ignore testing/btest/.tmp
gcda/gcno files in the btest/.tmp directory are from .htlo files
referencing ephemeral cc files. No need to include these.
2024-08-06 18:20:09 +02:00
Arne Welzel
f1167fc87f cirrus: Do not disable Spicy for sanitizer builds 2024-08-06 18:20:09 +02:00
Arne Welzel
83a2eb3665 ldap: Avoid unset m$opcode
Initial fuzzing caused a bind response to arrive before a bind request,
resulting in an unset field expression error:

    expression error in base/protocols/ldap/main.zeek, line 270: field value missing (LDAP::m$opcode)

Prevent this by ensuring m$opcode is set and raising instead.
2024-08-06 18:20:09 +02:00
Arne Welzel
92d4e50b48 fuzzers: Add LDAP fuzzing
LDAP supports both, UDP and TCP as separate analyzers. The corpus
is identical, however. Started to hit the TLS analyzer fairly
quickly, too.

Closes #3860
2024-08-06 18:20:09 +02:00
Tim Wojtulewicz
d52ec28c89 Merge remote-tracking branch 'origin/topic/timw/dont-install-empty-zam-dirs'
* origin/topic/timw/dont-install-empty-zam-dirs:
  Don't install empty ZAM directories
2024-08-06 09:02:31 -07:00
Arne Welzel
bd8c5b7bbb Merge remote-tracking branch 'upstream/topic/awelzel/fix-btest-spicy-replaces-conflicts'
* upstream/topic/awelzel/fix-btest-spicy-replaces-conflicts:
  btest/spicy: Make replaces-conflicts trigger replaces code path
2024-08-06 12:03:18 +02:00
Arne Welzel
bae15230bb btest/spicy: Make replaces-conflicts trigger replaces code path
The current test attempts to instantiate two spicy::SSH_1 protocol
analyzers in the .evt file. The intention likely was to use two
distinct protocol analyzer both trying to replace the builtin SSH
analyzer.

Coincidentally, fixing this happens to workaround TSAN errors tickled
by the FatalError() call while loading the .hlto with two identically
named analyzers.

    $ cat .tmp/spicy.replaces-conflicts/output
    error: redefinition of protocol analyzer spicy::SSH_1
    ThreadSanitizer: main thread finished with ignores enabled
      One of the following ignores was not ended (in order of probability)
      Ignore was enabled at:
        #0 __llvm_gcov_init __linker___d192e45c25d5ee23-484d3e0fc2caf5b4.cc (ssh.hlto+0x34036) (BuildId: 091934ca4da885e7)
        #1 __llvm_gcov_init __linker___d192e45c25d5ee23-484d3e0fc2caf5b4.cc (ssh.hlto+0x34036) (BuildId: 091934ca4da885e7)
        ...

I was tempted to replace FatalError() with Error() and rely on
zeek-setup.cc's early exiting on any reporter errors, but this
seems easier for now.

Relates to #3865.
2024-08-06 11:52:52 +02:00
Arne Welzel
351f16c160 telemetry/Manager: Track sent_in and sent_out totals without callback
For terminated threads, the totals would go down once the threads are
removed, which isn't great. Move tracking of sent in and sent out
messages from callback to explicit `Inc()` calls.

Also fixes total_messages_in_metric being initialized twice rather
than total_messages_out_metric.
2024-08-06 11:06:38 +02:00
Arne Welzel
c55b2ece8f threading/Manager: Switch inf bucket from infinity() to max()
For uint64_t, std::numeric_limits<T>::has_infinity is false and infinity()
actually returns 0. Use uint64_t's max() instead. We could cast to double
and use the double infinity, but this seems reasonable, too.

This was found while trying to provoke some pending messages and being
confused why all but the "inf" bucket increased.
2024-08-06 11:05:42 +02:00
Arne Welzel
98480cf339 threading/Manager: "lt" to "le" and do not break
The buckets are specified as lower-equal (changed from lower-than now),
which means we shouldn't break: The larger "le" bucket contains all previous
buckets, too. The "inf" bucket represents the current number of threads.

For example, with a total of 10 threads, 5 threads with 0 messages pending,
another 4 threads with 50 messages, and on with 2000 messages, the metrics
would end end up as follows:

    pending_buckets{le=1}      = 5
    pending_buckets{le=10}     = 5
    pending_buckets{le=100}    = 9
    pending_buckets{le=1000}   = 9
    pending_buckets{le=10000}  = 10
    pending_buckets{le=inf}    = 10

This might be strange initially, but aligns with the Prometheus
histogram approach (though we're using gauges here).
2024-08-06 09:46:51 +02:00
Tim Wojtulewicz
2f8733e08d Don't install empty ZAM directories 2024-08-05 16:23:03 -07:00
Tim Wojtulewicz
25f65a705f Updating CHANGES and VERSION. 2024-08-05 14:40:31 -07:00
Tim Wojtulewicz
b483fad3d0 Merge remote-tracking branch 'origin/topic/timw/3081-prof-log-metrics'
* origin/topic/timw/3081-prof-log-metrics:
  Remove some unnecessary #includes
  Avoid capturing 'this' for callback in telemetry::Manager
  Make telemetry metrics out of MsgThread statistics
  Split cpu time metric into user/system components like prof.log
  Move broker statistics to be telemetry metrics
  Add timer counts as telemetry metrics
  Move thread manager stats to telemetry metric
  Add extra metrics to session_mgr
  Move dns_mgr stats to telemetry instruments
  Move trigger stats to telemetry instruments
  Move pulling of global state inside 'expensive' check for stats
2024-08-05 14:39:56 -07:00
Tim Wojtulewicz
1325e16a0d Remove some unnecessary #includes 2024-08-05 13:27:30 -07:00
Tim Wojtulewicz
7a1eb78b67 Avoid capturing 'this' for callback in telemetry::Manager 2024-08-05 13:27:30 -07:00
Tim Wojtulewicz
73f71e652d Make telemetry metrics out of MsgThread statistics 2024-08-05 13:27:30 -07:00
Tim Wojtulewicz
a6843067e9 Split cpu time metric into user/system components like prof.log
The total can be calculated from the two parts via Prometheus/Grafana
if desired, so it's more informative to pass them as separate parts.
2024-08-05 13:27:30 -07:00
Tim Wojtulewicz
206f5cd522 Move broker statistics to be telemetry metrics 2024-08-05 13:27:30 -07:00
Tim Wojtulewicz
44860676a2 Add timer counts as telemetry metrics 2024-08-05 13:21:44 -07:00
Tim Wojtulewicz
4face43462 Move thread manager stats to telemetry metric 2024-08-05 13:21:44 -07:00
Tim Wojtulewicz
a81f6ab9a6 Add extra metrics to session_mgr
- Sessions killed by activity
- Current number of sessions across all types
2024-08-05 13:21:44 -07:00