Commit graph

645 commits

Author SHA1 Message Date
Daniel Thayer
1d98a99ccf Update install instructions for Ubuntu 18.04 2018-05-01 15:24:52 -05:00
Jon Siwek
4e9a8e02e0 BIT-1430: Improve cross compilation support
* Add --toolchain= configure option

* Add --with-bifcl= configure option

* Change --with-binpac= configure option to mean "path to binpac
  executable"

* Add an example of how to use the above options for cross compiling
  Bro to the docs
2018-04-27 11:04:31 -05:00
Daniel Thayer
8fe998c5f7 Fix one new minor typo in the config framework docs 2018-03-15 18:52:08 -05:00
Robin Sommer
31a48bf4ad Merge remote-tracking branch 'origin/topic/dnthayer/ticket1905'
Includes slight editing of the new text.

Closes BIT-1905.

* origin/topic/dnthayer/ticket1905:
  Add documentation of the configuration framework
  Add documentation of "option" declarations
  Improve config framework documentation comments
  Fix minor typos and doc build warnings in NEWS
2018-03-15 14:54:43 -07:00
Daniel Thayer
8aeedba066 Add documentation of the configuration framework 2018-03-15 14:50:42 -05:00
Daniel Thayer
79afd99229 Add documentation of "option" declarations 2018-03-15 14:29:26 -05:00
Daniel Thayer
45cc4d0e2f Fix another warning when building the documentation 2018-02-14 18:43:34 -06:00
Johanna Amann
db6f028003 Add config framework.
The configuration framework consists of three mostly distinct parts:

* option variables
* the config reader
* the script level framework

I will describe the three elements in the following.

Internally, this commit also performs a range of changes to the Input
manager; it marks a lot of functions as const and introduces a new
ValueToVal method (which could in theory replace the already existing
one - it is a bit more powerful).

This also changes SerialTypes to have a subtype for Values, just as
Fields already have it; I think it was mostly an oversight that this was
not introduced from the beginning. This should not necessitate any code
changes for people already using SerialTypes.

option variable
===============

The option keyword allows variables to be specified as run-tine options.
Such variables cannot be changed using normal assignments. Instead, they
can be changed using Option::set. It is possible to "subscribe" to
options and be notified when an option value changes.

Change handlers can also change values before they are applied; this
gives them the opportunity to reject changes. Priorities can be
specified if there are several handlers for one option.

Example script:

option testbool: bool = T;

function option_changed(ID: string, new_value: bool): bool
  {
  print fmt("Value of %s changed from %s to %s", ID, testbool, new_value);
  return new_value;
  }

event bro_init()
  {
  print "Old value", testbool;
  Option::set_change_handler("testbool", option_changed);
  Option::set("testbool", F);
  print "New value", testbool;
  }

config reader
=============

The config reader provides a way to read configuration files back into
Bro. Most importantly it automatically converts values to the correct
types. This is important because it is at least inconvenient (and
sometimes near impossible) to perform the necessary type conversions in
Bro scripts themselves. This is especially true for sets/vectors.

Configuration generally look like this:

[option name][tab/spaces][new variable value]

so, for example:

testaddr 2607:f8b0:4005:801::200e
testinterval 60
testtime 1507321987
test_set a	b	c	d	erdbeerschnitzel

The reader uses the option name to look up the type that variable has in
the Bro core and automatically converts the value to the correct type.

Example script use:

type Idx: record {
  option_name: string;
};

type Val: record {
  option_val: string;
};

global currconfig: table[string] of string = table();

event InputConfig::new_value(name: string, source: string, id: string, value: any)
  {
  print id, value;
  }

event bro_init()
  {
  Input::add_table([$reader=Input::READER_CONFIG, $source="../configfile", $name="configuration", $idx=Idx, $val=Val, $destination=currconfig, $want_record=F]);
  }

Script-level config framework
=============================

The script-level framework ties these two features together and makes
them a bit more convenient to use. Configuration files can simply be
specified by placing them into Config::config_files. The framework also
creates a config.log that shows all value changes that took place.

Usage example:

redef Config::config_files += {configfile};

export {
  option testbool : bool = F;
}

The file is now monitored for changes; when a change occurs the
respective option values are automatically updated and the value change
is written to config.log.
2017-11-29 13:46:59 -08:00
Christian Kreibich
3accfabdfe Minor Bro docs tweaks for correctness and readability
- The protocol seemed to be missing from two frame inclusions, throwing an
  error message when viewing the page locally. Add "https:".

- Reduce whitespace around inline code blocks, where 2em seems really
  large.
