Commit graph

11634 commits

Author SHA1 Message Date
Tim Wojtulewicz
02cef05f93 Rename BroObj to Obj 2020-07-02 16:15:01 -07:00
Tim Wojtulewicz
736a3f53d4 Rename BroString to zeek::String 2020-07-02 16:15:01 -07:00
Tim Wojtulewicz
a2bc42dd93 Move Func up to zeek namespace, rename BroFunc to ScriptFunc 2020-07-02 16:15:01 -07:00
Tim Wojtulewicz
86fdf0eaa9 Mark global val_mgr as deprecated and fix uses of it to use namespaced version 2020-07-02 16:15:00 -07:00
Tim Wojtulewicz
d1814ea1ff Merge remote-tracking branch 'origin/topic/jsiwek/gh-786-fix-incomplete-casts'
* origin/topic/jsiwek/gh-786-fix-incomplete-casts:
  GH-786: fix Val::As methods casting incomplete types
  GH-786: fix Stmt::As methods casting incomplete types
  GH-786: fix Expr::As methods casting incomplete types
2020-07-02 15:57:40 -07:00
Jon Siwek
902173a358 GH-786: fix Val::As methods casting incomplete types 2020-07-02 14:55:04 -07:00
Jon Siwek
5cba12444a GH-786: fix Stmt::As methods casting incomplete types 2020-07-02 14:28:28 -07:00
Jon Siwek
c8b6badd54 GH-786: fix Expr::As methods casting incomplete types 2020-07-02 14:23:20 -07:00
Tim Wojtulewicz
3098dd6fbb Minor cleanup items from PR review 2020-07-02 12:55:21 -07:00
Jon Siwek
0ec2ff20c6 Merge remote-tracking branch 'origin/topic/timw/786-typecasting'
* origin/topic/timw/786-typecasting:
  GH-786: Move Type::As methods to cc file so they have type info for casting safely
2020-07-02 11:38:35 -07:00
Tim Wojtulewicz
3d9d3972f1 Update binpac and bifcl submodules with review changes 2020-07-02 11:07:48 -07:00
Johanna Amann
f6251e62a0 BrokerStore<->Zeek tables: allow setting storage location & tests
With this, the basic functionality of &backend seems to be working.

It is not yet integrated with zeekctl, one has to manually specify the
storage location for the sqlite files somewhere when using sqlite.

Usage for memory stores:

global table_to_share: table[string] of count &backend=Broker::MEMORY;

Usage for sqlite stores:

redef Broker::auto_store_db_directory = "[path]";
global table_to_share: table[string] of count &backend=Broker::SQLITE;

In both cases, the cluster should automatically sync to changes done by
any node. When using sqlite, data should also be saved to disk and
re-loaded on startup.
2020-07-01 17:10:43 -07:00
Johanna Amann
a220b02722 BrokerStore<->Zeek tables: &backend works for in-memory stores.
Currently this requires using this with a normal cluster - or sending
messages by yourself.

It, in principle, should also work with SQLITE - but that is a bit
nonsensical without being able to change the storage location.
2020-07-01 16:38:10 -07:00
Jon Siwek
734af6b6d1 Fix a deprecation warning compiling with GCC 2020-07-01 09:58:18 -07:00
Tim Wojtulewicz
ae7a4f7735 GH-786: Move Type::As methods to cc file so they have type info for casting safely 2020-07-01 09:27:55 -07:00
Tim Wojtulewicz
40ecede4ea Move Location to zeek::detail and BroObj to zeek 2020-06-30 21:12:26 -07:00
Tim Wojtulewicz
58c6e10b62 Move BroString to zeek namespace 2020-06-30 21:12:26 -07:00
Tim Wojtulewicz
464efbe66a Move Dictionary/PDict, List/PList, and Queue/PQueue to zeek namespace 2020-06-30 21:12:26 -07:00
Tim Wojtulewicz
4a1e17f4e0 Remove typedef that should have been removed in 3.1 2020-06-30 20:51:58 -07:00
Tim Wojtulewicz
d6f1ea16ac Move Func and associated classes into zeek::detail namespace 2020-06-30 20:51:58 -07:00
Tim Wojtulewicz
937a462e70 Move Frame and Scope to zeek::detail namespace 2020-06-30 20:51:53 -07:00
Tim Wojtulewicz
64332ca22c Move all Val classes to the zeek namespaces 2020-06-30 20:48:09 -07:00
Tim Wojtulewicz
ec9eff0bd5 Use type aliases for IntrusivePtr definitions 2020-06-30 20:37:30 -07:00
Tim Wojtulewicz
f6a251cdac Move deprecation macro to zeek-config.h.in to avoid having to over-include util.h 2020-06-30 20:19:14 -07:00
Tim Wojtulewicz
9364e6a5b7 Move IntrusivePtr and utility methods to the zeek namespace 2020-06-30 20:19:12 -07:00
Jon Siwek
4668378d91 Merge remote-tracking branch 'origin/topic/timw/1032-namespaced-enums'
Merge adjustments:
- Added back in deprecation tag for base_type_no_ref()
- Added back the deprecated plugin::hook_name() function

