Commit graph

15378 commits

Author SHA1 Message Date
Tim Wojtulewicz
b41a4bf06d GH-1628: Return an error for duplicate record field names 2022-07-21 11:53:47 -07:00
Tim Wojtulewicz
d57ad3e405 Fix a bug with splitting strings in Ascii input reader
The previous way of splitting strings would break if the last string in
the line was an empty string, and it would return one fewer fields than
it should have. This was breaking the last line in the
scripts.base.framework.input.ascii.setspecialcases once the bug fixed in
GH #1628 was fixed.
2022-07-21 11:53:47 -07:00
Tim Wojtulewicz
a0cc34efb2 Iterator and looping cleanup in Ascii input reader 2022-07-21 11:53:47 -07:00
Tim Wojtulewicz
510dd1cf71 Add util::split methods for splitting strings 2022-07-21 11:53:47 -07:00
Tim Wojtulewicz
5665696a05 Merge remote-tracking branch 'amazingpp/topic/amazingpp/bitshift-operators'
* amazingpp/topic/amazingpp/bitshift-operators:
  Add bitshift operators
2022-07-21 09:06:41 -07:00
AmazingPP
f2bfa61fc6 Add bitshift operators 2022-07-21 11:12:30 +08:00
zeek-bot
0bf75bd67b Update doc submodule [nomail] [skip ci] 2022-07-20 00:45:00 +00:00
Robin Sommer
ad2557755d Merge remote-tracking branch 'origin/topic/robin/gh-2267-doctest'
* origin/topic/robin/gh-2267-doctest:
  Add btest that runs the doctest-based unit tests.
2022-07-19 15:21:39 +02:00
Robin Sommer
d5db2623dc Merge remote-tracking branch 'origin/topic/robin/gh-2280-modifiable-const-via-loops-merge'
* origin/topic/robin/gh-2280-modifiable-const-via-loops-merge:
  Add help function to check loop variable
  Fix local const variables can be modified via loops
2022-07-19 15:20:34 +02:00
Robin Sommer
f40ca42590 Merge branch 'topic/amazingpp/modifiable-const-via-loops' of ssh://github.com/AmazingPP/zeek
Edits: Slight tweaking, plus a simple test.

* 'topic/amazingpp/modifiable-const-via-loops' of ssh://github.com/AmazingPP/zeek:
  Add help function to check loop variable
  Fix local const variables can be modified via loops
2022-07-19 14:26:59 +02:00
Johanna Amann
b27c114d68 Merge remote-tracking branch 'origin/infallible-analyzer-violation'
* origin/infallible-analyzer-violation:
  Remove use of fallible `get_conn_transport_proto` in `analyzer_violation`.
2022-07-19 12:57:42 +01:00
Benjamin Bannier
396fb89504 Remove use of fallible get_conn_transport_proto in analyzer_violation.
When setting up the DPD info we previously would get the
`transport_proto` for the connection with `get_conn_transport_proto`.
This function takes a `conn_id` and would fail fatally if the connection
for the given ID was unknown. It seems it was possible to run into such
scenarios when the `analyzer_violation` event was processed after the
connection had been cleaned up.

We now get the `transport_proto` directly from the ports in the
`connection` passed into `analyzer_violation` via
`get_port_transport_proto` which cannot fail.
2022-07-19 12:20:45 +02:00
Robin Sommer
265fa83a24 Merge remote-tracking branch 'origin/topic/awelzel/2276-smb2-delete-on-close'
* origin/topic/awelzel/2276-smb2-delete-on-close:
  smb2: Raise smb2_file_delete for CREATE with FILE_DELETE_ON_CLOSE
2022-07-19 12:02:16 +02:00
Robin Sommer
202037181c Add btest that runs the doctest-based unit tests.
Closes #2267.
2022-07-19 11:35:09 +02:00
AmazingPP
f5f489ba10 Add help function to check loop variable 2022-07-19 09:08:42 +08:00
Tim Wojtulewicz
42c36019e6 Merge remote-tracking branch 'origin/topic/awelzel/debuglogger-const-auto'
* origin/topic/awelzel/debuglogger-const-auto:
  DebugLogger: "auto const" to "const auto"
