Commit graph

6667 commits

Author SHA1 Message Date
Dominik Charousset
25aadd82ef Use object libraries for subdir libs and plugins 2019-10-31 10:58:51 +01:00
Dominik Charousset
fadaa40e04 Add API documentation to IntrusivePtr 2019-10-30 21:02:06 +01:00
Dominik Charousset
054a4f4612 Rename make{ Counted => _intrusive } 2019-10-30 20:27:57 +01:00
Jon Siwek
62161dcc34 Remove "using namespace std" from header files 2019-10-30 12:26:10 -07:00
Dominik Charousset
21b6159e70 Remove braces around single return statements 2019-10-30 20:25:08 +01:00
Jon Siwek
13a431f9fb Merge branch 'master' of https://github.com/redsand/zeek
- Simplified this to just return result of inet_pton

* 'master' of https://github.com/redsand/zeek:
  adds missing ipv6 support for patricia trie index (white/blacklist) under *nix. only worked for nt before..
2019-10-30 11:03:59 -07:00
Tim Shelton
338e15cc38 adds missing ipv6 support for patricia trie index (white/blacklist) under *nix. only worked for nt before.. 2019-10-30 16:00:18 +00:00
Jon Siwek
9c4e44924f GH-664: fix signature matching for payload-carrying SYN packets
Or more generally, signatures would not work correctly for any case
where the first TCP packet seen contained payload data, regardless of
its TCP flags.
2019-10-29 17:20:08 -07:00
Dominik Charousset
72e15fe4d4 Integrate review feedback 2019-10-29 21:24:56 +01:00
Jon Siwek
7b9a27c96a Merge remote-tracking branch 'origin/topic/johanna/remove-build-unique'
* origin/topic/johanna/remove-build-unique:
  Replace build_unique with make_unique
2019-10-29 09:42:55 -07:00
Dominik Charousset
0f41b063b2 Add and use new IntrusivePt type in Zeek
Manual memory management via Ref/Unref is verbose and prone to error. An
intrusive smart pointer automates the reference counting, makes code
more robust (in particular w.r.t. to exceptions) and reduces boilerplate
code. A big benefit of the intrusive smart pointers for Zeek is that
they can co-exist with the manual memory management. Rather than having
to port the entire code base at once, we can migrate components
one-by-one. In this first step, we add the new template
`IntrusivePtr<T>` and start using it in the Broker Manager. This makes
the previous `unref_guard` obsolete.
2019-10-29 16:49:27 +01:00
Johanna Amann
e2a8dd4db1 Replace build_unique with make_unique
This was a rarely used convenience function from when we did not yet
have c++17 support.
2019-10-29 11:50:30 +01:00
Johanna Amann
ff612876c5 Revert "Fix compilation on OS-X."
This reverts commit cde28074a1.

We now have a c++14 compiler.

Fixes GH-626
2019-10-29 11:42:45 +01:00
Johanna Amann
44086c1f03 Merge remote-tracking branch 'origin/topic/jsiwek/gh-654-coerce-unspecified-table-defaults'
* origin/topic/jsiwek/gh-654-coerce-unspecified-table-defaults:
  GH-654: allow table() in function &default expressions
  GH-654: allow table() in record &default expressions

Fixes GH-654
2019-10-28 20:59:39 +01:00
Keith J. Jones
05788a2c02 Fix up some documentation. 2019-10-28 09:29:35 -04:00
Arne Welzel
9b881a1e6f Free memory allocated by glob() in plugin/Manager 2019-10-27 10:23:17 +01:00
Arne Welzel
9e5e7084e6 Remove always false condition in plugin/Manager
`((m->second + "/").empty())` always evaluates to false. Combine
it with the previously check.
2019-10-27 10:23:15 +01:00
Jon Siwek
b698c5507a GH-654: allow table() in function &default expressions
Table parameters of functions previously did not coerce unspecified
tables used in their &default attribute to the correct type.
2019-10-25 13:00:46 -07:00
Jon Siwek
34bf78984b GH-654: allow table() in record &default expressions
Table fields of records previously did not coerce unspecified tables
used in their &default attribute to the correct type.
2019-10-25 12:48:52 -07:00
Jon Siwek
691fd5c9a4 Change usage of old bro:see directive to zeek:see 2019-10-25 10:42:05 -07:00
Jon Siwek
cf05b1d7dc Merge branch 'fix-typo' of https://github.com/keithjjones/zeek
* 'fix-typo' of https://github.com/keithjjones/zeek:
  Fixed typo.
