Commit graph

6667 commits

Author SHA1 Message Date
Justin Azoff
665d8b01d2 Fix variable reuse in table expiration
While expiring a table, DoExpire checks at the end to see if NextEntry
returned nothing to determine if it should sleep for the short
table_expire_delay or the long table_expire_interval.

However, the check to see if the expire_func deleted the entry
re-assigns the same variable.  This means that:

  If you have a large table that is behind on expiring values
& The table defines an expire_func
& That expire_func deletes the item
& It so happens that the last item checked in the batch of
table_incremental_step size had expired

then DoExpire will reset the cookie and sleep for table_expire_interval
2019-01-12 16:36:56 -05:00
Robert Clark
a72e9a8126
Tell OpenSSL that MD5 is not used for security in order to allow bro to work properly on a FIPS system 2019-01-11 16:09:42 -05:00
Stu H
9081e976ce Merge branch 'master' into stu-h/erspan 2019-01-11 10:58:42 +00:00
Jon Siwek
b1b7027982 Merge remote-tracking branch 'origin/rtd-test'
* origin/rtd-test:
  Disable RTD pdf format due to exceeded capacity
  Add RTD pdf format
  Add RTD yaml config file
  Remove some Bro usages in main TOC entries
  Remove "contents" Sphinx directive usages
  Add a `make livehtml` target
  Use sourcecode Sphinx directive more widely
  Use Sphinx RTD theme for user manual
  Replace some code-block Sphinx directives
  Remove unused Sphinx extensions
  Remove broxygen Sphinx integration
  Remove Sphinx btest integrations and tests
  Fix a Sphinx deprecation

These are all changes required to build documentation from a static
Sphinx tree (e.g. on Read the Docs)
2019-01-10 14:08:40 -06:00
Jon Siwek
2982765128 Pre-allocate and re-use Vals for bool, int, count, enum and empty string 2019-01-09 18:29:23 -06:00
Stu H
d9533e9616 Implement ERSPAN type II and ERSPAN type III support 2019-01-09 22:51:00 +00:00
Justin Azoff
dcbef9cbe3 Preallocate booleans and small counts
Like PortManager, preallocate Vals for booleans and counts < 4096
2019-01-07 13:40:17 -06:00
Jon Siwek
fc43d06955 GH-227: Improve LibreSSL support 2019-01-07 11:35:17 -06:00
Jon Siwek
e0b8b4b6b1 Replace some bro.org usages with zeek.org 2019-01-04 17:51:25 -06:00
Jon Siwek
15bfdbe952 Merge branch 'master' of https://github.com/hosom/zeek
* 'master' of https://github.com/hosom/zeek:
  Call FatalErrorWithCore instead of FatalError
  Fix syntax error
  Add fatal_error_with_core bif
2019-01-02 11:29:18 -06:00
Jon Siwek
5ebe47ec23 Remove "contents" Sphinx directive usages
Seems redundant: same info is always available in RTD theme's
floating sidebar.
2018-12-19 17:28:17 -06:00
Jon Siwek
288e1722d1 Updating submodule(s).
[nomail]
2018-12-19 09:49:01 -06:00
Stephen Hosom
6be5151291 Call FatalErrorWithCore instead of FatalError
Previously, this bif didn't reference the correct function.
2018-12-19 10:33:41 -05:00
Stephen Hosom
96999f5687 Fix syntax error 2018-12-19 08:58:41 -05:00
Stephen Hosom
2357717e37 Add fatal_error_with_core bif
This patch adds a bif for aborting and obtaining a core file from
script land.
2018-12-19 08:33:04 -05:00
Jon Siwek
7e9d48f532 Remove broxygen Sphinx integration
The broxygen-generated files now live in the git repo, have tests
that check that they are up-to-date, and a script to re-generate
them on-demand.
2018-12-18 10:15:22 -06:00
Jon Siwek
002191ab62 Merge remote-tracking branch 'origin/topic/jsiwek/alpine-support'
* origin/topic/jsiwek/alpine-support:
  Add FTS dependency when building on Alpine
  Remove unnecessary header include
  Improve default DNS resolution support for Alpine/musl
  Add dns_resolver option
2018-12-10 11:55:40 -06:00
Jon Siwek
5249a16384 Update submodules to use github.com/zeek 2018-12-06 13:20:34 -06:00
Jon Siwek
f266e08d04 Remove unnecessary header include 2018-11-30 19:28:23 -06:00
Jon Siwek
206f12467a Improve default DNS resolution support for Alpine/musl
On Alpine (musl libc), /etc/resolv.conf now gets parsed for the first
IPv4 nameserver that works.

