Commit graph

11067 commits

Author SHA1 Message Date
Christian Kreibich
f97a33e14d Fix type clash fatal error with log filters that use $ext_func and $include/$exclude
The logging manager's Manager::TraverseRecord(), called when adding a
log filter to a stream, skipped any fields intoduced by a filter's
$ext_func when such fields weren't mentioned in a $include restriction
or mentioned in an $exclude restriction. This was inconsistent with
Manager::RecordToFilterVals, used when actually writing log entries,
which does include those values.

The result was that the record indices descent in Manager::RecordToFilterVals
expects to find only record values, when in fact only the record
provided by ext_func is present. This leads to type mismatches and
hard Zeek exits like this one:

1300475173.475401 fatal error in zeek/share/zeek//base/init-bare.zeek, line 4810: Val::CONVERTER (string/record) (zeek)

The fix makes ext_func's field additions decisive, meaning the
filter's include/exclude lists don't apply to it. If a user really
wants to override this, they can reset the filter's ext_func back to
our no-op default.

The included btest produces the above error when the fix is not present.
2020-11-10 18:13:16 -08:00
zeek-bot
ee31673154 Update doc submodule [nomail] [skip ci] 2020-11-11 00:32:31 +00:00
Tim Wojtulewicz
8722118935 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1269'
* origin/topic/jsiwek/gh-1269:
  GH-1269: Fix LogAscii::enable_leftover_log_rotation crash in bad dirs
2020-11-10 14:06:10 -07:00
Tim Wojtulewicz
2e57f8487b Merge remote-tracking branch 'origin/topic/jsiwek/ci-debian-10-gcc'
* origin/topic/jsiwek/ci-debian-10-gcc:
  Change Debian 10 CI config to use GCC
2020-11-10 13:55:53 -07:00
Tim Wojtulewicz
45167953b3 Update external testing repo hashes for canonification updates 2020-11-10 09:02:30 -07:00
Tim Wojtulewicz
ad46a8b717 Merge remote-tracking branch 'origin/topic/timw/1221-unknown-protocols'
* origin/topic/timw/1221-unknown-protocols:
  GH-1221: Add unknown_protocols.log for logging packet analyzer lookup failures
  Remove default_analyzer for Ethernet packet analzyer
2020-11-10 08:42:26 -07:00
Tim Wojtulewicz
c3cf36e135 GH-1221: Add unknown_protocols.log for logging packet analyzer lookup failures 2020-11-09 20:37:26 -07:00
Tim Wojtulewicz
efe42bc67b Remove default_analyzer for Ethernet packet analzyer 2020-11-09 19:54:45 -07:00
Jon Siwek
04a02d979f Change Debian 10 CI config to use GCC 2020-11-09 16:29:27 -08:00
Jon Siwek
721b232d94 Merge remote-tracking branch 'origin/topic/christian/ci-refresh'
* origin/topic/christian/ci-refresh:
  Add CI support for Debian 10, Fedora 31 & 33, FreeBSD 11, Ubuntu 20.04
2020-11-09 16:28:05 -08:00
Christian Kreibich
13ecafd687 Add CI support for Debian 10, Fedora 31 & 33, FreeBSD 11, Ubuntu 20.04
This also adds two environment variables to the Dockerfiles for the
Debian/Ubuntu flavors to avoid stalling on user input when configuring
tzdata.
2020-11-09 14:04:37 -08:00
Tim Wojtulewicz
9fc4f6c2fa Merge remote-tracking branch 'origin/topic/timw/1186-pkt-hdr-size'
* origin/topic/timw/1186-pkt-hdr-size:
  Remove now-unused Packet::l2_valid field
  GH-1186: Remove Packet::hdr_size and uses of it.
