Commit graph

202 commits

Author SHA1 Message Date
Robin Sommer
9efd54a08a Merge remote-tracking branch 'origin/topic/dnthayer/ticket1440'
* origin/topic/dnthayer/ticket1440:
  Remove build dependency on perl
2015-08-07 13:10:08 -07:00
Robin Sommer
3957091e1b Renaming config.h to bro-config.h.
A couple times now I had this conflicting with files of the same name
in other projects.
2015-07-28 11:57:04 -07:00
Robin Sommer
93846d428f Requiring a C++11 compiler, and turning on C++11 support. 2015-07-21 13:19:18 -07:00
Seth Hall
da24fa40a5 Easier support for systems with tcmalloc_minimal installed. 2015-04-26 00:40:31 -04:00
Robin Sommer
dfc88094ab Merge remote-tracking branch 'origin/topic/jsiwek/broker'
* origin/topic/jsiwek/broker: (34 commits)
  Update broker submodule.
  Update broker submodule.
  broker integration: add missing baselines for doc tests
  broker integration: add prof.log statistics
  broker integration: add high-level usage documentation
  broker integration: add API documentation (broxygen/doxygen)
  broker integration: fix memory leak, add leak tests
  Update broker submodule.
  Improve comm tests.
  Fix gcc compile warnings.
  broker integration: fix unit tests to work when broker is not enabled.
  Add --enable-c++11 configure flag.
  broker integration: add (un)publish/(un)advertise functions
  broker integration: add knobs to set auto publish/advertise behavior
  broker integration: move listen port for unit tests to a btest variable
  broker integration: add events for incoming connection status updates
  broker integration: adapt to change in expiration_time
  Update coverage unit test baselines.
  broker integration: add Comm::enable function
  broker integration: process debug/diagnostic reports from broker
  ...

Conflicts:
	cmake
	testing/btest/Baseline/plugins.hooks/output
2015-03-02 17:10:15 -08:00
Robin Sommer
ff16f6215a Removing setting installation plugin path from bro-path-dev.sh .
Also, adding to existing BRO_PLUGIN_PATH rather than replacing.

Addresses #1312
2015-02-16 12:49:54 -08:00
Jon Siwek
fc36777e66 Add --enable-c++11 configure flag.
And try to detect that compiler version is sufficient for C++11 support.
--enable-broker implies --enable-c++11
2015-02-10 12:34:47 -06:00
Jon Siwek
1e8d6cd917 broker integration: add API for connecting to peers 2015-01-13 17:14:21 -06:00
Jon Siwek
7120098ca2 Add support for building/linking broker within bro
The new --enable-broker flag can be used to toggle the use of Broker,
which also implies building with -std=c++11, though nothing makes
use of these features at the moment.
2015-01-08 16:43:07 -06:00
Jon Siwek
d8890ea009 Increase minimum required CMake version to 2.8. 2015-01-08 13:11:17 -06:00
Daniel Thayer
e4c9c58b9e Add man page for Bro 2014-12-01 20:58:37 -06:00
Jon Siwek
121fcdbb5b Fix build on systems that already have ntohll/htonll
BIT-1234 #close
2014-08-22 19:56:27 -05:00
Jon Siwek
e7f10755c8 Merge remote-tracking branch 'origin/topic/robin/reader-writer-plugins'
* origin/topic/robin/reader-writer-plugins:
  Adding plugin testing to Makefile's test-all.
  Fixing tests.
  Removing DataSeries and ElasticSearch from configure script.
  Updating submodule.
  Move DataSeries and ElasticSearch into plugins.
  More polishing of some of the branche's changes.
  More polishing.
  Test case for a dynamic input reader.
  Test case for a dynamic log writer.
  Final fixes, preparing for merge.
  Converting log writers and input readers to plugins.