* origin/topic/timw/1032-namespaced-enums:
  Deprecate plugin::HookType and plugin::component::Type in a different way
  Deprecate init_class and IDScope in another way.
  Deprecate TypeTag and friends in a different way
  Deprecate attr_tag in a different way, rename to AttrTag
2020-06-30 16:55:36 -07:00
Johanna Amann
318a72c303 BrokerStore<->Zeek table - introdude &backend attribute
The &backend attribute allows for a much more convenient way of
interacting with brokerstores. One does not need to create a broker
store anymore - instead all of this is done internally.

The current state of this partially works. This should work fine for
persistence - but clones are currently not yet correctly attached.
2020-06-30 16:33:52 -07:00
Jon Siwek
35fa042fd6 Merge remote-tracking branch 'origin/topic/timw/1034-IndexTypes'
Minor tweaks during merge:
- Remove/default superfluous ~Attributes()
- Added in resize() calls to accompany reserve() of associated vectors

* origin/topic/timw/1034-IndexTypes:
  Revert Attributes::Attrs back to return an attr_list and mark it deprecated
  GH-1034: Revert TypeList::Types() back to return a type_list* and mark it deprecated
2020-06-30 15:56:49 -07:00
Tim Wojtulewicz
b1b1ec5171 Deprecate plugin::HookType and plugin::component::Type in a different way 2020-06-30 13:38:39 -07:00
Tim Wojtulewicz
7ee8e11a8f Deprecate init_class and IDScope in another way.
This also renamed init_class to InitClass for consistency.
2020-06-30 13:06:34 -07:00
Tim Wojtulewicz
361ad8f2f7 Deprecate TypeTag and friends in a different way 2020-06-30 12:48:07 -07:00
Tim Wojtulewicz
a280bfa0b1 Deprecate attr_tag in a different way, rename to AttrTag 2020-06-30 12:47:54 -07:00
Jon Siwek
e85dce7907 Update submodule(s)
[nomail]
2020-06-30 11:32:15 -07:00
Jon Siwek
9f437b19a9 Update submodule(s)
[nomail]
2020-06-30 11:06:21 -07:00
Tim Wojtulewicz
5b8aaf6497 Revert Attributes::Attrs back to return an attr_list and mark it deprecated 2020-06-30 10:39:03 -07:00
Tim Wojtulewicz
e1338cc379 GH-1034: Revert TypeList::Types() back to return a type_list* and mark it deprecated 2020-06-29 17:50:09 -07:00
Johanna Amann
43d2289754 BrokerStore<->Zeek tables: test for clones synchronizing to a master
When a clone attaches to a master, it just gets the diffs sent as
events. Which is neat because it means that we pretty much don't need
any extra code to handle this.
2020-06-29 15:05:39 -07:00
Johanna Amann
a5a51de3c4 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1036-print-log-network-time'
* origin/topic/jsiwek/gh-1036-print-log-network-time:
  GH-1036: change print.log to log network time instead of current

Fixes GH-1036
2020-06-29 19:25:16 +00:00
Jon Siwek
7e28c16dfc Merge remote-tracking branch 'origin/topic/jazoff/conn-polling-memory'
* origin/topic/jazoff/conn-polling-memory:
  reduce memory usage of ConnPolling
2020-06-29 10:25:26 -07:00
Jon Siwek
54d8954c80 GH-1036: change print.log to log network time instead of current 2020-06-26 19:55:09 -07:00
Johanna Amann
b9fe79c697 BrokerStore<->Zeek tables: load persistent tables on startup.
This currently only handles the most basic case, and is not thoroughly
tested.

