Commit graph

17337 commits

Author SHA1 Message Date
Robin Sommer
83bd6584ee Enabling record coercion for a table's &default attribute. 2011-03-08 16:27:07 -08:00
Robin Sommer
51f9cb2ac5 Updating test baseline after fixing an older bug in previous commit. 2011-03-08 16:26:31 -08:00
Seth Hall
03044c329e Initial movement towards rewritten ftp.bro script.
* All NOTICE functionality is currently removed.
* All "hot" functionality is removed.
2011-03-08 17:01:29 -05:00
Don Appleman
723b46a410 Merge branch 'topic/policy-scripts' of git://git.icir.org/bro into topic/policy-scripts 2011-03-07 14:49:24 -06:00
Don Appleman
fd3ba87cae Initial drop of updated ssl.bro 2011-03-07 14:48:35 -06:00
Don Appleman
2c975495d3 Initial drop of updated ssl.bro 2011-03-07 14:46:23 -06:00
Seth Hall
d19da7a60a More script updates.
* Removed terminate-connection.bro
  as a dependency on notice-actions-filters.bro
* geo_location type now has full set of defaults.
* Many conn.bro logged variables are now optional
  instead of having defaults.
* Many updates to the notice.bro script.  Probably
  many more to come.  Mostly involved with
  modernizing it by extracting functionality,
  reducing chained dependencies, and modularization.
* Updated used Notice API in ssh.bro to the
  modified notice.bro script.
2011-03-07 15:28:34 -05:00
Seth Hall
523b078f0e Small issues fixed with new ssh analysis script.
* DPD is no longer required for it to function.
* $remote_location is made optional for easier logging.
* Added functions for generic threshold tracking.
2011-03-07 15:23:31 -05:00
Seth Hall
9ef42a64c0 Moved some files into the new policy directory. 2011-03-07 15:03:39 -05:00
Robin Sommer
d6cef16f77 Rotation support.
This follows rather closely how rotation currently works in
rotate-logs.bro. logging.bro now defines:

        # Default rotation interval; zero disables rotation.
        const default_rotation_interval = 0secs &redef;

        # Default naming suffix format.
        const default_rotation_date_format = "%y-%m-%d_%H.%M.%S" &redef;

        # Default postprocessor for writers outputting into files.
        const default_rotation_postprocessor = "" &redef;

        # Default function to construct the name of the rotated file.
        # The default implementation includes
        # default_rotation_date_format into the file name.
        global default_rotation_path_func: function(info: RotationInfo) : string &redef;

Writer support for rotation is optional, usually it will only make
sense for file-based writers.

TODO: Currently, there's no way to customize rotation on a per file
basis, there are only the global defaults as described above.
Individual customization is coming next.
2011-03-06 19:32:44 -08:00
Jon Siwek
1bad6e3a95 Changes to auto-document dpd_config (port analysis) script settings. 2011-03-05 16:11:26 -06:00
Jon Siwek
0d7ffe998f Debugging output from doc-framework now only in debug mode.
Also a minor format fix for documenting empty string lists.
2011-03-05 14:22:06 -06:00
Jon Siwek
27996cf9e0 Merge branch 'master' into topic/jsiwek/doc-framework 2011-03-05 13:59:18 -06:00
Seth Hall
68d4e612f1 Rework of conn.bro.
Many changes have happened:
 * FTP and portmapper functionality is no longer
   tied to the conn.bro script.
 * All of the "hot" functionality has been broken
   out into a separate script for future rework.
 * Conn.bro now targets the logging framework.
2011-03-04 23:16:38 -05:00
Robin Sommer
90af0d06c3 A first test for remote logging.
Needs the updated btest, which has two new scripts for running
processes in the background.
2011-03-03 21:47:08 -08:00
Robin Sommer
3f413a2539 Remote logging for the new logging framework.
It works with a simple example, but that's as much testing as it has
seen so far.

Remote::Destination has a new attribute "request_logs: bool"
indicating whether we are interested in the peer's log. Default is
false. If true, Bro will send an explicit "I want your logs" message
over to the other side, which will then start sending log records
back.