Addresses GH-216
2018-11-30 19:26:04 -06:00
Jon Siwek
af82e87699 Add dns_resolver option
This allows one to configure the address of the DNS server to use for
lookup operations.

Addresses GH-216
2018-11-30 16:59:45 -06:00
Jon Siwek
28a2964e38 Merge remote-tracking branch 'origin/dev/2.7'
* origin/dev/2.7:
  Improve introspection of Record and TypeType values
  Bro plugins should support a patch version (x.y.z)
  GH-148: add priority to DNSSEC event handlers
  DNSSEC support in Bro
2018-11-29 16:44:50 -06:00
Jon Siwek
6af68638de GH-218: Add missing ICMP router advertisement counterpart 2018-11-22 07:58:41 -06:00
Jon Siwek
635e030be2 Merge remote-tracking branch 'origin/master' into dev/2.7
* origin/master:
  Fix SumStats "last" plugin in cluster mode
  Remove unnessary check
  Support appending to vector of any
  Fix coding conventions nits/typos
  Updating submodule(s).
  Revert "Switch frag_timeout from redef to option"
  Improve error handling in x509_ocsp_verify function
  Updating submodule(s).
  Updating submodule(s).
  Update baseline for plugins.hooks for redef -> option changes
  Switch frag_timeout from redef to option
  Switch GridFTP options from redef to option
  Updating submodule(s).
  Fix a unit test relying on a bash-ism
2018-11-08 12:43:22 -06:00
Jon Siwek
e3612960ee Merge branch 'topic/bloomfilter-performance-boost' of https://github.com/bro/bro
* 'topic/bloomfilter-performance-boost' of https://github.com/bro/bro:
  Remove unnessary check
2018-11-08 09:41:07 -06:00
Matthias Vallentin
74c6b9f54c Remove unnessary check
The call to Empty() was originally meant as an optimization in the
lookup phase. However, the performance implications are substantial:
this check operates in O(f(m/8)) where m is the number of bits in the
Bloom filters and f a function that looks for the first non-empty block
of bits.

As the Bloom filter fills up, the check for Empty() becomes no longer
negligible and can lead to serious performance degradations when Bloom
filters are used frequently.
2018-11-07 13:11:15 -08:00
Jon Siwek
ca014d6e35 Support appending to vector of any
For consistency, since it already works to assign to an index within
vector of any.
2018-11-07 11:48:43 -06:00
Jon Siwek
808f1d1524 Fix coding conventions nits/typos 2018-11-07 10:27:43 -06:00
Jon Siwek
2d82fe7e2e Improve error handling in x509_ocsp_verify function 2018-11-05 17:10:21 -06:00
Jon Siwek
7ec480f05d Updating submodule(s).
[nomail]
2018-11-03 10:57:25 -05:00
Jon Siwek
0249ecba4b Merge remote-tracking branch 'origin/master' into dev/2.7
* origin/master:
  Add script-layer call stack to internal errors messages that abort
2018-11-02 17:45:28 -05:00
Jon Siwek
b2560384c4 Add script-layer call stack to internal errors messages that abort 2018-11-02 17:43:34 -05:00
Jon Siwek
b54570aa98 Merge remote-tracking branch 'origin/master' into dev/2.7
* origin/master:
  Improve error message of index assignment expression failures
2018-11-02 16:42:00 -05:00
Jon Siwek
a7ba44089b Improve error message of index assignment expression failures 2018-11-02 16:40:28 -05:00
Jon Siwek
ebd8132063 Merge remote-tracking branch 'origin/master' into dev/2.7
* origin/master: (23 commits)
  Improve Travis script to show multiple core dump stacks
  Improve a weird stats unit test
  Updating submodule(s).
  Fix Travis script typo
  Add more debug output to Travis script
  Add core file search and stack trace output for Travis builds
  Updating submodule(s).
  Update license year for 2018
  GH-199: change `bro --help` exit status from 1 to 0
  Updating submodule(s).
  Add a test with an encrypted MySQL connection
  Fix parsing of MySQL NUL Strings, where we now require it to have a NUL value at the end.
  Updating submodule(s).
  Add missing record field comment
  Add missing record field comments
  Fix minor documentation mistakes
  Updating submodule(s).
  Updating submodule(s).
  Update btest baselines for fix in 46f727a6fa
  Generate ssh_auth_attempted for the 'none' authentication method.
  ...
