Commit graph

15378 commits

Author SHA1 Message Date
zeek-bot
85e8d17887 Update doc submodule [nomail] [skip ci] 2022-08-03 00:42:36 +00:00
Arne Welzel
866f8269ab input/config: Use thread-safe Fmt() rather than util::fmt() for regex formatting
Calling util::fmt() from DoUpdate() of a thread is not safe as it is
using a statically allocated buffer and other threads or the main
thread may concurrently modify this buffer.

This was found by observing the scripts.base.frameworks.config.several-files
failing once in a blue moon (1/250 sometimes 1/1000 runs) with messages like
"Failed to compile regex: Parenthesis is not closed.":

    scripts.base.frameworks.config.several-files ...
      > btest-bg-run zeek zeek -b %INPUT
      > btest-bg-wait 10
    ... scripts.base.frameworks.config.several-files failed
      % 'btest-bg-wait 10' failed unexpectedly (exit code 1)
      % cat .stderr
      The following processes did not terminate:
      zeek -b /home/awelzel/corelight-oss/zeek/testing/btest/.tmp/scripts.base.frameworks.config.several-files/several-files.zeek
      -----------
      <<< [3667265] zeek -b /home/awelzel/corelight-oss/zeek/testing/btest/.tmp/scripts.base.frameworks.config.several-files/several-files.zeek
      error: ../configfile1/Input::READER_CONFIG: Failed to compile regex: Parenthesis is not closed.
      received termination signal
      >>>
2022-08-02 21:43:03 +02:00
Tim Wojtulewicz
c82eb13cc8 Merge remote-tracking branch 'pbcullen/topic/pbcullen/prevent-large-dhcp-logs'
* pbcullen/topic/pbcullen/prevent-large-dhcp-logs:
  Update plugins.hooks baseline with new DHCP options
  Prevent large dhcp log entries
2022-08-02 12:38:03 -07:00
Vern Paxson
ea3d25b380 canonicalize filenames for new vector deprecation btest 2022-08-02 12:37:33 -07:00
Tim Wojtulewicz
2cba2415fd Merge remote-tracking branch 'origin/topic/timw/1129-slash-s-patterns'
* origin/topic/timw/1129-slash-s-patterns:
  Add support for /s modifier to RE matcher and parser
  Code cleanup in RE_Matcher code
  Add basic unit tests for RE_Matcher
  Add /s modifier to parser for patterns
2022-08-02 11:33:35 -07:00
Tim Wojtulewicz
18126c2d50 Add support for /s modifier to RE matcher and parser 2022-08-02 11:31:57 -07:00
Tim Wojtulewicz
f67f6e4507 Code cleanup in RE_Matcher code
- Use std::string in Specific_RE_Matcher instead of char*
- Change a couple of ints-as-bools to bools
2022-08-02 11:31:57 -07:00
Tim Wojtulewicz
abf2da781d Add basic unit tests for RE_Matcher 2022-08-02 11:31:57 -07:00
Tim Wojtulewicz
36e31e28ac Add /s modifier to parser for patterns 2022-08-02 11:31:57 -07:00
Tim Wojtulewicz
14e48733ac Update gen-zam submodule [nomail] 2022-08-02 10:43:52 -07:00
Fatema BW
660278be1f
Update src/packet_analysis/protocol/tcp/TCPSessionAdapter.cc
Co-authored-by: Robin Sommer <robin@icir.org>
2022-08-02 10:02:32 -07:00
Fatema BW
1348b739ab
Updating the weird names to use all lower case 2022-08-02 10:01:31 -07:00
Fatema BW
5ffeb657a5
Fixing whitespaces.. 2022-08-02 09:59:34 -07:00
AmazingPP
2c4449e19a Use json_escape_utf8 in broker debug output 2022-08-02 21:11:40 +08:00
peter.cullen
d93eb0b002 Update plugins.hooks baseline with new DHCP options 2022-08-02 11:42:04 +00:00
Vern Paxson
7a41170a59 updates for gen-C++ maintenance, including skipping some inappropriate tests 2022-08-01 16:47:17 -07:00
Vern Paxson
c034dc68ed fix for profiling "when" statements 2022-08-01 13:36:24 -07:00
Vern Paxson
1bbf345e46 gen-C++ support for vector bit-shift operations 2022-08-01 10:26:26 -07:00
Tim Wojtulewicz
6fd0645aef Merge branch 'topic/timw/1344-illegal-base-type'
* topic/timw/1344-illegal-base-type:
  GH-1344: Give better warning when using a type that doesn't exist
2022-08-01 09:57:05 -07:00
Vern Paxson
8640430920 corrected wording in some btest comments 2022-07-31 15:06:02 -07:00
Vern Paxson
f912ac06ff make gen-C++ maintenance scripts directly executable 2022-07-31 11:31:01 -07:00
Vern Paxson
f535a7c3a7 ZAM support for bit-shifting 2022-07-30 18:33:57 -07:00
Vern Paxson
99e265bf87 don't allow deprecated-style mixing of vectors and scaling for shifting
leverage restrictions placed on shifting (RHS is always unsigned)
split deprecated vector operations into separate test, with separate ZAM baseline
2022-07-30 18:17:22 -07:00
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