BIT-1222 #merged
2014-08-21 16:04:13 -05:00
Robin Sommer
f4cbcb9b03 Converting log writers and input readers to plugins. 2014-07-20 19:17:58 +02:00
Robin Sommer
9616cd8e61 Further polishing and cleanup in preparation for merge. 2014-07-12 18:12:09 -07:00
Robin Sommer
bbd409d274 Merge remote-tracking branch 'origin/master' into topic/robin/dynamic-plugins-2.3
(Never good to name a branch after version anticipated to include it ...)
2014-05-14 16:23:04 -07:00
Jon Siwek
bebedcd873 Merge branch 'master' into topic/jsiwek/file-signatures
Conflicts:
	scripts/policy/frameworks/files/detect-MHR.bro
2014-03-24 14:35:37 -05:00
Jon Siwek
ea432102a8 Teach configure script --enable-jemalloc, --with-jemalloc.
Addresses BIT-1128.
2014-03-10 14:36:42 -05:00
Jon Siwek
b22ca5d0a3 Replace libmagic w/ Bro signatures for file MIME type identification.
Notable changes:

- libmagic is no longer used at all.  All MIME type detection is
  done through new Bro signatures, and there's no longer a means to get
  verbose file type descriptions (e.g. "PNG image data, 1435 x 170").
  The majority of the default file magic signatures are derived
  from the default magic database of libmagic ~5.17.

- File magic signatures consist of two new constructs in the
  signature rule parsing grammar: "file-magic" gives a regular
  expression to match against, and "file-mime" gives the MIME type
  string of content that matches the magic and an optional strength
  value for the match.

- Modified signature/rule syntax for identifiers: they can no longer
  start with a '-', which made for ambiguous syntax when doing negative
  strength values in "file-mime".  Also brought syntax for Bro script
  identifiers in line with reality (they can't start with numbers or
  include '-' at all).

- A new Built-In Function, "file_magic", can be used to get all
  file magic matches and their corresponding strength against a given
  chunk of data

- The second parameter of the "identify_data" Built-In Function
  can no longer be used to get verbose file type descriptions, though it
  can still be used to get the strongest matching file magic signature.

- The "file_transferred" event's "descr" parameter no longer
  contains verbose file type descriptions.

- The BROMAGIC environment variable no longer changes any behavior
  in Bro as magic databases are no longer used/installed.

- Reverted back to minimum requirement of CMake 2.6.3 from 2.8.0
  (it's back to being the same requirement as the Bro v2.2 release).
  The bump was to accomodate building libmagic as an external project,
  which is no longer needed.

Addresses BIT-1143.
2014-03-04 11:12:06 -06:00
Jon Siwek
90026f7196 Update to libmagic version 5.17, address BIT-1136. 2014-02-19 10:32:27 -06:00
Robin Sommer
3f47c5bc87 Merge remote-tracking branch 'origin/master' into topic/robin/dynamic-plugins-2.3 2014-01-24 20:26:00 -08:00
Robin Sommer
ea01a1be30 Reworking plugin interface to not rely on macros.
The Plugin.cc file is now just a standard class, with the interface
changed a bit to make it more easy to write. However, there're still
some conventions that one must follow to make everything work (like
using the right namespace structure).

This commit also includes the option to compile built-in plugins
dynamically instead of statically by adding
SET(BRO_PLUGIN_BUILD_DYNAMIC TRUE) to their CMake config. This hasn't
been tested much yet, and I'm still undecided if it's somethign we
would want to do by default--but we could now if wanted. :)

Also some minor other cleanup of plugin APIs and built infrastructure.

All tested on MacOS only currently.
2014-01-20 13:39:11 -08:00
Jon Siwek
0c7ffe74ee Don't use LOG_* options to ExternalProject_Add if not supported.
They're in CMake 2.8.3 and greater, but not strictly necessary for the
build to work -- they just make build output a bit nicer.
2014-01-15 15:42:18 -06:00
Jon Siwek
c48c531629 Integrate libmagic 5.16 via CMake ExternalProject.
- Bumps CMake requirement to CMake 2.8.
- Bro now always relies on builtin/shipped magic library/database.
2014-01-15 14:19:29 -06:00
Robin Sommer
a80dd10215 Updates of the dynamic plugin code.
Includes:

    - Cleanup of the plugin API, in particular generally changing
      const char* to std::string

    - Renaming environment variable BRO_PLUGINS to BRO_PLUGIN_PATH,
      defaulting to <prefix>/lib/bro/plugins

    - Reworking how dynamic plugins are searched and activated. See
      doc/devel/plugins.rst for details.

    - New @load-plugin directive to explicitly activate a plugin

    - Support for Darwin. (Linux untested right now)

    - The init-plugin updates come with support for "make test", "make
      sdist", and "make bdist" (see how-to).

    - Test updates.

