Commit graph

1978 commits

Author SHA1 Message Date
Robin Sommer
476891c14a Changing protocol_{confirmation,violation} events to queue like any
other event.

Addresses BIT-1530.
2016-05-27 13:19:04 -07:00
Robin Sommer
53c523fa6f Normalizing test baseline. 2016-05-24 22:16:31 -07:00
Robin Sommer
d86bf15dbf Do not use scientific notations when printing doubles in logs.
Closes BIT-1558.
2016-05-23 16:07:22 -07:00
Robin Sommer
3581ead0d9 Ignoring packets with negative timestamps.
These used to stall Bro. Addresses BIT-1562 and BIT-1443.
2016-05-23 13:22:22 -07:00
Robin Sommer
4f9cb6912a Fix for a table refering to a expire function that's not defined.
I was hoping to report this right at startup through a static check
but turns out we don't have the right machinery in place for that.
That would need to be done after the AST has been finalized, but our
AST traversal code can't iterate over types. So instead I've changed
this so that it's still being reported at runtime but at least
doesn't crash Bro anymore.

Closes BIT-1597.
2016-05-23 12:48:34 -07:00
Robin Sommer
85213e6b55 Merge remote-tracking branch 'origin/topic/johanna/fix-analyzer-addition'
* origin/topic/johanna/fix-analyzer-addition:
  DTLS: Use magix constant from rfc5389 for stun detection.
  DTLS: Fix binpac bug with DTLSv1.2 client hellos
  Forgot to remove debug output.
  DTLS: Fix interaction with STUN
  Fix the way that child analyzers are added.

BIT-1604 #merged
2016-05-18 07:41:18 -07:00
Johanna Amann
39bdc397a0 DTLS: Fix interaction with STUN
Now the DTLS analyzer cleanly skips all STUN messages; no warnings
should be logged to dpd.log and parsing should work flawlessly with
intermixed STUN messages.
2016-05-17 16:36:46 -07:00
Johanna Amann
d091e9ca89 Fix duplication of new_connection_contents event
Addresses BIT-1602
2016-05-17 10:32:13 -07:00
Johanna Amann
4851cbc7cc Merge remote-tracking branch 'origin/topic/dnthayer/ticket1601'
* origin/topic/dnthayer/ticket1601:
  Fix some failing plugin tests on OS X 10.11

BIT-1601 #merged
2016-05-16 20:11:20 -07:00
Johanna Amann
8f6cdbb489 Fix test failing when we use &> instead of 2>
On the shell of a few systems, that apparently masks the return code.

(Namely - Debian and FreeBSD)
2016-05-13 07:44:30 -07:00
Daniel Thayer
a4e5591e18 Fix some failing plugin tests on OS X 10.11
By default, OS X 10.11 does not include openssl headers.
Since building a Bro plugin #includes Bro headers, which #include openssl
headers, we need to tell cmake to find these so that the compiler
can use them.
2016-05-12 15:58:09 -05:00
Johanna Amann
49ca47895d Merge remote-tracking branch 'origin/topic/dnthayer/ticket1595'
* origin/topic/dnthayer/ticket1595:
  Fix a bug in receiving remote logs via broker

BIT-1595 #merged
2016-05-12 08:06:42 -07:00
Johanna Amann
8fb78125a5 Merge remote-tracking branch 'origin/topic/dnthayer/ticket1587'
* origin/topic/dnthayer/ticket1587:
  Fix Bro and unit tests when broker is not enabled

BIT-1587 #merged
2016-05-12 07:58:19 -07:00
Johanna Amann
5f50733276 Merge branch 'topic/jgras/event-vars' of https://github.com/J-Gras/bro 2016-05-12 07:40:44 -07:00
Jan Grashoefer
65607239c9 Added interpreter error for local event variables.
Scheduling a local event variable resulted in a global lookup instead of
evaluating the local variable. To prevent misunderstandings, this will
trigger an error now.
2016-05-11 12:26:11 +02:00
Daniel Thayer
7e3991d879 Fix a bug in receiving remote logs via broker
When receiving a remote log via broker, there was a bug that would
prevent a log from being written if the log record contained a field
without the &log attribute that was followed by a field with the &log
attribute.

Updated a test case to catch this error.
2016-05-10 15:37:50 -05:00
Daniel Thayer
d91dd8d9a8 Fix Bro and unit tests when broker is not enabled
When Bro was compiled with broker disabled, then some Bro scripts
were referencing functions and types that were not defined.  Fixed
by adding @ifdefs to several scripts.  Removed one @ifdef because
it was causing several unit tests to fail.