2018-11-02 14:45:32 -05:00
Jon Siwek
cbaab3d4fa GH-199: change bro --help exit status from 1 to 0
Fixes #199
2018-10-31 22:28:38 -05:00
Jon Siwek
6e3ff156e0 Updating submodule(s).
[nomail]
2018-10-31 18:52:27 -05:00
Jon Siwek
8c02aa5211 Merge remote-tracking branch 'origin/topic/vladg/mysql_nul_string_fix'
* origin/topic/vladg/mysql_nul_string_fix:
  Add a test with an encrypted MySQL connection
  Fix parsing of MySQL NUL Strings, where we now require it to have a NUL value at the end.
2018-10-30 10:00:39 -05:00
Vlad Grigorescu
6144ac536f Fix parsing of MySQL NUL Strings, where we now require it to have a NUL value at the end.
We don't pass that NUL to the script layer, so we moved away from bytestring_to_val for those.
2018-10-29 15:56:51 -05:00
Jon Siwek
80c7f3f4e2 Updating submodule(s).
[nomail]
2018-10-29 14:06:56 -05:00
Vlad Grigorescu
46f727a6fa Generate ssh_auth_attempted for the 'none' authentication method.
ssh_auth_attempted sets some requisite fields that ssh_auth_successful
relies on. ssh_auth_attempted wasn't getting called because of a logic
error.

For a more complete discussion of this issue, see:
https://github.com/bro/bro/issues/192
2018-10-23 10:35:18 -05:00
Jon Siwek
1f450c0510 Improve introspection of Record and TypeType values
* TypeType values are now printable and yield the type name/alias
* Fix record_fields BIF to return correct type name for fields
* Allow TypeType values that point to a RecordType to be used with
  record_fields BIF
2018-10-18 15:10:02 -05:00
Jon Siwek
45526e6063 Merge remote-tracking branch 'origin/master' into dev/2.7
* origin/master:
  Fix typo in Sessions.h
  Update baselines for SSH capabilities fix
  Fix SSH analyzer bug where is_server in capabilities is wrong.
  Revert DNS query 255 from ANY to *
  Missing commas...
  Fix typo in dce-rpc consts
  Refactor to use consistent numeric type in dce_rpc. Add missing DNS query type codes
  Add DCE_RPC exchange_mapi operations to relevant consts.bro file
  GH-186: fix JSON formatting of timestamps before Unix epoch
  Fix test baseline for plugin skeleton update
  Fix crash when modifying a table from within its &expire_func
  Convert site::local_nets, etc. into options.
  GH-184: add `bro-config --build_type`, outputs CMake build type
  Updating submodule(s).
  Add return value checks for some RPC parsing functions
  Add 'fallthrough' comment to a switch/case block
  Improve broker.remote_id unit test
  Increase broker unit test timeout intervals
2018-10-16 16:50:27 -05:00
Jon Siwek
0a0e2e5363 Merge remote-tracking branch 'origin/topic/vladg/ssh_is_server_fix'
* origin/topic/vladg/ssh_is_server_fix:
  Update baselines for SSH capabilities fix
  Fix SSH analyzer bug where is_server in capabilities is wrong.
2018-10-16 13:42:24 -05:00
Johanna Amann
b682782024 Fix typo in Sessions.h
Found by Eiji Yanagi (Cisco).
2018-10-16 09:23:43 -07:00
Vlad Grigorescu
1d57cd3727 Fix SSH analyzer bug where is_server in capabilities is wrong.
The ssh_capabilities event includes the capabilities reported
by either the server or the client. The record also includes a field,
is_server, so that scripts can determine which endpoint is reporting
its capabilities. That field was being set incorrectly (it was being
set as is_client rather than is_server, so it needed to be negated).

This simple bug had some larger repercussions. RFC 4253 provides a
method for client and server to agree on algorithms used in the SSH
connection. Bro was calculating these incorrectly. Some of these, such
as the encryption algorithm, are also used to determine whether or not
Bro should attempt to detect successful versus failed
authentications. In some cases, Bro would get this wrong, and make a
guess when it could not correctly determine the authentication outcome.
2018-10-16 10:29:29 -05:00
Jon Siwek
70233148be GH-186: fix JSON formatting of timestamps before Unix epoch 2018-10-12 21:34:28 +00:00
Jon Siwek
8792f5545c Fix crash when modifying a table from within its &expire_func 2018-10-12 08:35:25 -04:00
Jon Siwek
0350004f1e Add return value checks for some RPC parsing functions 2018-10-04 11:33:57 -05:00
Jon Siwek
1be7ac509c Add 'fallthrough' comment to a switch/case block 2018-10-04 11:28:56 -05:00