Commit graph

10798 commits

Author SHA1 Message Date
Tim Wojtulewicz
ed13972924 Move Type types to zeek namespace 2020-06-09 17:20:45 -07:00
Tim Wojtulewicz
70d2f63b3f Review cleanup
- Use sha256 for build file hash
- Use build file hash as part of the data for the HMAC digest
- Remove a few unnecessary lines from the centos8 dockerfile
- Pass timestamp in UTC
2020-06-09 16:40:23 -07:00
Jon Siwek
e924370876 Restrict Cirrus CI to only zeek repo's branches 2020-06-09 15:19:29 -07:00
Jon Siwek
3255930738 Merge remote-tracking branch
* Prevent IP fragment reassembly on packets without minimal IP header
2020-06-09 09:46:46 -07:00
Jon Siwek
97e141bc5d Merge remote-tracking branch
* Fix potential leak of Analyzers added to tree during Analyzer::Done
2020-06-09 09:38:28 -07:00
Jon Siwek
aada21879f Merge remote-tracking branch
* Fix multiple content-transfer-encoding headers causing a memory leak
2020-06-09 09:37:32 -07:00
Jon Siwek
d0d25269c0 Merge remote-tracking branch
* Fix potential stack overflow in NVT analyzer
2020-06-09 09:36:18 -07:00
Jon Siwek
b42a1bd554 Merge remote-tracking branch
* Fix NVT analyzer memory leak from multiple telnet authn name options
2020-06-09 09:24:49 -07:00
Jon Siwek
2000e2a424 GH-977: Improve pcap error handling
Switches from pcap_next() to pcap_next_ex() to better handle all error
conditions.  This allows, for example, to have a non-zero exit code for
a Zeek process that fails to fully process all packets in a pcap file.
2020-06-08 18:11:58 -07:00
Jon Siwek
4f011a65f4 Remove not-useful code in iosource::Manager::OpenPktSrc
It's generally expected for a PktSrc to not be Open yet right after
instantiation, but rather from InitSource() called during the
registration process.  Besides that, the logic in question would
potentially replace an error message that is useful/detailed with one
that is not.
2020-06-08 18:02:44 -07:00
Johanna Amann
c4ebd7640d Merge remote-tracking branch 'origin/topic/jsiwek/gh-999-dhcp-client-id-hw0'
* origin/topic/jsiwek/gh-999-dhcp-client-id-hw0:
  GH-999: Stop formatting DHCP Client ID Hardware Type 0 as MAC

Fixes GH-999
2020-06-08 22:32:01 +00:00
Jon Siwek
96f7226b52 GH-999: Stop formatting DHCP Client ID Hardware Type 0 as MAC
For `DHCP::ClientID$hwtype` fields equal to 0, the `hwaddr` field is
no longer misformatted as a MAC and instead just contains the raw bytes
seen in the DHCP Client ID Option.
2020-06-08 11:43:07 -07:00
Jon Siwek
02476453bc Merge remote-tracking branch 'origin/topic/jsiwek/fix-coverity-build'
* origin/topic/jsiwek/fix-coverity-build:
  Remove inline from some static KeyedHash members
  Improve Func.h inclusion
2020-06-08 11:23:24 -07:00
Jon Siwek
d80cf203b7 Merge remote-tracking branch 'origin/topic/jsiwek/rename-aux'
* origin/topic/jsiwek/rename-aux:
  Rename aux/ to auxil/
2020-06-08 11:17:26 -07:00
Jon Siwek
8561c79363 Remove inline from some static KeyedHash members
Coverity Scan builds currently encounter catastrophic error, claiming
alignas requires use on both declaration and definition, so appears to
actually not understand "static inline" in combo with alignas.
2020-06-05 18:20:05 -07:00
Jon Siwek
2893eea045 Improve Func.h inclusion
Now forward declares some Broker types since Broker/CAF headers
generally slow things down and also Coverity Scan currently has a
catastrophic error on some CAF headers.

Also a few other changes to EventHandler/BifReturnVal to reduce number
of places that depend on Func.h.
2020-06-05 17:57:42 -07:00
Johanna Amann
65c12ba6e9 Zeek/Brokerstore updates: first working end-to-end test
This commit fixes a few more loose ends to actually make the
Zeek Table<->brokerstore syncing work. This mostly slightly changes the
TableVal assign/remove operators to prevent loops when a remote change
arrives.

