Commit graph

9059 commits

Author SHA1 Message Date
Daniel Thayer
5ec4e00fcd Fix some Coverity warnings
Fixed some Coverity warnings in RemoteSerializer::ProcessLogCreateWriter().
Upon failure, CreateWriterForRemoteLog() frees the "info" and "fields"
pointers, so they are now set to null in order to avoid freeing them
a second time.
2017-03-08 14:19:31 -06:00
Robin Sommer
dc2cfd8a10 Updating submodule(s).
[nomail]
2017-03-03 12:51:54 -08:00
Johanna Amann
b6e6302b40 Ascii reader error changes - fix small bugs
The changes are now a bit more succinct with less code changes required.
Behavior is tested a little bit more thoroughly and a memory problem
when reading incomplete lines was fixed. ReadHeader also always directly
returns if header reading failed.

Error messages now are back to what they were before the change, if the
new behavior is not used.

I also tweaked the documentation text a bit.
2017-03-03 12:42:44 -08:00
Robin Sommer
f616903e5f Updating submodule(s).
[nomail]
2017-03-03 10:44:24 -08:00
Robin Sommer
6302b103f4 Merge remote-tracking branch 'origin/topic/johanna/threads'
Tweaked the new threading code a bit more.

* origin/topic/johanna/threads:
  Move threading to c++11 primitives (mostly).
2017-03-03 10:40:04 -08:00
Robin Sommer
766bab0771 Updating submodule. 2017-03-02 16:45:07 -08:00
Johanna Amann
9341ff801c Move threading to c++11 primitives (mostly).
This moves all threading code in Bro from pthreads to the c++11
primitives, which make for shorter, easier to use, and less error-prone
code.

pthreads is still used in 2 places in Bro currently. BasicThread uses
two bits of functionality that are not available using the c++ API
(setting thread names & setting signal masks). Since all c++
implementations that I am aware of still use an underlying pthreads
implementation, we just use native_handle to access the underlying
pthreads implementation for these cases. I do not expect this to lead to
problems in the forseable future. If we ever encounter a platform where
a different thread architecture is used, we might have to change that
around.

This code is guarded by static_asserts, so we will notice if a platform
uses a different implementation.

sqlite also uses pthreads directly.
2017-03-02 08:53:38 -08:00
Seth Hall
1c973f4adf Merge branch 'master' of ssh://git.bro-ids.org/bro 2017-02-28 12:40:12 -05:00
Seth Hall
01a3943635 Do some updates to remove build time warnings.
The linker was complaining about linking files that didn't
have any symbols.  These were actually empty files so I just
got rid of them and removed references to them.
2017-02-28 12:40:01 -05:00
Robin Sommer
38d9f07bbd Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix a test that sometimes fails on FreeBSD
2017-02-28 08:00:24 -08:00
Seth Hall
b89fe748c9 Merge remote-tracking branch 'origin/topic/robin/broker-logging'
* origin/topic/robin/broker-logging:
  Another fix for the new Broker-based remote logging.
  Fix some minor issues.
  Adding Broker ifdefs for new remote logging code.
  Changing semantics of Broker's remote logging to match old communication framework.
2017-02-27 15:10:36 -05:00
Robin Sommer
58a2d06c93 Another fix for the new Broker-based remote logging. 2017-02-27 08:22:16 -08:00
Daniel Thayer
0f695a7316 Fix a test that sometimes fails on FreeBSD 2017-02-25 21:53:02 -06:00
Johanna Amann
22c89a83f5 Update submodule
[nomail]
2017-02-24 09:02:16 -08:00
Seth Hall
5078159080 Tiny fix to correct a warning message. 2017-02-23 23:13:48 -05:00
Seth Hall
75744d22bc Input's ascii reader is now more resilient.
By default, the ASCII reader does not fail on errors anymore.
If there is a problem parsing a line, a reporter warning is
written and parsing continues.  If the file is missing or can't
be read, the input thread just tries again on the next heartbeat.

Options have been added to recreate the previous behavior...

const InputAscii::fail_on_invalid_lines: bool;
and
const InputAscii::fail_on_file_problem: bool;

