Commit graph

803 commits

Author SHA1 Message Date
Seth Hall
4bb4c54f96 Tiny scoping updates and test baseline updates for Intel framework. 2016-08-05 09:29:23 -04:00
Seth Hall
d6a7322a75 Merge branch 'topic/jgras/intel-update' of https://github.com/J-Gras/bro into topic/seth/intel-update-merge
# Conflicts:
#	testing/btest/Baseline/coverage.default-load-baseline/canonified_loaded_scripts.log
#	testing/btest/Baseline/scripts.policy.frameworks.intel.seen.certs/intel-all.log
2016-08-02 15:50:43 -04:00
Johanna Amann
4ad5d9073a NetControl: add catch and release event when IPs are forgotten.
This adds an event that is raised once Catch & Release ceases the
block management for an IP address because the IP has not been seen in
traffic during the watch interval.

This allows users who use their own logic on the top of catch and
release know when they will have to start re-blocking the IP if it
occurs in traffic again.
2016-07-28 16:28:07 -04:00
Robin Sommer
5b73345b73 Merge remote-tracking branch 'origin/topic/johanna/bit-1181'
BIT-1181 #merged

* origin/topic/johanna/bit-1181:
  Input: Further small changes to error handling
  Add error events to input framework.
2016-07-26 14:52:27 -07:00
Johanna Amann
51b8dee70b Adjust default priority of ACTION_DROP hook.
We use -5, just like all other normal notice framework actions.
2016-07-26 13:39:40 -07:00
Johanna Amann
6b9abe85a7 Add error events to input framework.
This change introduces error events for Table and Event readers. Users
can now specify an event that is called when an info, warning, or error
is emitted by their input reader. This can, e.g., be used to raise
notices in case errors occur when reading an important input stream.

Example:

event error_event(desc: Input::TableDescription, msg: string, level: Reporter::Level)
	{
	...
	}

event bro_init()
	{
	Input::add_table([$source="a", $error_ev=error_event, ...]);
	}

For the moment, this converts all errors in the Asciiformatter into
warnings (to show that they are non-fatal) - the Reader itself also has
to throw an Error to show that a fatal error occurred and processing
will be abort.

It might be nicer to change this and require readers to mark fatal
errors as such when throwing them.

Addresses BIT-1181
2016-07-22 19:45:28 -07:00
Robin Sommer
09ea84bb6e Merge remote-tracking branch 'origin/topic/johanna/netcontrol-improvements'
Great work, and great documentation!

I'm getting one test failure with
scripts.base.frameworks.netcontrol.catch-and-release-cluster Going
ahead and commiting, Jenkins will show the details I assume.

BIT-1584 #merged

* origin/topic/johanna/netcontrol-improvements:
  SMTP does not need to pull in the notice framework.
  Write NetControl framework documentation.
  Use NetControl for ACTION_DROP of notice framework.
  NetControl: slightly update catch and release logging
  NetControl: fix several small logging issues
  NetControl: more catch and release logging and cluster fix
  NetControl: rewrite catch and release and small fixes.
  NetControl: find_rules_subnet works in cluster mode
  NetControl: fix acld whitelist command
  NetControl: add rule exists as state besides added and failure.
  NetControl: Suppress duplicate "plugin activated" messages.
  NetControl: make new broker plugin options accessible
  NetControl: add predicates to broker plugin
2016-06-30 17:34:44 -07:00
Jan Grashoefer
a7d3f530fa Minor documentation cleanups. 2016-06-29 20:58:39 +02:00
Johanna Amann
971f7e236f Fix a number of documentation building errors 2016-06-27 12:41:40 -07:00
Johanna Amann
f1267b0b94 Write NetControl framework documentation.
In the process, some of the script documentation of the NetControl
framework was also updated.
2016-06-22 16:02:48 -07:00
Johanna Amann
3b55a917ac Use NetControl for ACTION_DROP of notice framework.
So far, this action did nothing...
2016-06-22 16:01:26 -07:00
Jan Grashoefer
df5d9adfb4 Fixed insertion of nested subnets.
When inserting, existance of the given subnet is checked using exact
matching instead of longest prefix matching. Before, inserting a subnet
would have updated the subnet item, which is the longest prefix of the
inserted subnet, if present.
2016-06-22 21:14:06 +02:00
Johanna Amann
6361a0d658 Merge remote-tracking branch 'origin/master' into topic/johanna/netcontrol-improvements 2016-06-21 12:42:06 -07:00
Johanna Amann
85220e46aa Weird: fix potential small issue when ignoring duplicates
In all versions so far, the identifier string that was used for
comparisons might have been different from the identifier string that
was added (when certain notices are used).
2016-06-15 14:33:41 -07:00
Johanna Amann
697b2748f5 Rewrite weird logging.
This commit rewrites the way that weirds are logged and fixes a number
of issues on the way. Most prominently, flow weirds now actually log
information about the flow that they occur in (before this change, they
only logged the name of the weird, which is only marginally helpful).

Besides restructuring how weird logging works internally, weirds can now
also be generated by calling Weird::weird with the info record directly,
allowing more fine-granular passing of information. This is e.g. used
for DNS weirds, which do not have the connection record available any
more when they are generated (before data like the connection ID was
just not logged in these instances).