2022-07-18 08:57:41 -07:00
Tim Wojtulewicz
373e201df6 Merge remote-tracking branch 'origin/topic/timw/deprecation-warnings'
* origin/topic/timw/deprecation-warnings:
  Fix some warnings from bro_version deprecation
2022-07-18 08:55:46 -07:00
Tim Wojtulewicz
0d3d9f67b0 Fix some warnings from bro_version deprecation 2022-07-18 08:55:18 -07:00
Tim Wojtulewicz
33f97fc3fb Merge remote-tracking branch 'origin/topic/timw/636-config-commas'
* origin/topic/timw/636-config-commas:
  GH-636: Fix regex to handle commas at the end of config parser lines
  Convert config framework to use std::regex
2022-07-18 08:54:44 -07:00
Tim Wojtulewicz
05bb509789 GH-636: Fix regex to handle commas at the end of config parser lines 2022-07-18 08:54:06 -07:00
Tim Wojtulewicz
65ee2287e9 Convert config framework to use std::regex 2022-07-18 08:42:34 -07:00
AmazingPP
3312e19d5b Fix local const variables can be modified via loops 2022-07-18 20:31:21 +08:00
Arne Welzel
ec9e0fed2f DebugLogger: "auto const" to "const auto"
This was pointed out in a separate PR so fixing the occurrence I
had managed to sneak in already.
2022-07-18 09:30:12 +02:00
Michael Torres
bab2036aa4 Add modbus transaction and unit ids to logs
Add transaction IDs and unit IDs to default modbus over TCP/IP logs.
Update the relevant testing baselines to account for the extra fields.
2022-07-17 21:02:37 +00:00
Michael Torres
7c24b53b4f Enable modbus logging for requests 2022-07-17 21:02:37 +00:00
Arne Welzel
3dae8ab086 smb2: Raise smb2_file_delete for CREATE with FILE_DELETE_ON_CLOSE
When a CREATE request contains the FILE_DELETE_ON_CLOSE option and
the subsequent CREATE response indicates success, we now raise the
smb2_file_delete event to log a delete action in smb_files.log and
also give users a way to handle this scenario.

The provided pcap was generated locally by recording a smbtorture run
of the smb2.delete-on-close-perms test case.

Placed the create_options into the CmdInfo record for potential
exposure in smb_cmd.log (wasn't sure how that would look so left it
for the future).

Fixes #2276.
2022-07-16 17:14:13 +02:00
zeek-bot
1d2c12e980 Update doc submodule [nomail] [skip ci] 2022-07-15 00:41:35 +00:00
Christian Kreibich
6543c21d23 Merge branch 'topic/christian/management-agent-boot-fix'
* topic/christian/management-agent-boot-fix:
  Management framework: bump cluster testsuite
  Management framework: undo the testsuite result mask
  Management framework: additional logging tweaks
  Management framework: additional context in a few log messages
  Management framework: await Supervisor peering before sending agent's hello
  Management framework: remove outdated comment
2022-07-14 15:50:14 -07:00
Tim Wojtulewicz
9c482b1373 Merge remote-tracking branch 'amazingpp/topic/amazingpp/pow-bif'
* amazingpp/topic/amazingpp/pow-bif:
  Add pow function
2022-07-14 11:08:48 -07:00
Tim Wojtulewicz
cae104d135 Merge remote-tracking branch 'origin/topic/timw/2258-skip-dns-tests'
* origin/topic/timw/2258-skip-dns-tests:
  GH-2258: Add skip decorator to DNS unit tests
2022-07-14 08:58:08 -07:00
Tim Wojtulewicz
ab51451fc8 Merge remote-tracking branch 'origin/topic/timw/2261-all-analyzers-type'
* origin/topic/timw/2261-all-analyzers-type:
  GH-2261: Fix type used for analyzer_confirmation/violation events