They are both set to `F` by default which makes the input readers
resilient to failure.
2017-02-23 23:13:12 -05:00
Robin Sommer
5cf7803e68 Fix some minor issues.
From Daniel, thanks!
2017-02-23 17:18:43 -08:00
Johanna Amann
5b76366199 Plugin: add/fix documentation for HookSetupAnalyzerTree 2017-02-23 15:00:27 -08:00
Robin Sommer
e0a72b6e5c Updating submodule. 2017-02-23 10:20:06 -08:00
Johanna Amann
ae6dbf17a2 Input Manager: tiny error message fix. 2017-02-23 10:00:52 -08:00
Seth Hall
7bbaa911b0 I missed one test I needed to update for the kerberos commit that I just pushed. 2017-02-22 00:02:51 -05:00
Seth Hall
f562989aa3 Merge remote-tracking branch 'origin/topic/vladg/krb5-ticket-tracking'
* origin/topic/vladg/krb5-ticket-tracking:
  Kerberos ciphertext had some additional ASN.1 content being lumped in.
2017-02-22 00:01:20 -05:00
Seth Hall
2b15ec1069 Another resilient Ascii reader checkpoint.
This works correctly now (as a prototype at least). If a file
disappears, the thread complains once and once the file reappears
the thread will once again begin watching it.
2017-02-21 23:35:29 -05:00
Seth Hall
b0d812812f In progress on ascii writer behavior change. 2017-02-21 15:45:26 -05:00
Seth Hall
205a28bad8 Updated Windows version detection to include Windows 10
Thanks to Fatema Bannatwala for finding it and Keith Lehigh
and Mike Patterson for verifying.
2017-02-21 15:06:39 -05:00
Seth Hall
a44c4049b8 Merge remote-tracking branch 'origin/topic/seth/radius-script-refactor'
* origin/topic/seth/radius-script-refactor:
  Rework the RADIUS base script.
2017-02-20 00:25:47 -05:00
Seth Hall
623ebea655 Rework the RADIUS base script.
- This fixes BIT-1769 by logging all requests even in the absence of a
   reply.  The way that request and replying matching were being handled
   was restructured to mostly ignore the transaction ids because they
   aren't that helpful for network monitoring and it makes the script
   structure more complicated.
 - Add `framed_addr` field to the radius log to indicate if the radius
   server is hinting at an address for the client.
 - Add `ttl` field to indicate how quickly the radius server is replying
   to the network access server.
 - Fix a bunch of indentation inconsistencies.
2017-02-20 00:07:14 -05:00
Seth Hall
f935675d82 Merge branch 'topic/seth/krb5-ticket-tracking-merge'
* topic/seth/krb5-ticket-tracking-merge:
  Refactor base krb scripts and update tests.
  Add script to log ticket hashes in krb log
  Ensure TGS req does not stomp out AP data
  Add ciphertext to ticket data structures
2017-02-18 14:03:04 -05:00
Seth Hall
0b8b76cfab Refactor base krb scripts and update tests. 2017-02-18 13:55:39 -05:00
Seth Hall
c40a89e5db Merge branch 'krb5-ticket-tracking' of https://github.com/jrolli/bro into jrolli-krb5-ticket-tracking 2017-02-18 11:09:51 -05:00
Robin Sommer
524002eefa Merge remote-tracking branch 'origin/master' into topic/robin/broker-logging 2017-02-17 16:30:17 -08:00
Robin Sommer
511ca9e043 Adding Broker ifdefs for new remote logging code. 2017-02-17 16:28:20 -08:00
Johanna Amann
5604f46dd3 OCSP SCT: use correct oid for old openssls 2017-02-15 17:38:56 -08:00
Johanna Amann
5f910e1005 Merge remote-tracking branch 'origin/topic/jsiwek/bit-1785'
* origin/topic/jsiwek/bit-1785:
  BIT-1785: fix scripts able to access uninitialized variables.

BIT-1785 #merged
2017-02-15 16:19:21 -08:00
Johanna Amann
7c7e12ab94 Merge remote-tracking branch 'origin/topic/seth/BIT-1480'
* origin/topic/seth/BIT-1480:
  Small change to avoid potentially over reading memory.
  Implement ERSPAN support.