The tests inserts a value into a table on the manager, and it pops out
in a table on a clone - which is the easiest case.

Timeouts are still not handled at all; the behavior when inserting into
a clone is untested.
2020-06-05 16:17:05 -07:00
Johanna Amann
62f208086c Update to recent broker changes.
Specifically the store name is now part of the messages.
2020-06-05 14:33:45 -07:00
Johanna Amann
9d9aefaec3 Merge remote-tracking branch 'origin/master' into topic/johanna/table-changes
* origin/master:
  Fix use-after-move of proc_status_file breaking -U flag
  Change Cirrus CI config to use org-level secured variable
  Deprecate Val(double, TypeTag) ctor, add TimeVal/DoubleVal subclasses
  GH-973: Fix the return type of topk_get_top()
2020-06-05 14:29:14 -07:00
Jon Siwek
e532335f97 Fix NVT analyzer memory leak from multiple telnet authn name options
Credit to OSS-Fuzz for discovery
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23069
2020-06-04 16:54:08 -07:00
Jon Siwek
23ad81400b Rename aux/ to auxil/
Since "aux" is not an allowed file/dir name on Windows.
2020-06-04 15:18:44 -07:00
Jon Siwek
ef6bd3ee39 Fix use-after-move of proc_status_file breaking -U flag 2020-06-04 15:13:10 -07:00
Jon Siwek
88654fa989 Change Cirrus CI config to use org-level secured variable 2020-06-04 10:54:06 -07:00
Johanna Amann
f080c8c294 Broker changes: adopt to recent IntrusivePtr API changes 2020-06-03 16:48:16 -07:00
Johanna Amann
d9de6c4522 Merge remote-tracking branch 'origin/master' into topic/johanna/table-changes
* origin/master: (172 commits)
  GH-985: Fix descriptions of double_to_interval() return values
  Decrease number of CPUs/memory for Cirrus CI tasks
  Change CI script to compile from build/Makefile
  Add missing include in util.cc
  Remove Analyzer.h from bro-bif.h
  Remove IPAddr.h from Reporter.h
  Remove the inclusion of Func.h from NetVar.h, which reduces the inclusion of Func.h overall.
  Update submodule(s)
  Update submodule(s)
  Integrate review feedback
  Update submodule(s)
  Fix crash on using some deprecated environment variables
  Update NEWS
  Update test baselines for new Broker connection status/error strings
  Switch Broker Val converter visitor to return IntrusivePtr
  Change BroFunc ctor to take const-ref IntrusivePtr<ID>
  Add version of Frame::SetElement() taking IntrusivePtr<ID>
  Change Scope/Func inits from id_list* to vector<IntrusivePtr<ID>>
  Change Scope::GenerateTemporary() to return IntrusivePtr
  Deprecate Scope::ReturnType(), replace with GetReturnType()
  ...
2020-06-03 16:09:42 -07:00
Tim Wojtulewicz
4a1b39a2be Move Flare/Pipe from the bro namespace to zeek::detail 2020-06-03 15:16:19 -07:00
Tim Wojtulewicz
60ed29c3b6 Move Attr to the zeek::detail namespace 2020-06-03 15:16:19 -07:00
Tim Wojtulewicz
54233ce596 Move Trigger into the zeek::detail namespace 2020-06-03 15:16:19 -07:00
Tim Wojtulewicz
0d623d003c Move ID to the zeek::detail namespace 2020-06-03 15:16:19 -07:00
Tim Wojtulewicz
9992ec5c11 Move Anon.h into zeek::detail namespace 2020-06-03 15:16:19 -07:00
Tim Wojtulewicz
7a5dae4354 Mark all of the aliased classes in plugin/Plugin.h deprecated, and fix all of the plugins that were using them 2020-06-03 15:16:18 -07:00
Tim Wojtulewicz
e77e8c4b7b Move all of the base plugin classes into the zeek::plugin namespace 2020-06-03 15:16:18 -07:00
Tim Wojtulewicz
cbdb8ee074 Expr: move all classes into zeek::detail 2020-06-03 15:16:18 -07:00
Tim Wojtulewicz
3fa4acc175 Stmt: move Stmt classes into zeek::detail namespace 2020-06-03 13:37:57 -07:00
Tim Wojtulewicz
f952acaddc Add utility macro for creating namespaced aliases for classes 2020-06-03 13:37:56 -07:00
Tim Wojtulewicz
b4aa5d9456 Merge remote-tracking branch 'origin/topic/jsiwek/gh-973-fix-topk-get-top-return-type'
* origin/topic/jsiwek/gh-973-fix-topk-get-top-return-type:
  GH-973: Fix the return type of topk_get_top()
