Commit graph

9176 commits

Author SHA1 Message Date
Johanna Amann
446b5cb90e Remove opaque of ocsp_resp.
Only used in one event, without any way to use the opaque for anything
else. At this point this just seems like a complication that has no
reason to be there.
2019-06-18 11:09:16 -07:00
Johanna Amann
c068daa258 Remove remnants of event serializer. 2019-06-18 10:17:00 -07:00
Johanna Amann
ca28b98fd4 Fix cardinalitycounter deserialization.
This one took me way too long to admit. Values were pushed back on
deserialization - instead of assigned. Meaning they were added to the
end of the already 0-assigned vector.

The mean thing here is that estimation still worked - just merging
resulted in 0. And estimation still was correct because m, V, alpha_m
are enough for this - and those were correctly copied...

With this change, all tests pass.
2019-06-18 08:59:31 -07:00
Jon Siwek
8f668ce82c Merge remote-tracking branch 'origin/topic/dnthayer/rename-to-zeek'
* origin/topic/dnthayer/rename-to-zeek:
  Rename bro to zeek in error messages
2019-06-17 20:27:42 -07:00
Tim Wojtulewicz
502ad9abc3 Add ability to grow/shrink a vector using slicing, also adds Insert/Remove methods for VectorVal 2019-06-17 15:34:24 -07:00
Johanna Amann
618f0802f4 Smaller compile fixes for the new opaque serialization.
Also remove the non-existing clone function for EntrypyVals - which now
can just use serialization :)
2019-06-17 14:48:02 -07:00
Johanna Amann
a50b06d6c1 Merge remote-tracking branch 'origin/master' into topic/johanna/remove-serializer 2019-06-17 09:50:05 -07:00
Johanna Amann
e3f1d953f4 Merge remote-tracking branch 'origin/topic/robin/gh-243-opaque-serialization' into topic/johanna/remove-serializer
* origin/topic/robin/gh-243-opaque-serialization:
  Reimplement serialization infrastructure for OpaqueVals.
  Couple of compile fixes.
2019-06-17 09:42:24 -07:00
Robin Sommer
01e662b3e0 Reimplement serialization infrastructure for OpaqueVals.
We need this to sender through Broker, and we also leverage it for
cloning opaques. The serialization methods now produce Broker data
instances directly, and no longer go through the binary formatter.

Summary of the new API for types derived from OpaqueVal:

    - Add DECLARE_OPAQUE_VALUE(<class>) to the class declaration
    - Add IMPLEMENT_OPAQUE_VALUE(<class>) to the class' implementation file
    - Implement these two methods (which are declated by the 1st macro):
        - broker::data DoSerialize() const
        - bool DoUnserialize(const broker::data& data)

This machinery should work correctly from dynamic plugins as well.

OpaqueVal provides a default implementation of DoClone() as well that
goes through serialization. Derived classes can provide a more
efficient version if they want.

The declaration of the "OpaqueVal" class has moved into the header
file "OpaqueVal.h", along with the new serialization infrastructure.
This is breaking existing code that relies on the location, but
because the API is changing anyways that seems fine.

This adds an internal BiF
"Broker::__opaque_clone_through_serialization" that does what the name
says: deep-copying an opaque by serializing, then-deserializing. That
can be used to tests the new functionality from btests.

Not quite done yet. TODO:
    - Not all tests pass yet:
        [  0%] language.named-set-ctors ... failed
        [ 16%] language.copy-all-opaques ... failed
        [ 33%] language.set-type-checking ... failed
        [ 50%] language.table-init-container-ctors ... failed
        [ 66%] coverage.sphinx-zeekygen-docs ... failed
        [ 83%] scripts.base.frameworks.sumstats.basic-cluster ... failed

      (Some of the serialization may still be buggy.)

    - Clean up the code a bit more.