BIT-1480 #merged
2017-02-15 15:32:47 -08:00
Vlad Grigorescu
b3a18f3c80 Kerberos ciphertext had some additional ASN.1 content being lumped in. 2017-02-15 16:24:21 -06:00
Johanna Amann
976677dba2 Add missing end of file call for stapled ocsp responses. 2017-02-14 12:19:08 -08:00
Seth Hall
809660d48a Tiny mime-type fix from Dan Caselden. 2017-02-14 07:21:00 -08:00
Johanna Amann
2b694a1881 Update failing intel framework test. 2017-02-11 08:36:47 -08:00
Robin Sommer
a5e9a535a5 Changing semantics of Broker's remote logging to match old communication framework.
Broker had changed the semantics of remote logging: it sent over the
original Bro record containing the values to be logged, which on the
receiving side would then pass through the logging framework normally,
including triggering filters and events. The old communication system
however special-cases logs: it sends already processed log entries,
just as they go into the log files, and without any receiver-side
filtering etc. This more efficient as it short-cuts the processing
path, and also avoids the more expensive Val serialization. It also
lets the sender determine the specifics of what gets logged (and how).

This commit changes Broker over to now use the same semantics as the
old communication system.

TODOs:
     - The new Broker code doesn't have consistent #ifdefs yet.

     - Right now, when a new log receiver connects, all existing logs
     are broadcasted out again to all current clients. That doesn't so
     any harm, but is unncessary. Need to add a way to send the
     existing logs to just the new client.
2017-02-10 18:46:45 -08:00
Johanna Amann
c431d14eed OCSP: re-enable logging, fix tests, fix x509 issue
Re-enable logging, now in policy because it probably is interesting to
no-one. We also only log ocsp replies.

Fix all tests.

Fix an issue where ocsp replies were added to the x.509 certificate
list.
2017-02-10 17:05:12 -08:00
Johanna Amann
c550521221 OCSP: parse signed certificate timestamps
With this change, we also parse signed certificate timestamps from OCSP
replies. This introduces a common base class between the OCSP and X509
analyzer, which now share a bit of common code. The event for signed
certificate timestamps is raised by both and thus renamed do:

x509_ocsp_ext_signed_certificate_timestamp
2017-02-10 17:05:05 -08:00
Johanna Amann
b061a5db1a Merge branch 'topic/johanna/signed_certificate_timestamp' into topic/johanna/ocsp-new 2017-02-10 17:04:50 -08:00
Johanna Amann
cdcc21ea4b OCSP: generic extension parsing.
Raises ocsp_extension event if an extension is present in the reply or
in one of the singlereplies.
2017-02-10 17:03:50 -08:00
Johanna Amann
8b50a1e09b SSL: parse OCSP stapled extension as file 2017-02-10 17:03:40 -08:00
Johanna Amann
9fd7816501 Allow File analyzers to direcly pass mime type.
This makes it much easier for protocols where the mime type is known in
advance like, for example, TLS. We now do no longer have to perform deep
script-level magic.
2017-02-10 17:03:33 -08:00
Johanna Amann
1b19ab78b6 OCSP: split into two analysers in scriptland.
Instead of having an additional string argument specifying if we are
sending a request or a reply, we now have an ANALYZER_OCSP_REQUEST and
an ANALYZER_OCSP_REPLY
2017-02-10 17:03:27 -08:00
Johanna Amann
e1bcc4509f OCSP: rewrite events and data structures.
Instead of having a big event, that tries to parse all the data into a
huge datastructure, we do the more common thing and use a series of
smaller events to parse requests and responses.

The new events are:

ocsp_request -> raised for an ocsp request, giving version and requestor

ocsp_request_certificate -> raised n times per request, once per cert

ocsp_response_status -> raised for each ocsp response, giving status

ocsp_response_bytes -> raised for each ocsp response with information

ocsp_response_certificate -> raised for each cert in an ocsp response
2017-02-10 17:03:18 -08:00
Johanna Amann
9c6cebf324 OCSP: a bunch of whitespace fixes 2017-02-10 17:03:04 -08:00
Johanna Amann
b021fe7562 Rewrite of big parts of the OCSP analyzer.
Less redundancy, style closer to the X.509 analyzer, times being parsed
as real times, and lots of other changes.
2017-02-10 17:02:56 -08:00