2020-06-03 13:29:31 -07:00
Tim Wojtulewicz
640ad2d010 Merge remote-tracking branch 'origin/topic/jsiwek/double-val-subclasses'
* origin/topic/jsiwek/double-val-subclasses:
  Deprecate Val(double, TypeTag) ctor, add TimeVal/DoubleVal subclasses
2020-06-03 13:20:04 -07:00
Jon Siwek
5b4313b593 Deprecate Val(double, TypeTag) ctor, add TimeVal/DoubleVal subclasses
This also updates all usages of the deprecated Val ctor to use
either IntervalVal, TimeVal, or DoubleVal ctors.  The reason for
doing away with the old constructor is that using it with TYPE_INTERVAL
isn't strictly correct since there exists a more specific subclass,
IntervalVal, with overriden ValDescribe() method that ought to be used
to print such values in a more descriptive way.
2020-06-02 23:33:40 -07:00
Jon Siwek
49fc7924e0 GH-973: Fix the return type of topk_get_top()
e.g. when using `string` elements it should return `vector of string`,
not `vector of list of string` like it did before.
2020-06-02 19:42:12 -07:00
Jon Siwek
a431f6b45d Merge remote-tracking branch 'origin/topic/jsiwek/gh-985-double-to-interval-descs'
* origin/topic/jsiwek/gh-985-double-to-interval-descs:
  GH-985: Fix descriptions of double_to_interval() return values
2020-06-02 18:14:20 -07:00
Jon Siwek
e17487e799 GH-985: Fix descriptions of double_to_interval() return values
The BIF was not returning an IntervalVal which has an overriden
ValDescribe() method that allows for prettier printing like "6.0 secs"
instead of just "6.0".
2020-06-02 16:47:11 -07:00
Jon Siwek
7b0931058e Decrease number of CPUs/memory for Cirrus CI tasks
New concurrency limits are 16 Linux CPUs per user rather than 8 Linux
Tasks per user (at a max of 8 CPUs per Task, they essentially allowed 64
CPUs per user before the change in policy).
2020-06-02 12:40:26 -07:00
Jon Siwek
3b51d72aa1 Fix potential stack overflow in NVT analyzer
The NVT_Analyzer (e.g. as instantiated to support the FTP analyzer)
uses a recursive parsing function that may only advance one byte at a
time and can easily cause a stack overflow as a result.  This change
replaces the recursive calls with equivalent iterative logic.

Credit to OSS-Fuzz for discovery
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22898
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22972
2020-06-02 11:13:16 -07:00
Jon Siwek
e1f35c46f9 Change CI script to compile from build/Makefile
Helps some `make` versions properly use the `-j` option
2020-06-02 10:56:48 -07:00
Jon Siwek
1a60fb7c0d Add missing include in util.cc 2020-06-01 20:45:37 -07:00
Jon Siwek
34a1875e74 Merge remote-tracking branch 'origin/topic/timw/reduce-func-inclusion'
- Minor tweaks to some odd includes during merge

* origin/topic/timw/reduce-func-inclusion:
  Remove Analyzer.h from bro-bif.h
  Remove IPAddr.h from Reporter.h
  Remove the inclusion of Func.h from NetVar.h, which reduces the inclusion of Func.h overall.
2020-06-01 19:26:55 -07:00
Jon Siwek
0195880c48 Fix multiple content-transfer-encoding headers causing a memory leak
The MIME analyzer may also leak if it sees many multipart boundary
parameters.

Credit to OSS-Fuzz for discovery
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22871
2020-06-01 16:21:44 -07:00
Tim Wojtulewicz
b75d2a31cf Remove Analyzer.h from bro-bif.h 2020-06-01 15:00:40 -07:00
Tim Wojtulewicz
c558d771e4 Remove IPAddr.h from Reporter.h 2020-06-01 15:00:39 -07:00
Tim Wojtulewicz
ea3c679101 Remove the inclusion of Func.h from NetVar.h, which reduces the inclusion of Func.h overall. 2020-06-01 15:00:35 -07:00