2019-06-17 16:13:54 +00:00
Daniel Thayer
0ae1bfa29d Rename bro to zeek in error messages
More renaming in error messages and a few other places.
2019-06-16 23:08:45 -05:00
Jon Siwek
e2dc0092f3 Merge branch 'ntp-rewrite' of https://github.com/mauropalumbo75/zeek
* 'ntp-rewrite' of https://github.com/mauropalumbo75/zeek: (25 commits)
  update tests baseline
  Apply requested changes: - file dpd.sig and TODO comments for signature protocol detection removed - missing doc field filled in events.bif - rename OpCode and ReqCode fields into op_code and req_code respectively - removed unnecessary child method in NTP.h/.cc - main.zeek and ntp-protocol.pac reformatted
  minor changes in the documentation
  fix some initializations
  fix wrong assignment of control key_id/crypto_checksum
  code clean up
  add extension fields parsing
  add extended mac field with 20 byte digest (+4 byte key id)
  update tests and add a new one for key_id and mac
  fix auth field (key_id and mac) in standard and control msg
  remove old NTP record in init-bare.zeek
  fix key_id and digest (WIP)
  fix wrong Assign with reference_id
  add tests for ntp protocol (finished)
  add tests for ntp protocol (WIP)
  fix problem with time vals
  add ntp records to init-bare.zeek
  update ntp analyzer to val_mgr
  extend and refact script-side of NTP analyzer
  extend and refactor several fields
  ...
2019-06-15 19:11:34 -07:00
Jon Siwek
852506e26a Merge remote-tracking branch 'origin/topic/vlad/dns_spf'
* origin/topic/vlad/dns_spf:
  DNS: Add support for SPF response records
2019-06-14 20:58:54 -07:00
Jon Siwek
11cbda5589 Updating submodule(s).
[nomail]
2019-06-14 20:28:25 -07:00
Jon Siwek
853a796b9e GH-406: rename bro.bif to zeek.bif
Fixes GH-406
2019-06-14 19:53:38 -07:00
Jon Siwek
56bb28a636 Merge remote-tracking branch 'origin/topic/jsiwek/gh-387-broker-topic-names'
* origin/topic/jsiwek/gh-387-broker-topic-names:
  GH-387: update Broker topic names to use "zeek/" prefix
2019-06-14 19:30:51 -07:00
Jon Siwek
768f32c25f Merge remote-tracking branch 'origin/topic/jsiwek/gh-323-plugin-namespace'
* origin/topic/jsiwek/gh-323-plugin-namespace:
  GH-323: change builtin plugin namespaces to Zeek
2019-06-14 19:09:47 -07:00
Vlad Grigorescu
5f0023b3b0 DNS: Add support for SPF response records
SPF response records are identical to TXT records in structure, and
can be parsed and interpreted the same way. However, they have a
different RR type, so they would generate weird events and not be
parsed by Zeek before this change.

Even though they're the same as TXT records from a protocol stance, I
created a new event type (dns_SPF_reply), and call the records out as
SPF in the logs, instead of as TXT records, since the distinction
could be important for detection purposes.

SPF records have been obsoleted, but continue to be seen in the wild.
2019-06-14 10:18:37 -05:00
Mauro Palumbo
3e7532e760 update tests baseline 2019-06-14 14:00:33 +02:00
Mauro Palumbo
32663cec04 Apply requested changes:
- file dpd.sig and TODO comments for signature protocol detection removed
- missing doc field filled in events.bif
- rename OpCode and ReqCode fields into op_code and req_code respectively
- removed unnecessary child method in NTP.h/.cc
- main.zeek and ntp-protocol.pac reformatted
2019-06-14 12:30:29 +02:00
Tim Wojtulewicz
23f9fb0ae9 Allow assignment for vectors using slices 2019-06-13 15:37:31 -07:00
Tim Wojtulewicz
964e2c91a3 Check for integral slice indexes, add extra test for [:] 2019-06-13 13:40:07 -07:00
Jon Siwek
fcceba5ece Merge remote-tracking branch 'origin/topic/timw/asan'
* origin/topic/timw/asan:
  Fix potential null-dereference in current_time()
  Add --sanitizers flag to configure script to enable Clang sanitizers
2019-06-13 11:20:49 -07:00
Jon Siwek
3a8b83ca25 Updating submodule(s).
[nomail]
2019-06-12 16:21:07 -07:00
Jon Siwek
b33926a8e1 Merge remote-tracking branch 'origin/topic/dnthayer/gh-313'
* origin/topic/dnthayer/gh-313:
  Create local.zeek as symlink for upgrade installs
  Rename directories from bro to zeek