Notes: The new hook mechanism, which allows plugins to hook into Bro's
core a well-defined points, is still essentially untested.
2013-12-16 11:57:56 -08:00
Robin Sommer
e9413c9361 New default for plugin installation path. 2013-12-12 16:50:56 -08:00
Robin Sommer
555df1e7ea Checkpointing the dynamic plugin code.
This is essentially the code from the dynamic-plugin branch except for
some pieces that I have split out into separate, earlier commits.

I'm going to updatre things in this branch going forward.
2013-11-26 14:04:29 -08:00
Jon Siwek
f18436640e Flesh out Broxygen doc-gathering skeleton. 2013-10-22 14:45:47 -05:00
Daniel Thayer
fdc364084b Fix cmake warning about ENABLE_PERFTOOLS not being used 2013-09-16 17:45:21 -05:00
Jon Siwek
99d604c9b5 Make the custom libmagic database a git submodule.
The magic files couldn't be in the root of that repo or else
libmagic would abort when it ran in to the .git* files and tried
to treat them like magic files, too.
2013-07-10 14:06:51 -05:00
Jon Siwek
037d582b0e FileAnalysis: add custom libmagic database.
- It's derived from the magic database of libmagic 5.14, but with most
  everything not related to mime types removed.

- The custom database is always used by default for mime detection, but
  the more verbose file type detection will fall back on the default
  libmagic installation's database.  The result is: mime type strings
  are now guaranteed to be consistent across platforms, but the verbose
  file type descriptions are not.

- The custom database gets installed in $prefix/share/bro/magic, and
  should even be extensible if files with new patterns are added inside
  the directory.

- The search path for the mime magic database can be controlled via
  BROMAGIC environment variable.

- Remove mime_desc field from ftp.log.

- Stop using the mime/file type canonifier with unit tests.

- libmagic >= 5.04 is now a requirement.
2013-04-12 11:58:19 -05:00
Jon Siwek
7758f4dc9c Bump CPack RPM package requirement to python >= 2.6.0. 2012-12-04 12:45:52 -06:00
Jon Siwek
c69431beac Teach --disable-dataseries/--disable-elasticsearch to ./configure.
Addresses #877.
2012-10-08 16:45:04 -05:00
Jon Siwek
6caeb7d7cf Add --with-curl option to ./configure, addresses #877. 2012-10-08 16:27:15 -05:00
Jon Siwek
cc49193f93 Remove automatic use of gperftools on non-Linux systems.
--enable-perftools must now explicity be supplied to ./configure on
non-Linux systems to link against the tcmalloc library that a
gperftools installation provides.  Linux systems still automatically
link it if it's found.  The rationale is that gperftools was developed
and most throroughly tested on Linux so it's safer there.