When initializing a master store, we now check if there already is data
in it. If yes, we load it directly into the zeek table when the store is
created. We assume that this is happening at Zeek startup - and are
supremely evil and just load it synchronously. Which could block
execution for a bit for larger stores.

That being said - this might sidestep other issues that would arise when
doing this async (like scripts already inserting data).

Next step: check if this approach also works for clones.
2020-06-26 17:00:00 -07:00
Justin Azoff
f086928c5c reduce memory usage of ConnPolling
Instead of scheduling the event with the full 'connection' record,
schedule it with the smaller 'conn_id' record.
2020-06-26 18:51:29 -04:00
Johanna Amann
38a3d67643 Merge remote-tracking branch 'origin/master' into topic/johanna/table-changes
* origin/master:
  Fix shadowed variable that breaks lookup_hostname()
  GH-1025: allow copying/cloning of `opaque of Broker::Store`
  Fix "possibly-truncated" compiler warning in BuildJSON snprintf()
  Update submodule(s)
  Fixed some places where tabs became spaces
  Convert to using permissions to check for access to cirrus variables in benchmark script
  Integrate review feedback: improve command-line option redef parsing
  Fix several issues with command-line option redefs
  Remove last_access_time from TableEntryVal.
  Minimize data published for expected FTP data channel analysis
  Stricter checking if we have a dns field on the connection being processed
  Modified the DNS protocol analyzer to add a new parameter to the dns_request event which includes the DNS query in its original case. Added a policy script that will add the original_case to the dns.log file as well. Created new btests to test both.
  Place build file in explicit location for benchmarking to work correctly
  cmake: Make musl support more distro agnostic
  Update highwayhash submodule to upstream.
  GH-998: Fix Reporter::conn_weird() to handle expired connections
2020-06-26 13:52:25 -07:00
Johanna Amann
eb1a408b6a Merge remote-tracking branch 'origin/topic/jsiwek/improve-command-line-option-redefs'
* origin/topic/jsiwek/improve-command-line-option-redefs:
  Integrate review feedback: improve command-line option redef parsing
  Fix several issues with command-line option redefs
2020-06-26 16:27:42 +00:00
Johanna Amann
3adaf2cc12 Merge remote-tracking branch 'origin/topic/jsiwek/fix-build-json-warning'
* origin/topic/jsiwek/fix-build-json-warning:
  Fix "possibly-truncated" compiler warning in BuildJSON snprintf()
2020-06-26 16:25:12 +00:00
Johanna Amann
7eb3156ad0 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1025-fix-data-store-handle-cloning'
* origin/topic/jsiwek/gh-1025-fix-data-store-handle-cloning:
  GH-1025: allow copying/cloning of `opaque of Broker::Store`

Fixes GH-1025
2020-06-26 16:24:39 +00:00
Johanna Amann
77143dd58f Merge remote-tracking branch 'origin/topic/jsiwek/fix-lookup-hostname'
* origin/topic/jsiwek/fix-lookup-hostname:
  Fix shadowed variable that breaks lookup_hostname()
2020-06-26 16:24:08 +00:00
Jon Siwek
00a4865885 Merge branch 'dns-original-query-case' of https://github.com/rvictory/zeek
Changes during merge
- Changed the policy script to use an event handler that behaves
  for like the base script: &priority=5, msg$opcode != early-out,
  no record field existence checks
- Also extended dns_query_reply event with original_query param
- Removed ExtractName overload, and just use default param

* 'dns-original-query-case' of https://github.com/rvictory/zeek:
  Fixed some places where tabs became spaces
  Stricter checking if we have a dns field on the connection being processed
  Modified the DNS protocol analyzer to add a new parameter to the dns_request event which includes the DNS query in its original case. Added a policy script that will add the original_case to the dns.log file as well. Created new btests to test both.
2020-06-26 00:07:02 -07:00
Johanna Amann
b027b69f5d Brokerstore<->Tables: attribute conflicts
Makes some attributes conflict with each other. This also needed the
test to change.

The test is a bit flaky - but I can, for the heck of it, not figure out
why. I am punting that for the future after spending a few hours on it.
2020-06-25 19:28:35 -07:00
Jon Siwek
9473c32b5d Fix shadowed variable that breaks lookup_hostname()
A bug introduced in b62727a7fa
2020-06-25 18:56:00 -07:00