Commit graph

16055 commits

Author SHA1 Message Date
Vern Paxson
6185d1c389 ZAM fix for vector "in" operator 2022-07-30 18:17:13 -07:00
Vern Paxson
5569d81953 ensure that language tests pay attention to .stderr 2022-07-29 21:30:40 -07:00
Vern Paxson
8d3265d540 fix vector tests, including checking for errors 2022-07-29 21:26:02 -07:00
Tim Wojtulewicz
8e4017f781 GH-1344: Give better warning when using a type that doesn't exist 2022-07-29 12:38:25 -07:00
Tim Wojtulewicz
6d16f9bb42 Merge remote-tracking branch 'origin/topic/timw/bit-shift-error-handling'
* origin/topic/timw/bit-shift-error-handling:
  Add btest for vector bit-shift operators
  Handle error cases for bit-shift operators more cleanly
2022-07-29 12:10:27 -07:00
Tim Wojtulewicz
25b49bf6ea Merge remote-tracking branch 'origin/topic/timw/clang-format-patricia'
* origin/topic/timw/clang-format-patricia:
  Update 3rdparty submodule to get patricia reformat
2022-07-29 12:01:07 -07:00
Tim Wojtulewicz
cfd977c4dd Update 3rdparty submodule to get patricia reformat 2022-07-29 11:21:13 -07:00
Arne Welzel
07f1895925 testing/missing-enum-value: redef exit_only_after_terminate=T
Seems this was the intention all along as the corresponding terminate()
call is there.
2022-07-29 18:22:03 +02:00
Arne Welzel
11cde53373 option.bif: Short-circuit option changes when terminating
Due to the asynchronous behavior of the input framework and broker
communication, change handlers were previously called even after
zeek_done() event processing completed and also broker shutdown.

Accessing broker store handles within change handlers this late
triggered invalid Broker store handle messages:

    error in ././my_option_store.zeek, line 13: invalid Broker store handle (Broker::put(Test::store, to_any_coercemy_option, to_any_coerceTest::new_value, 0 secs) and broker::store::{})

Fixes #2010
2022-07-29 18:22:03 +02:00
Fatema BW
33bfe67562
Fixing clang pre-commit error 2022-07-28 23:10:35 -07:00
Fatema BW
e2bd8f0eb1
Add check for option 27 2022-07-28 22:54:59 -07:00
Fatema BW
70b3e28dd9
Add the parsed fields for TCP option 27 2022-07-28 22:53:36 -07:00
Fatema BW
622733c4ba
Add TCP options bad length check 2022-07-28 22:51:15 -07:00
Tim Wojtulewicz
28081d1efa Update 3rdparty submodule [nomail] 2022-07-28 12:12:46 -07:00
Peter Cullen
fb4858d42b Prevent large dhcp log entries
A flood of DHCP traffic can result if very large log entries consisting
of many uids and/or msg_types. Such large log entries can disrupt a SIEM
ingestion pipeline. This change forcing a log entry to be written when
the number of uids or the number of msg_Types exceed a certain value.
The values are treated as options for easy configuration.
2022-07-28 11:34:18 -07:00
Tim Wojtulewicz
c56e895bee Merge remote-tracking branch 'origin/topic/timw/reenable-coverage-upload'
* origin/topic/timw/reenable-coverage-upload:
  Re-enable sending coverage data to Coveralls via Cirrus
2022-07-28 11:22:09 -07:00
Tim Wojtulewicz
2557250c1f Re-enable sending coverage data to Coveralls via Cirrus
This was lost in 903f4bcc8e
2022-07-28 10:38:41 -07:00
Tim Wojtulewicz
d461033978 Update docs submodule 2022-07-28 10:15:43 -07:00
Tim Wojtulewicz
25f88bc394 Add btest for vector bit-shift operators 2022-07-25 11:32:42 -07:00
Tim Wojtulewicz
8fff3c76b9 Handle error cases for bit-shift operators more cleanly 2022-07-25 11:32:42 -07:00
Tim Wojtulewicz
ac4b7f9f02 Merge remote-tracking branch 'origin/topic/timw/2131-no-redef-segfault'
* origin/topic/timw/2131-no-redef-segfault:
  Return an error if redef'ing a variable without redef attribute
2022-07-25 09:43:54 -07:00
Tim Wojtulewicz
00e111135b Return an error if redef'ing a variable without redef attribute 2022-07-25 09:43:19 -07:00
Michael Torres
b85801aa7e Add a field to Modbus/TCP log to indicate the Modbus PDU type
Add the `pdu_type` field to Modbus over TCP logs to indicate whether the Modbus
message was a request or a response. Due to the client/server nature of Modbus
over TCP/IP, all messages from the TCP session originator are requests, while
all messages from the TCP session responder are responses.

Adding this information to the default log surfaces protocol metadata in a way
that doesn't require users to understand the Modbus over TCP protocol.
2022-07-24 02:41:26 +00:00
zeek-bot
86c316ddfc Update doc submodule [nomail] [skip ci] 2022-07-22 00:39:57 +00:00
Tim Wojtulewicz
e700b66828 Merge remote-tracking branch 'origin/topic/timw/1628-duplicate-record-field'
* origin/topic/timw/1628-duplicate-record-field:
  Add comments for specialized versions of util::split
  Make char*/wchar_t* split methods use string_view/wstring_view
  GH-1628: Return an error for duplicate record field names
  Fix a bug with splitting strings in Ascii input reader
  Iterator and looping cleanup in Ascii input reader
  Add util::split methods for splitting strings
2022-07-21 11:54:50 -07:00
Tim Wojtulewicz
871e3465c2 Add comments for specialized versions of util::split 2022-07-21 11:53:47 -07:00
Tim Wojtulewicz
701fc3654a Make char*/wchar_t* split methods use string_view/wstring_view 2022-07-21 11:53:47 -07:00
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