2017-10-23 15:21:28 -07:00
Robin Sommer
09486c9062 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Update install instructions for Fedora 26
2017-08-07 07:42:04 -07:00
Daniel Thayer
7242aada0c Update install instructions for Fedora 26 2017-08-01 15:54:26 -05:00
Johanna Amann
9594f69598 SSL: Update OCSP/SCT scripts and documentation. 2017-07-27 16:22:40 -07:00
Johanna Amann
a630c61f17 Remove another reference to now removed bro-plugins. 2017-07-11 09:56:33 -07:00
Robin Sommer
ffa7480ce4 Fix documentation build.
(I had these locally, but not yet commited.)
2017-07-07 14:35:38 -07:00
Daniel Thayer
d7e9060f96 Update install instructions for Debian 9 2017-07-07 14:05:14 -05:00
Johanna Amann
303c50e867 Remove link to no longer existing myricom plugin. 2017-06-13 11:01:24 -07:00
Johanna Amann
f5d9f1847f Remove non-existing links; this broke documentation build. 2017-06-05 15:16:45 -07:00
Seth Hall
b3d7d8b1da Documentation updates for loading Bro scripts. 2017-04-17 12:09:18 -04:00
Daniel Thayer
2347be3092 Improve the "How to Upgrade" page in the Bro docs
Added some text to clarify the procedure (it now reads more like
a step-by-step guide to upgrading).
2016-11-09 14:55:55 -06:00
Daniel Thayer
0db028ea91 Update the quickstart guide for the deploy command
Also removed some redundant info about setting up a broctl cron job,
which is already explained in detail in the broctl documentation.
2016-11-09 14:35:12 -06:00
Daniel Thayer
3057d2b8fb Fix various typos in the NetControl docs
Also fixed warnings that were seen while building the docs
with "make doc".
2016-11-08 15:25:28 -06:00
Daniel Thayer
261c6907d8 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-fixes-updates 2016-11-07 13:47:45 -06:00
Daniel Thayer
0fc0a89e4a Python 3 compatibility fixes for doc/ext/bro.py 2016-10-29 15:16:42 -05:00
Daniel Thayer
99a898b6ae Update install instructions
Removed some outdated info, and improved the section for Mac OS X.
2016-10-27 16:35:43 -05:00
Johanna Amann
af1d7d1f21 correct elasticsearch link in plugins 2016-10-27 09:14:53 -07:00
Robin Sommer
0d37c0df7b Fix for Sphinx >= 1.4 compability. 2016-10-27 09:00:34 -07:00
Daniel Thayer
d1ec71b132 List new log files in the log-files.rst document 2016-10-08 00:32:51 -05:00
Robin Sommer
d9ba7ea0dd Fixing documentation piece.
The interesting-hostname script has changed.
2016-10-06 14:28:52 -07:00
Johanna Amann
7f740d0d3b Update documentation license 2016-10-06 11:35:31 -07:00
Johanna Amann
3ef14000f3 Make elasticsearch orphaned instead of deprecated.
Addresses BIT-1617
2016-09-26 10:33:13 -07:00
Johanna Amann
46aafdc87b Merge branch 'patch-4' of https://github.com/moshekaplan/bro
* 'patch-4' of https://github.com/moshekaplan/bro:
  Clarified string documentation
2016-09-19 15:28:39 -07:00
Moshe Kaplan
ca46edbb42 Clarified string documentation 2016-09-14 15:15:56 -04:00
Johanna Amann
55f99c0da9 Fix sphinx build errors 2016-08-17 09:16:16 -07:00
Robin Sommer
84b372a772 Merge remote-tracking branch 'origin/topic/johanna/rule-reasons'
BIT-1655 #merged

* origin/topic/johanna/rule-reasons:
  NetControl: allow reasons in remove_rule calls.
2016-08-05 18:48:19 -07:00
Seth Hall
f0bce636cf Merge remote-tracking branch 'origin/topic/dnthayer/ticket1627'
* origin/topic/dnthayer/ticket1627:
  Add a test for starting a cluster with a logger node
  Update broctl submodule
  Update broctl submodule to branch topic/dnthayer/ticket1627
  Change how logger node is detected in cluster framework
  Update test baselines for the new logger node type
  Update docs for the new logger node type
  Add a new node type for logging
2016-08-05 12:59:05 -04:00
Moshe Kaplan
b1e47eb71f Added String slicing (subscript) examples 2016-08-02 08:45:23 -04:00
Robin Sommer
f6ff7f1e66 Updating link in docs for deprecated plugin. 2016-07-23 07:29:32 -07:00
Daniel Thayer
7491cbc327 Merge remote-tracking branch 'origin/master' into topic/dnthayer/ticket1627 2016-07-14 18:17:03 -05:00
Johanna Amann
cdb6a1b6e6 Baseline updates after hash function change. 2016-07-13 10:11:37 -07:00
Daniel Thayer
1c1a6e60b0 Disable broker by default
Replaced the --disable-broker configure option with --enable-broker,
and changed the install docs to show CAF as an optional dependency.
2016-07-09 15:55:28 -05: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
Daniel Thayer
ce0b9d42d3 Update docs for the new logger node type 2016-06-30 15:45:36 -05: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
Robin Sommer
c74effad42 Clarifying notice documentation.
Closes BIT-1405.
2016-05-27 13:22:24 -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
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
da6611e3c2 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-improvements 2016-05-05 11:33:57 -05:00
Daniel Thayer
12eb7a380d Rename broker BIF wrapper functions in a few more places 2016-04-27 00:47:48 -05:00