When such log records are received, they will be recorded exactly in
the same way as on the remote side, i.e., same fields/writer/path. All
filtering is already performed on the remote side.

Log::Filter has two new attributes, "log_local: bool" and
"log_remote: bool" (both true by default). If log_local is false, this
filter will not record anything locally but still process everything
normally otherwise and potentially forward to remote. If log_remote is
false, this filter will never send anything to remote even if a peer
has requested logs. (Note that with the defaults, requesting logs will
mean getting everything.)

Note that with log forwarding, *both* sides must create the
Filter::Stream. If the remote sends log records for a specific stream,
but the local side hasn't created it, the data will be discarded.
Filtes on the other hand shouldn't created locally; and if they are,
they are ignored for records received from remote).
2011-03-03 16:45:29 -08:00
Robin Sommer
c94b13ad39 Merge remote branch 'origin/fastpath'
* origin/fastpath:
  Add alternative way to set BROPATH for running bro from build/ dir.
2011-03-02 13:46:33 -08:00
Jon Siwek
f7d031ed60 Merge remote-tracking branch 'origin/master' into topic/jsiwek/doc-framework 2011-03-02 14:54:06 -06:00
Jon Siwek
abd92115f4 Add alternative way to set BROPATH for running bro from build/ dir.
Adds two extra shell scripts, one to handle either the c-shell
or bourne-shell syntax for setting environment variables, that can
be sourced in order to set the BROPATH directly in the current
shell/environment in a way that's compatible with running bro
from the build/ directory.
2011-03-02 14:14:07 -06:00
Jon Siwek
0b0c3f6ede Merge branch 'master' into fastpath 2011-03-02 12:55:17 -06:00
Don Appleman
ac99ec23aa Modernized known-services.bro 2011-03-02 11:26:54 -06:00
Don Appleman
1a327cd355 Moved events for filling in connection service field to dpd.bro 2011-03-02 11:25:24 -06:00
Robin Sommer
c355f5d1fa Adding options to enable/disable local and remote logging.
Only the local option has an effect right now.

Also moving Log::default_writer out of the bif into logging.bro.
2011-03-01 17:13:50 -08:00
Seth Hall
d2e3328b91 Moved "@load logging" to the functions files. 2011-03-01 17:45:19 -05:00
Seth Hall
2900f6bcee Merge branch 'topic/logging-framework' into topic/policy-scripts 2011-03-01 17:36:25 -05:00
Seth Hall
ef5aba6f5f Merge branch 'master' into topic/logging-framework
Conflicts:
	src/builtin-func.l
2011-03-01 17:36:05 -05:00
Seth Hall
04c5c21705 Adapted known-hosts for the logging framework. 2011-03-01 17:34:27 -05:00
Seth Hall
fe85a3e4d2 Adapted for API similarity with Robin's logging framework code. 2011-03-01 17:17:48 -05:00
Seth Hall
e7079aefab Added site as a dependency in the functions file. 2011-03-01 11:47:48 -05:00
Seth Hall
60e66f3227 Added site.bro as another dependency to policy directory. 2011-03-01 11:45:23 -05:00
Seth Hall
600c5bedea Moved some base script dependencies to the new policy directory. 2011-03-01 11:41:07 -05:00
Seth Hall
517456a2df Added and rewrote known-hosts.bro
Created a functions.bro file to add various
reusable functionality.
2011-03-01 11:31:42 -05:00
Seth Hall
62613ec1a0 Moved policy script directory to policy.old 2011-03-01 10:51:44 -05:00
Robin Sommer
d673c8c64c Adding a new RecordVal method LookupWithDefault().
The method honors a potential &default attribute, and refs the Val it
returns.
2011-02-28 22:20:29 -08:00
Robin Sommer
ba2c6f6139 Internal refactoring to provide injection points for remotely received
log records.