2022-07-14 08:57:45 -07:00
AmazingPP
a76dc6a389 Add pow function 2022-07-14 22:13:34 +08:00
Christian Kreibich
8a4ed58731 Merge branch 'topic/christian/fix-skipped-sqlite-test'
* topic/christian/fix-skipped-sqlite-test:
  Fix requirement check in a logging framework / sqlite btest
2022-07-13 18:17:49 -07:00
zeek-bot
91a99a7409 Update doc submodule [nomail] [skip ci] 2022-07-14 00:53:28 +00:00
Christian Kreibich
8d10cbfb36 Fix requirement check in a logging framework / sqlite btest 2022-07-13 17:20:03 -07:00
Tim Wojtulewicz
ec450147e6 GH-2261: Fix type used for analyzer_confirmation/violation events 2022-07-13 12:50:15 -07:00
Tim Wojtulewicz
47bcd2cbeb GH-2258: Add skip decorator to DNS unit tests 2022-07-13 12:33:17 -07:00
Christian Kreibich
48486b4156 Merge branch 'topic/christian/gh-2239-stdin-ctrl-c'
* topic/christian/gh-2239-stdin-ctrl-c:
  Stop signal-masking upon running unit tests
  Pause signal-masking during script parsing
  Add btests to verify Zeek's handling of SIGTERM and reading stdin
  Add procps/procps-ng to several CI Docker images
2022-07-13 11:57:52 -07:00
Tim Wojtulewicz
ed2934d345 Merge remote-tracking branch 'origin/topic/bbannier/format-btest_testing_plugins'
* origin/topic/bbannier/format-btest_testing_plugins:
  Use clang-format for all files in `testing/btest/plugins`.
2022-07-13 11:23:45 -07:00
Tim Wojtulewicz
fc60b1cd33 Merge remote-tracking branch 'origin/topic/timw/696-bytestring-to-float'
* origin/topic/timw/696-bytestring-to-float:
  GH-696: Add bytestring_to_float BIF
2022-07-13 11:11:57 -07:00
Tim Wojtulewicz
7e56605d83 GH-696: Add bytestring_to_float BIF 2022-07-13 10:44:24 -07:00
Benjamin Bannier
489534bd74 Use clang-format for all files in testing/btest/plugins.
This is a fixup commit for dc65b6248c.
2022-07-13 17:58:53 +02:00
Johanna Amann
96a14b39fa Merge remote-tracking branch 'origin/topic/neverlord/gh-2192'
* origin/topic/neverlord/gh-2192:
  Avoid race conditions in broker.ssl-mismatch test
2022-07-13 09:34:43 +01:00
Johanna Amann
3d043cfa12 Merge branch 'update' of https://github.com/leres/zeek
* 'update' of https://github.com/leres/zeek:
  Restore accidently deleted line
  Fix tail -F semantics when want_record=F and add tests for the new features
2022-07-13 09:30:42 +01:00
Craig Leres
6b19e8d310 Restore accidently deleted line 2022-07-12 22:33:53 -07:00
Christian Kreibich
6228a00d8f Bump cmake submodule for test-naming policy fix [skip ci] [nomail] 2022-07-12 18:08:58 -07:00
Craig Leres
44ba9138c2 Fix tail -F semantics when want_record=F and add tests for the new features
While writing a test for the new "tail -F semantics" I found that
the $want_record=F case was broken (errno 25). So instead of opening
/dev/null when the input file is missing change READER_RAW to avoid
I/O until it can be opened.

Add two tests, one for when the event handler is called with a
record and one for when it's called with a string.
2022-07-12 17:57:50 -07:00
Christian Kreibich
b68f9bee61 Management framework: bump cluster testsuite 2022-07-12 17:53:35 -07:00
Christian Kreibich
600ae4ba6b Management framework: undo the testsuite result mask 2022-07-12 17:53:35 -07:00
Christian Kreibich
ffebf99bad Management framework: additional logging tweaks
Ensure the framework's log stream exists prior to using it in zeek_init(), and
use a node-is-live message similar to those in agent and controller also in
launched nodes.
2022-07-12 17:53:35 -07:00