Also fixed the @TEST-REQUIRES check in tests that rely on broker so
that such tests are skipped when broker is disabled.
2016-05-10 06:24:35 -05:00
Robin Sommer
00d94f1bbc Merge remote-tracking branch 'origin/topic/seth/stats-improvement'
(Cleaned up some code a little bit.)

* origin/topic/seth/stats-improvement:
  Fixing tests for stats improvements
  Rename the reporting interval variable for stats.
  Removing more broken functionality due to changed stats apis.
  Removing some references to resource_usage()
  Removing Broker stats, it was broken and incomplete.
  Fixing default stats collection interval to every 5 minutes.
  Add DNS stats to the stats.log
  Small stats script tweaks and beginning broker stats.
  Continued stats cleanup and extension.
  More stats collection extensions.
  More stats improvements
  Slight change to Mach API for collecting memory usage.
  Fixing some small mistakes.
  Updating the cmake submodule for the stats updates.
  Fix memory usage collection on Mac OS X.
  Cleaned up stats collection.

BIT-1581 #merged
2016-05-07 11:51:35 -07:00
Robin Sommer
34c7a3ef68 Merge remote-tracking branch 'origin/topic/dnthayer/doc-improvements'
* origin/topic/dnthayer/doc-improvements:
  Fix some scripting tutorial examples
  Add some missing Bro script documentation
  Fix more "make doc" warnings
  Fix some "make doc" warnings
  Improve documentation of the "for" statement
  Add more documentation to sumstats framework scripts
  Update traffic per core estimate in the cluster doc
  Update documentation for DNS "Z" field
  Improve documentation of Bro script statements

BIT-1520 #merged
2016-05-06 16:59:07 -07:00
Robin Sommer
abebd036bc Merge remote-tracking branch 'origin/topic/johanna/xmpp-starttls'
* origin/topic/johanna/xmpp-starttls:
  XMPP: Add StartTLS event and update tests
  Add xmpp dpd sig and fix a few parsing problems for connections that do not upgrade to TLS.
  Add simple XMPP StartTLS analyzer.

BIT-1579 #merged
2016-05-06 16:56:06 -07:00
Daniel Thayer
f596d30386 Fix some scripting tutorial examples
Some of the examples in the scripting tutorial were regularly getting
out of sync with the base scripts (because the line numbering would need
to be updated).  Fixed this maintenance burden by using small example
scripts instead of actual Bro scripts.  These small example scripts
do not need to be kept in sync with the bro base scripts.
2016-05-05 17:23:15 -05:00
Seth Hall
f8f5998328 Fixing tests for stats improvements 2016-05-02 16:43:08 -04:00
Johanna Amann
f2acaec9b7 XMPP: Add StartTLS event and update tests
Also tiny cleanyp to the code.
2016-04-29 13:51:35 -07:00
Johanna Amann
6905984ee7 Merge remote-tracking branch 'origin/master' into topic/johanna/xmpp-starttls 2016-04-29 12:56:12 -07:00
Daniel Thayer
428be70190 Merge remote-tracking branch 'origin/master' into fastpath 2016-04-29 01:30:25 -05:00
Robin Sommer
f98561b85c Updating NEWS and a test baseline after merges. 2016-04-28 11:33:01 -07:00
Robin Sommer
befad8f825 Merge remote-tracking branch 'origin/topic/dnthayer/ticket1449'
BIT-1449 #merged

* origin/topic/dnthayer/ticket1449:
  Rename broker BIF wrapper functions in a few more places
  Sync the core/leaks/broker/data.bro test with broker/data.bro
  Add missing tests for broker data BIFs
  Code cleanup for some broker tests
  Add script wrapper functions for broker data BIFs
  Add script wrapper functions for broker BIFs
2016-04-28 10:24:39 -07:00
Robin Sommer
abb42a5bd9 Merge remote-tracking branch 'origin/topic/johanna/intel-uid-fuid'
BIT-1572 #merged

* origin/topic/johanna/intel-uid-fuid:
  Intel: Allow to provide uid/fuid instead of conn/f.
2016-04-28 10:20:50 -07:00
Robin Sommer
2eeddac401 Merge remote-tracking branch 'origin/topic/johanna/imap-starttls'
BIT-1574 #merged

* origin/topic/johanna/imap-starttls:
  IMAP: add c++11 header file that gcc complains about.
  IMAP: documentation and test updates
  also generate an event when starttls is encounterd for imap.
  Add support of getting server capabilities to IMAP parser.
  Basic IMAP StartTLS analyzer.