Also added some additional type-safety check to later make sure that
what a peer sends is actually of the expected format.
2011-02-28 21:52:56 -08:00
Robin Sommer
e6edc52d54 Moving the map of writers from the filters to the streams.
This is in preparation for remote logging.
2011-02-28 18:24:19 -08:00
Robin Sommer
e5d3654266 Updating submodule(s). 2011-02-28 15:39:24 -08:00
Robin Sommer
a770d80f6b Merge remote branch 'origin/fastpath'
* origin/fastpath:
  Fixing compiler warnings
  Revert "Updating submodule to current master"
  Remvoing leftover local variables that caused compile error on Mac OS X.
  Updating submodule to current master
2011-02-28 15:38:29 -08:00
Robin Sommer
ab15437339 Working on the logging API exposed to scripts.
- Moving all functions into the Log::* namespace, using the recent
  bifcl updates. Moved logging-specific stuff to logging.bif.

- Log::create_stream() now takes a record Log::Stream as its second
  argument, which specifies columns and (optionally) the event.

- All the internal BiFs are now called "Log::__<something>", with
  script-level wrappers "Log::<something>". That first allows to add
  additional code at the script-level, and second makes things better
  comprehendible as now all relevant functionality is collected (and
  later documetned) in policy/logging.bro.

- New function Log::flush(id), which does the obvious assuming the
  writer supports it.

- add_default_filter() is now called implicitly with every
  create_stream(). Seems that we usually want that functionality, and
  when not, remove_default_filter() gets rid of it.

- The namespace of a stream's ID is now used as the default "path"
  (e.g., if the namespace is SSH, the default log file is "ssh.log").

- Updated policy/test-logging.bro as well as the btest tests according
  to these changes.
2011-02-27 15:09:37 -08:00
Gregor Maier
fc6fcded07 Fixing compiler warnings 2011-02-25 21:15:22 -08:00
Gregor Maier
c54c1e0dce Revert "Updating submodule to current master"
This reverts commit 8b42bfed7c.
Master seems to have outdated submodules. Reverting to previous ones on
fastpath.
2011-02-25 21:11:06 -08:00
Gregor Maier
7d822e232d Remvoing leftover local variables that caused compile error on Mac OS X. 2011-02-25 21:09:55 -08:00
Gregor Maier
b6fd317dcc Merge remote branch 'origin/master' into fastpath 2011-02-25 20:44:05 -08:00
Gregor Maier
8b42bfed7c Updating submodule to current master 2011-02-25 20:43:53 -08:00
Robin Sommer
ff740f153c Fixing file detector leak in remote communication module.
This addresses #400.
2011-02-25 17:04:29 -08:00
Robin Sommer
2a82e0bd9b Updating indenpdentn state tests to work with new setyp.
Note that the broccoli test does currently not pass because of the
64-bit changes.
2011-02-25 17:01:11 -08:00
Robin Sommer
e3b2748fa6 Merge remote branch 'origin/master' into topic/robin/logging-internals
Conflicts:
	policy/bro.init
	src/builtin-func.l
2011-02-25 16:11:03 -08:00
Robin Sommer
226eeb9729 Updating submodule(s). 2011-02-25 15:49:08 -08:00
Robin Sommer
3527daea5b Updating submodule(s). 2011-02-25 15:48:31 -08:00
Robin Sommer
12139e9faf Merge remote branch 'origin/topic/gregor/bif-tuning'
* origin/topic/gregor/bif-tuning:
  Refactor: BifTypePtr --> BifType
  Bif const: make sure const is indeed a constant.
  Support any type in bif const declaration.
  Tweak for bifcl
  Fix to bifcl wrt namespaces.
  Enable declaration of set, vector, and table types in bifs.
  Moving type declarations into its own bif file
  Support namespaces / modules in bif. Checkpoint.
  Support namespaces / modules in bif. Checkpoint.
  Remove leftovers from removing "declare enum" from bifcl
  Use namespaces for NetVar type pointers.
  Remove unused and unnecessary "declare enum" from bifcl
  Bif: add record type declaration.
  Minor tweaks for bif language.
  enum type: don't allow mixing of explicit value and auto-increment.
  Add support for enum with explicit enumerator values.

Closes #403.
2011-02-25 15:41:56 -08:00