2019-10-25 10:13:14 -07:00
Keith J. Jones
67499979c8 Fixed typo. 2019-10-25 10:33:20 -04:00
Jon Siwek
29f386e388 Implement minimal supervised cluster configuration
More aspects of the cluster configuration to get fleshed out later,
but a basic cluster like one would use for a live deployment
can now be instantiated and run under supervision.  The new
clusterized-pcap-processing supervisor mode is also not done yet.
2019-10-23 17:37:53 -07:00
Jon Siwek
e2bc662fbb Updating submodule(s).
[nomail]
2019-10-23 09:18:10 -07:00
Jon Siwek
de93a060e5 Improve supervisor signal handling 2019-10-20 08:00:10 -07:00
Jon Siwek
773b39e52e Finish implementing supervisor infrastructure
The process hierarchy and all supervisor control commands are now
working (e.g. status, create, destroy, restart), but nodes are
not currently spawned with the desired configuration parameters so
they don't yet operate as real cluster nodes (e.g. worker, logger,
manager, proxy).
2019-10-18 17:57:20 -07:00
Jon Siwek
2bc533f762 Add shutdown logic for intermediate supervisor stem process
To kill/wait on the supervised leaf nodes before exiting.
2019-10-18 14:28:54 -07:00
Jon Siwek
0180d47c5a Add backoff logic to supervisor node revival 2019-10-18 13:10:35 -07:00
Jon Siwek
0d0fe4d1cc Add auto-revival of supervisor leaf nodes 2019-10-18 12:21:21 -07:00
Jon Siwek
573e127672 Add supervisor node creation 2019-10-16 20:10:25 -07:00
Jon Siwek
7c08488dfc Add skeleton logic for handling supevisor control messages 2019-10-16 15:13:15 -07:00
Jon Siwek
4bf3c6ff22 Improve &default validation for global vars: exclude sets 2019-10-15 18:24:35 -07:00
Jon Siwek
1a0a2f16ce Remove check for redundant attributes
Letting there be redundant attributes serves no purpose.  It could
also potentially cause long attribute lists containing many useless
&redef or &optional attributes (e.g. think that may happen if you
use redef enough times and the new attributes keep getting merged
into the old ones).
2019-10-15 17:45:59 -07:00
Johanna Amann
5265613a9e Merge remote-tracking branch 'origin/topic/jsiwek/gh-618-tcp-option-values'
* origin/topic/jsiwek/gh-618-tcp-option-values:
  Add weirds for invalid TCP option lengths
  GH-618: add "tcp_options" event containing TCP option values
  Fix tcp_option event
2019-10-15 16:50:43 -07:00
Jon Siwek
84754bad05 Add weirds for invalid TCP option lengths 2019-10-15 14:28:14 -07:00
Jon Siwek
e46cf88435 Add Supervisor BIF/event API skeleton 2019-10-15 12:59:45 -07:00
Johanna Amann
f62a51b41b Merge remote-tracking branch 'origin/topic/jsiwek/fix-table-default-redef'
* origin/topic/jsiwek/fix-table-default-redef:
  Fix redef'ing a table with a new &default attribute
2019-10-14 22:06:35 -07:00
Johanna Amann
66effde97d Merge remote-tracking branch 'origin/topic/seth/624'
* origin/topic/seth/624:
  Support whitespace at end of line for config reader.

This merge fixes a failing test; it also sprinkles a few more spaces
into another test file.

The main change is that this now also works with configuration lines
that don't have a value.
2019-10-14 21:47:59 -07:00
Johanna Amann
705210a035 Merge remote-tracking branch 'origin/topic/dev/bugrpone-narrowing-conversions-base64'
* origin/topic/dev/bugrpone-narrowing-conversions-base64:
  Proof of Concept on Bugprone Narrowing Conversions: Base64

I fixed a few bugs in this while merging; Decode now signals success or
error (which did not work before). I removed the new variables in
mime.cc and just switched more to size_t - the new variables introduced
a bug because they shadowed the changes of the Decode call.

GH-616
2019-10-14 20:19:02 -07:00
Seth Hall
cd06cb24cc Support whitespace at end of line for config reader.
This commit addresses issue #624
2019-10-14 11:43:16 -04:00
Jon Siwek
42b6040952 Fix redef'ing a table with a new &default attribute 2019-10-11 18:57:03 -07:00
Johanna Amann
916205e254 Merge remote-tracking branch 'origin/topic/jsiwek/print-raw-bif'
* origin/topic/jsiwek/print-raw-bif:
  Add new BIF: print_raw()
2019-10-08 15:15:55 -07:00
Johanna Amann
cde28074a1 Fix compilation on OS-X.
OS X complains about std::pair not having a constexpr constructor. Which
seems to be the case for C++11. Hence, let's make it static const for
the moment.

This commit should be reverted when we move to C++17.
2019-10-07 18:52:11 -07:00
Dev Bali
cad6f881eb Proof of Concept on Bugprone Narrowing Conversions: Base64 2019-10-07 12:02:41 -07:00
Johanna Amann
e615d1f4a8 Merge remote-tracking branch 'origin/topic/jsiwek/gh-589-sub-microsecond-printing'
* origin/topic/jsiwek/gh-589-sub-microsecond-printing:
  GH-589: improve printing of sub-microsecond intervals
2019-10-07 10:51:40 -07:00
Jon Siwek
52f7647f25 Add supervisor stem process auto-revival 2019-10-04 13:25:01 -07:00
Jon Siwek
052feacbda GH-618: add "tcp_options" event containing TCP option values 2019-10-03 18:59:02 -07:00
Jon Siwek
222e3ad3ea Fix tcp_option event
It was not being raised in all the cases it should have been due to
an incorrect/unnecessary truncation check.
2019-10-03 17:55:07 -07:00
Jon Siwek
39b06e3cee GH-591: allow Config::set_value() to use empty/unspecified table/sets 2019-10-02 22:13:43 -07:00
Jon Siwek
fd66e7b9f6 GH-591: fix reading set[enum] values from input files 2019-10-02 22:09:16 -07:00