2016-04-28 10:11:43 -07:00
Daniel Thayer
362bf7aee1 Update docs and tests of the fmt() function
Removed tests and documentation of the "%A" format specifier, which
was removed in commit 7344052b.
2016-04-27 15:34:47 -05:00
Johanna Amann
3a70289e91 ARP: remove unnecessary variables and add testcase
BIT-1573 #close
2016-04-27 06:51:04 -07:00
Daniel Thayer
12eb7a380d Rename broker BIF wrapper functions in a few more places 2016-04-27 00:47:48 -05:00
Daniel Thayer
f5361fb27c Sync the core/leaks/broker/data.bro test with broker/data.bro 2016-04-26 23:34:39 -05:00
Daniel Thayer
fbab6490ec Add missing tests for broker data BIFs
Added tests for the table_clear and vector_clear BIFs, and added
more tests for container types (e.g. adding the same element twice
to a set or table, or overwriting a record field value, etc.).
Also reorganized several test cases.
2016-04-26 23:03:28 -05:00
Daniel Thayer
b1876bf744 Code cleanup for some broker tests
Simplified some function names, fixed some names of broker script wrappers,
reorder some broker function calls to avoid potential race conditions, and
don't have bro read a trace file when it will not be used.
2016-04-26 22:30:12 -05:00
Daniel Thayer
4df948f3c8 Add script wrapper functions for broker data BIFs 2016-04-26 22:01:09 -05:00
Daniel Thayer
f44bb4d9b8 Add script wrapper functions for broker BIFs
Also renamed the "print" function to "send_print" and the "event"
function to "send_event" because Bro shows a syntax error when a
Bro script function is named "event" or "print".
2016-04-26 18:10:30 -05:00
Johanna Amann
124126cabc Merge remote-tracking branch 'origin/master' into topic/johanna/imap-starttls 2016-04-26 12:48:53 -07:00
Johanna Amann
e9a87566ef Fix parsing of x509 pre-y2k dates
There was a bug in the new parsing code, introduced in
708ede22c6 which parses validity times
incorrectly if they are before the year 2000. What happens in this case
is that the 2-digit year will be interpreted to be in the 21st century
(1999 will be parsed as 2099, e.g.).
2016-04-26 12:30:28 -07:00
Johanna Amann
25f8993b57 IMAP: documentation and test updates 2016-04-26 11:15:41 -07:00
Johanna Amann
3669b6aa9c Merge remote-tracking branch 'origin/master' into topic/johanna/imap-starttls 2016-04-26 10:52:16 -07:00
Johanna Amann
41606e18fb Intel: Allow to provide uid/fuid instead of conn/f.
This patch allows users to provide the fuid or the connection id
directly, in case they do not have access to either in the event that
they handle.

An example for this is the handling of certificates in SSL, where the
fa_file record cannot be retained because this would create a cyclic
data structure.

This patch also provides file IDs for hostname matches in certificates,
which was not possible with the previous API.
2016-04-25 16:54:47 -07:00
Johanna Amann
a705b2c08d Add DNS tests for huge TLL and CAA 2016-04-25 15:43:20 -07:00
Johanna Amann
e7ec537ed5 Merge remote-tracking branch 'origin/topic/dnthayer/broker-namespace'
* origin/topic/dnthayer/broker-namespace:
  Split the broker main.bro into two scripts
  Rename the BrokerStore namespace to Broker
  Rename the BrokerComm namespace to Broker

BIT-1563 #merged
2016-04-22 16:45:09 -07:00
Johanna Amann
176bb6ef34 Merge branch 'topic/jgras/packet-header' of https://github.com/J-Gras/bro
In the merge, I changed IP.cc to use icmp6_hdr for icmpv6 instead of the
icmp* that was used in the patch. While it does not make a difference
for this case, it seems cleaner.

BIT-1570 #merged
2016-04-22 16:07:01 -07:00
Robin Sommer
efde4a74b0 Merge remote-tracking branch 'origin/topic/johanna/intel-cert-hash'
BIT-1567 #merged

* origin/topic/johanna/intel-cert-hash:
  Intel: CERT_HASH indicator type was never checked
2016-04-22 08:37:14 -07:00
Jan Grashoefer
3665f745ad Updated affected test case.
Fixing IP_Hdr::BuildPktHdrVal to generate an icmp_hdr record for ICMPv6
packets slightly changed the output of core/ipv6_zero_len_ah.test.
2016-04-20 00:23:11 +02:00
Jan Grashoefer
8ac92cf7ff Added test case for get_current_packet_header bif. 2016-04-20 00:05:33 +02:00
Seth Hall
b722fe4540 Merge branch 'topic/seth/file-entropy'
* topic/seth/file-entropy:
  Add a file entropy test.
  Fixing a test.
  Updated tests for file entropy analyzer.
  Update and clean up to file entropy measurement.
  First commit of file entropy analyzer.
2016-04-13 01:43:27 -04:00
Seth Hall
adcc978f14 Add a file entropy test. 2016-04-13 00:44:02 -04:00