Addresses BIT-1578
2016-06-15 13:49:35 -07:00
Jan Grashoefer
1412de1798 Refactored FAF integration of intel framework.
File Analysis Framework related code has been moved into a separate
script. Using redefinitions of the corresponding records causes the
file-related columns to appear last.
2016-06-15 21:56:53 +02:00
Jan Grashoefer
5d340e669c Added expiration for intelligence items.
Expiration of intelligence items can be configured using
Intel::item_expiration. Expiration can be handled using the
Intel::item_expired hook.
2016-06-15 19:29:48 +02:00
Jan Grashoefer
7e0b5b4ba4 Merge branch 'master' into topic/jgras/intel-update 2016-06-15 19:26:26 +02:00
Seth Hall
2e9491482f Add ACE archive files to the identified file types.
Addresses BIT-1609.  Thanks Stephen Hosom!
2016-06-14 22:27:09 -04:00
Johanna Amann
990836e868 NetControl: slightly update catch and release logging
Re-drops now contain the location of the original drop.
2016-05-31 11:52:42 -07:00
Johanna Amann
2f74825785 NetControl: fix several small logging issues
forgotten messages are only logged on the manager (or standalone host)
now. Logs are not written by default anymore when Bro encounters traffic
that should have been blocked.
2016-05-27 08:51:06 -07:00
Johanna Amann
296c5611ec NetControl: more catch and release logging and cluster fix 2016-05-26 16:53:42 -07:00
Johanna Amann
9f7b23b179 NetControl: rewrite catch and release and small fixes.
This commit rewrites catch and release, fixing issues with it and making
it fully cluster capable. A dedicated netcontrol_catch_release.log is
also added.

This is not quite done yet; a few more log messages are missing. There
should hopefully not be many big issues left.
2016-05-23 16:16:21 -07:00
Johanna Amann
6779325520 NetControl: find_rules_subnet works in cluster mode
This introduces two new events, NetControl::rule_new and
NetControl::rule_destroyed, which are raised when rules are first added
and then deleted from the internal state tracking.
2016-05-20 11:11:44 -07:00
Johanna Amann
52d694f3bd Merge remote-tracking branch 'origin/master' into topic/johanna/netcontrol-improvements 2016-05-19 16:17:07 -07:00
Jan Grashoefer
cb33028702 Added hook to allow extending the intel log.
The extension mechanism is basically the one that Seth introduced with
his intel extensions. The main difference lies in using a hook instead
of an event. An example policy implements whitelisting.
2016-05-11 23:59:46 +02:00
Jan Grashoefer
859eb5eac7 Merge branch 'master' into topic/jgras/intel-update 2016-05-11 18:59:58 +02: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
Daniel Thayer
2d9127888f Add some missing Bro script documentation
Also fixed a few reST formatting issues.
2016-05-05 16:35:31 -05:00
Daniel Thayer
28125e367e Fix more "make doc" warnings 2016-05-05 15:18:50 -05:00
Daniel Thayer
75e69d8c09 Fix some "make doc" warnings 2016-05-05 12:47:21 -05:00
Daniel Thayer
da6611e3c2 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-improvements 2016-05-05 11:33:57 -05:00
Seth Hall
d9d579c52c Merge remote-tracking branch 'origin/master' into topic/seth/stats-improvement 2016-05-02 14:34:29 -04:00
Johanna Amann
86836c0bb8 Merge remote-tracking branch 'origin/master' into topic/johanna/netcontrol-improvements 2016-05-02 11:23:36 -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
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
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
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
Seth Hall
9aa9618473 Additional mime types for file identification and a few fixes.
Some of the existing mime types received extended matchers
to fix problems with UTF-16 BOMs.

New file mime types:
 - .ini files
 - MS Registry policy files
 - MS Registry files
 - MS Registry format files (e.g. DESKTOP.DAT)
 - MS Outlook PST files
 - Apple AFPInfo files

Mime type fixes:
 - MP3 files with ID3 tags.
 - JSON and XML matchers were extended
2016-04-14 10:06:58 -04:00
Daniel Thayer
cca9a6616e Split the broker main.bro into two scripts
Separate the former BrokerComm and BrokerStore portions of the script
because these files will be much larger when script wrappers for BIFs are
written.
2016-03-30 20:32:36 -05:00
Daniel Thayer
f46dfac63a Rename the BrokerStore namespace to Broker 2016-03-30 16:39:19 -05:00
Daniel Thayer
9f5c820c7b Rename the BrokerComm namespace to Broker 2016-03-30 14:31:25 -05:00
Jan Grashoefer
2ebac70782 Added remove function to intel-framework. 2016-03-30 20:03:07 +02:00
Johanna Amann
ee132b6da4 NetControl: fix acld whitelist command 2016-03-24 15:21:36 -07:00
Johanna Amann
34ad4cf638 NetControl: add rule exists as state besides added and failure.
Rules that are already existing will, by default, not automatically be
timed out by NetControl.
2016-03-24 15:06:07 -07:00
Jan Grashoefer
cafae5351b Added support for subnets to intel-framework.
The intel-framework now supports the new indicator type Intel::SUBNET.
As subnets are matched against seen addresses, the field matched was
introduced to indicate which indicator types caused the hit. A testcase
for subents was added and the old ones have been updated accordingly.
2016-03-22 19:16:51 +01:00
Jan Grashoefer
06faee2cc8 Merge branch 'master' into topic/jgras/intel-update 2016-03-22 18:06:09 +01:00