2020-11-09 10:56:22 -07:00
Tim Wojtulewicz
04dbc8e8be Remove now-unused Packet::l2_valid field 2020-11-09 10:49:57 -07:00
Tim Wojtulewicz
b3eb63c48a GH-1186: Remove Packet::hdr_size and uses of it.
This change also removes Packet::IP(), since Packet now contains an ip_hdr member
that points at the IP header if it exists.
2020-11-09 10:49:57 -07:00
Jon Siwek
0eb6839dae GH-1269: Fix LogAscii::enable_leftover_log_rotation crash in bad dirs
Running with that option enabled inside a bad directory (e.g. lack of
permissions) crashed due to not checking for failure of opendir().
2020-11-06 19:28:45 -08:00
Jon Siwek
8337b4cf2d Merge remote-tracking branch 'origin/topic/jsiwek/rename-files-with-colons' into master
* origin/topic/jsiwek/rename-files-with-colons:
  GH-1252: rename files with colons for Windows compatibility
2020-11-04 10:42:22 -08:00
Jon Siwek
b7bd87d9cf GH-1252: rename files with colons for Windows compatibility
A short-term measure so that the Zeek source tree can simply exist on a
Windows filesystem.  For true support, the logic that decides/generates
the filename format will need to change.
2020-11-04 10:29:52 -08:00
Jon Siwek
218c24f55b Update submodule(s) [nomail] [skip ci] 2020-11-03 16:22:48 -08:00
Jon Siwek
47725c35b7 Update submodule(s) [nomail] 2020-11-02 14:54:36 -08:00
Tim Wojtulewicz
3e16b5fde3 Add missing include to fix build on certain platforms 2020-11-02 22:01:20 +00:00
Tim Wojtulewicz
1f02bd5147 Use std::function instead of a function pointer in packet_analysis::Component 2020-11-02 13:05:05 -07:00
Tim Wojtulewicz
43f7b3beab Merge remote-tracking branch 'origin/topic/timw/1215-analyzer-registration'
* origin/topic/timw/1215-analyzer-registration:
  GH-1215: Remove dispatch_map from packet analysis, replace with BIF methods for registering dispatches
2020-11-02 12:04:05 -07:00
Tim Wojtulewicz
cd06bf34c7 GH-1215: Remove dispatch_map from packet analysis, replace with BIF methods for registering dispatches 2020-11-02 19:03:25 +00:00
Jon Siwek
95fd2382bc Merge remote-tracking branch 'origin/topic/timw/1256-strerror'
* origin/topic/timw/1256-strerror:
  GH-1256: Write out strerror when writing errno during safe_write
2020-11-02 09:51:27 -08:00
Tim Wojtulewicz
72ccaee4d5 GH-1256: Write out strerror when writing errno during safe_write 2020-10-30 15:45:32 -07:00
zeek-bot
43821a8957 Update doc submodule [nomail] [skip ci] 2020-10-28 00:40:40 +00:00
Duffy O'Craven
b32eba579d updated to mention notice_alarm.log by name. That has taken the place of the file formerly named alarm.log 2020-10-27 13:56:30 -07:00
zeek-bot
8fb1d4118b Update doc submodule [nomail] [skip ci] 2020-10-27 00:35:52 +00:00
Tim Wojtulewicz
008cdef712 Merge remote-tracking branch 'origin/topic/jsiwek/better-zeekygen-redef-info'
* origin/topic/jsiwek/better-zeekygen-redef-info:
  Improve how Zeekygen generated record/enum redefinition docs
2020-10-26 11:04:17 -07:00
Tim Wojtulewicz
75caf60990 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1245-tld-validity'
* origin/topic/jsiwek/gh-1245-tld-validity:
  GH-1245: require TLD of hostname literals to start with a letter
2020-10-26 10:42:15 -07:00
Tim Wojtulewicz
5ee06d8535 Merge remote-tracking branch 'origin/topic/timw/1116-coveralls'
* origin/topic/timw/1116-coveralls:
  Add coveralls badge to README.md
  Remove the entire auxil directory from the results
  Prevent non-master builds, add cirrus information to upload
  Add support for sending data to coveralls with lcov_html.sh via Cirrus