2019-06-12 15:11:04 -07:00
Tim Wojtulewicz
965a99a781 Fix potential null-dereference in current_time() 2019-06-12 14:46:29 -07:00
Tim Wojtulewicz
7efc39d228 Add --sanitizers flag to configure script to enable Clang sanitizers 2019-06-12 14:46:29 -07:00
Tim Wojtulewicz
f1383d98c2 Return an empty vector if the indices for slicing don't make sense 2019-06-12 14:29:11 -07:00
Tim Wojtulewicz
0af79a7a16 GH-393: Add slice notation for vectors 2019-06-12 14:20:37 -07:00
Jon Siwek
0ab1f0fe25 Updating submodule(s).
[nomail]
2019-06-12 10:34:27 -07:00
Mauro Palumbo
b130cc7931 minor changes in the documentation 2019-06-12 12:46:18 +02:00
Daniel Thayer
52b5124767 Create local.zeek as symlink for upgrade installs
Since the default install prefix has changed from /usr/local/bro
to /usr/local/zeek, the local.zeek will be created as a symlink to
the old local.bro if doing an upgrade install and if using the default
install prefix.
2019-06-12 02:49:22 -05:00
Robin Sommer
1ce5521ecc Couple of compile fixes.
This is branched from topic/johanna/remove-serializer.
2019-06-11 22:53:25 +00:00
Mauro Palumbo
6c29feb1d7 fix some initializations 2019-06-11 15:29:37 +02:00
Mauro Palumbo
1c078bed25 fix wrong assignment of control key_id/crypto_checksum 2019-06-11 15:06:38 +02:00
Mauro Palumbo
40886fe611 code clean up 2019-06-09 21:47:09 +02:00
Mauro Palumbo
af91246c03 add extension fields parsing 2019-06-09 21:25:16 +02:00
Mauro Palumbo
d0465bc45d add extended mac field with 20 byte digest (+4 byte key id) 2019-06-09 20:21:56 +02:00
Jon Siwek
5331bf10ec GH-323: change builtin plugin namespaces to Zeek 2019-06-07 20:56:54 -07:00
Jon Siwek
e0f9b0829e Adapt bro_plugin CMake macros to use zeek_plugin 2019-06-07 20:07:39 -07:00
Robin Sommer
32f30b5c71 Renaming src/StateAccess.{h,cc} to src/Notifier.{h,cc}.
The old names did not reflect the content of the files anymore.
2019-06-08 00:27:55 +00:00
Robin Sommer
6adab8d46a Clean up new code. 2019-06-08 00:24:02 +00:00
Robin Sommer
7bd738865c Remove MutableVal class. 2019-06-07 23:17:37 +00:00
Robin Sommer
062a1ee6b3 Redo API for notifiers.
There's now an notifier::Modifiable interface class that class
supposed to signal modifications are to be derived from. This takes
the place of the former MutableValue class and also unifies how Val
and IDs signal modifications.
2019-06-07 23:17:36 +00:00
Robin Sommer
f8262b65c4 Remove most of MutableVal (but not the class itelf yet) 2019-06-07 23:17:36 +00:00
Robin Sommer
0ba382280c Remove enum Opcode. 2019-06-07 23:17:36 +00:00
Robin Sommer
31ddca863c Remove StateAccess class. 2019-06-07 23:17:36 +00:00
Robin Sommer
02214dafc4 Redo NotfifierRegistry to no longer rely on StateAccess.
We simplify the API to a simple Modified() operation.
2019-06-07 23:17:36 +00:00
Robin Sommer
c0c5dccd06 Add new test for when-statement watching global variables. 2019-06-07 23:17:29 +00:00
Robin Sommer
00f9341183 Couple of compile fixes.
This is branched from topic/johanna/remove-serializer.
2019-06-07 22:56:59 +00:00
Jon Siwek
05a58f90a2 Merge remote-tracking branch 'origin/topic/johanna/tls13-details'
* origin/topic/johanna/tls13-details:
  Update SSL documentation.
  support the newer TLS 1.3 key_share extension.
  Include all data of the server-hello random
  Parse pre-shared-key extension.

Added a small portability fix for the gmt_unix_time byte-swapping.
2019-06-07 14:06:11 -07:00