There especially seems to be potential problems with gperftools on OS X
(e.g. see http://code.google.com/p/gperftools/issues/detail?id=413),
and Bro currently doesn't work with gpertools there using clang or gcc.
2012-08-28 13:11:12 -05:00
Robin Sommer
eef8b7d1c4 Merge remote-tracking branch 'remotes/origin/topic/seth/elasticsearch' into topic/robin/master-test
I've only tested that it compiles, not whether it still works. The
fact that we don't have any tests for this makes me uneasy ...

* remotes/origin/topic/seth/elasticsearch: (35 commits)
  Some documentation updates for elasticsearch plugin.
  Temporarily removing the ES timeout because it works with signals and is incompatible with Bro threads.
  Changed ES index names to localtime and added a meta index.
  New script for easily duplicating logs to ElasticSearch.
  Some better elasticsearch reliability.
  Fixed small elasticsearch problem in configure output.
  Re-adding the needed call to FinishedRotation in the ES writer plugin.
  Tiny updates.
  Bringing elasticsearch branch up to date with master.
  Adding a define to make the stdint C macros available.
  Adding an extra header.
  Fixed a bug with messed up time value passing to elasticsearch.
  Small updates and a little standardization for config.h.in naming.
  Bug fixes.
  Bug fix and feature.
  Forgot to call the parent method for DoHeartBeat.
  Changed the escaping method.
  Flush logs to ES daemon as Bro is shutting down.
  Reduce the batch size to 1000 and add a maximum time interval for batches.
  Reworked bulk operation string construction to use ODesc and added json escaping.
  ...
2012-07-20 07:43:05 -07:00
Robin Sommer
7fde1165e9 Give configure a --disable-perftools option.
This disables Perftools support even if found. Linking in tcmalloc can
make debugging memory problems quite a bit hard (including confusing
valgrind).
2012-07-19 22:28:55 -07:00
Seth Hall
5d04d58385 Fixed small elasticsearch problem in configure output. 2012-07-17 13:57:23 -04:00
Seth Hall
cb7eac212e Small updates and a little standardization for config.h.in naming. 2012-06-17 22:55:11 -04:00
Vlad Grigorescu
d3bb4617e9 Configuration logic - if libcurl is found, enable elasticsearch plugin. 2012-06-15 11:21:24 -04:00
Vlad Grigorescu
7bee0b0d8e Added sending messages to ElasticSearch over HTTP. 2012-06-03 22:07:20 -04:00
Robin Sommer
a7bc12066b Merge remote-tracking branch 'origin/master' into topic/robin/dataseries
Conflicts:
	CMakeLists.txt
	cmake
2012-04-17 16:37:37 -07:00
Jon Siwek
8e2ce1d350 Fix CMake from warning about unused ENABLE_PERFTOOLS_DEBUG variable.
The variable was never "used" in the case google perftools was not
found, so CMake warned about it being unused since it was manually
specified as a cache variable in the configure script.  There might
be a better way to organize that, but this is a quick/easy hack.
2012-04-05 11:41:14 -05:00
Robin Sommer
952b6b293a Merging in DataSeries support from topic/gilbert/logging.
I copied the code over manually, no merging, because (1) it needed to
be adapted to the new threading API, and (2) there's more stuff in the
branch that I haven't ported yet.

The DS output generally seems to work, but it has seen no further
testing yet.

Not unit tests yet either.
2012-04-03 22:14:56 -07:00
Robin Sommer
42066cc1fd Teaching cmake to always link in tcmalloc if it finds it.
Also renaming --enable-perftools to --enable-perftool-debug to
indicate that the switch is only relevant for debugging the heap. It's
not needed to pick up tcmalloc for better performance.

--with-perftools can still (and always) be used to give a hint where
to find the libraries.

With the threading, using tcmalloc improves memory usage on FreeBSD
significantly when running on a trace. If it fixes the live problems,
remains to be seen ...
2012-03-28 15:42:09 -07:00
Jon Siwek
b552979011 Raise minimum required CMake version to 2.6.3 2012-02-24 13:14:49 -06:00
Jon Siwek
d750c3ba74 Promote libz and libmagic to required dependencies. 2011-11-11 12:39:00 -06:00
Jon Siwek
22a89011a5 Update to use cmake submodule 2011-09-20 10:15:09 -05:00
Robin Sommer
fbe6356927 Install binaries with an RPATH.
Note, I didn't see the topic/jsiwek/cmake-rpath branch in the Bro
repository so I copied the change from the submodules, assuming it
applies in the same way.
2011-09-04 09:00:55 -07:00
Robin Sommer
1ca9def9e6 Merge remote-tracking branch 'origin/topic/jsiwek/autodoc-fixes'
* origin/topic/jsiwek/autodoc-fixes:
  Update doc sources and touch up a few script comments.
  Fixes for script auto-documentation.

Conflicts:
	scripts/base/frameworks/logging/main.bro
2011-08-13 12:09:13 -07:00