2020-10-23 14:48:15 -07:00
Jon Siwek
fb85a19fa8 GH-1245: require TLD of hostname literals to start with a letter 2020-10-23 14:17:10 -07:00
Tim Wojtulewicz
b248a56a2d Add coveralls badge to README.md 2020-10-23 19:58:02 +00:00
Tim Wojtulewicz
56c1eea5d3 Remove the entire auxil directory from the results 2020-10-23 19:44:51 +00:00
Jon Siwek
06191390c3 Merge remote-tracking branch 'origin/topic/jsiwek/gh-251-revert-absolute-value-coercion'
* origin/topic/jsiwek/gh-251-revert-absolute-value-coercion:
  GH-251 (revert): remove coercion-to-signed-integer for |x| expressions
2020-10-23 12:26:07 -07:00
Jon Siwek
73c1af838c GH-251 (revert): remove coercion-to-signed-integer for |x| expressions
For `|x|`, where `x` is an expression with an integral result, an
implicit coercion of that result into signed `int` type no longer takes
place.

This was actually the behavior before Zeek 3.0 as well, but the attempt
to prevent mistakes that easily result from integer literals in Zeek
being unsigned like `|5 - 9|` causing an overflow/wraparound and
yielding a very large number is not generally consistent since overflows
are still generally able to happen in other ways and also in other
contexts besides just absolute-values.  So the preference was to revert
to a behavior that favors consistency.  For reference, see
https://github.com/zeek/zeek/pull/251#issuecomment-713956976
2020-10-22 17:41:53 -07:00
zeek-bot
eec55a2143 Update doc submodule [nomail] [skip ci] 2020-10-23 00:37:11 +00:00
Seth Hall
22ef67888c Merge branch 'topic/seth/more-ignore-checksum-options'
* topic/seth/more-ignore-checksum-options:
  Fixing how I define const on the Contains method.
  Screwed up a change.
  Changes in response to Johanna's code review.
  Fixed a bug with ICMP checksum validation
  Fixing a test
  Accidentally missed a change.
  Add an option to ignore packets sourced from particular subnets.
2020-10-22 16:01:34 -04:00
Seth Hall
64fde758c1 Fixing how I define const on the Contains method.
One day I'll actually learn c++!
2020-10-22 13:30:30 -04:00
Seth Hall
61ede5db2f Screwed up a change. 2020-10-22 13:30:30 -04:00
Seth Hall
56e234a762 Changes in response to Johanna's code review. 2020-10-22 13:30:30 -04:00
Seth Hall
2f05318a08 Fixed a bug with ICMP checksum validation 2020-10-22 13:30:30 -04:00
Seth Hall
fe94249ad3 Fixing a test 2020-10-22 13:30:30 -04:00
Seth Hall
69bbcfedb3 Accidentally missed a change. 2020-10-22 13:23:10 -04:00
Seth Hall
552a24e07c Add an option to ignore packets sourced from particular subnets.
It's implemented with a new set[subnet] option named ignore_checksums_nets.

If you populate this set with subnets, any packet with a src address within
that set of subnets will not have it's checksum validated.
2020-10-22 13:23:10 -04:00
Tim Wojtulewicz
2c9c55b058 Prevent non-master builds, add cirrus information to upload 2020-10-22 00:56:20 +00:00
Jon Siwek
e4df60c51d Update submodule(s) [nomail] 2020-10-21 15:38:39 -07:00
Tim Wojtulewicz
e2053551cd Add support for sending data to coveralls with lcov_html.sh via Cirrus 2020-10-21 21:55:30 +00:00
Tim Wojtulewicz
e70f578621 Merge remote-tracking branch 'origin/topic/timw/coverity'
* origin/topic/timw/coverity:
  Fix a couple of Coverity findings (1433618, 1433619)
2020-10-21 11:06:39 -07:00
Tim Wojtulewicz
ce2b00fe83 Fix a couple of Coverity findings (1433618, 1433619) 2020-10-21 10:53:34 -07:00