Commit graph

65 commits

Author SHA1 Message Date
Seth Hall
f0b32b21ee weird.bro rewrite.
- I want to test it for a short while before committing it to
  master just to make sure it is a sane modification.
2011-10-21 14:08:54 -04:00
Seth Hall
43da40f2c6 Changed the notice name for interesting ssh logins to correctly reflect semantics of the notice.
- SSH::Login_From_Interesting_Hostname is now SSH::Interesting_Hostname_Login

- Added some documentation.
2011-10-21 14:03:03 -04:00
Seth Hall
8661abe9d9 Small script refinements and documentation updates. 2011-10-21 13:58:58 -04:00
Seth Hall
8627b87b3e Fixing another "field missing" error reported by Martin. 2011-10-08 00:13:20 -04:00
Seth Hall
0803df2e14 Changed communication option from listen_encrypted to listen_ssl.
- Robin pointed out that SSL is providing authentication
  as well as encryption so listen_ssl is a more
  proper variable name.
2011-10-07 23:57:08 -04:00
Seth Hall
8b90a3f403 Tiny comment tweak 2011-10-07 13:30:09 -04:00
Seth Hall
38bd2cc085 Documentation fix that was breaking a test. 2011-10-07 13:29:56 -04:00
Seth Hall
da9b8cc283 Modification to the Communication framework API.
- Simplified the communication API and made it easier to change
  to encrypted connections by not having separate variables to
  define encrypted and unencrypted ports.

- Now, to enable listening without configuring nodes just
  load the frameworks/communication/listen script.

- If encrypted listening is desired set the following:
	redef Communication::listen_encrypted=T;

- Accompanying test updates.
2011-10-07 13:29:26 -04:00
Seth Hall
a3e91c5b33 Fixed a bug in the known-hosts script. 2011-10-07 04:48:51 -04:00
Seth Hall
26290bb56c More script tuning
- Moved some of the weird events back to the base/ directory.

- Fixed more bugs with SSL certificate handling.
2011-10-04 17:06:45 -04:00
Seth Hall
dc47203cd7 Fixing the SSL analysis crashes differently. 2011-10-04 14:40:49 -04:00
Seth Hall
a649be6d9e Bug fix and style updates. 2011-10-04 14:36:31 -04:00
Seth Hall
5a45c246e5 Updates for known-certs.
- Fixed a crash.

- Made some other small style updates.
2011-10-04 14:32:11 -04:00
Seth Hall
5a04190ffe More adjustment to reduce Weird volumes.
- New script extracted from weird.bro to implement the
  connection related "weird" data into an optionally
  loaded script.

- Adjusted the default notice tuning to stop ignoring
  the connection related weirds since they aren't loaded
  by default anymore.
2011-10-04 13:58:55 -04:00
Seth Hall
04a9a0dc38 Fixed an error when calculating x509 certificate hashes (reported by Martin Holste). 2011-10-04 13:19:11 -04:00
Jon Siwek
870bdf796d Fix some of the coverage unit tests. 2011-10-03 16:57:29 -05:00
Seth Hall
549661bd11 Updates to improve SSL scripts.
- Certificate validation volume has been greatly cut down by
  caching results.

- Cert hashing is now done in one place instead of being repeated
  everywhere a cert hash was needed.

- Some small cleanups for notice suppression that should greatly reduce
  duplicate notice volume about invalid certificates.
2011-10-03 13:58:42 -04:00
Seth Hall
36dbaa5b92 Loaded scripts is indented with spaces now and makes more sense to look at.
- Updated a test to make it pass again.
2011-09-29 15:53:54 -04:00
Seth Hall
936e6ad746 Merge branch 'master' of ssh://git.bro-ids.org/bro 2011-09-29 13:07:37 -04:00
Seth Hall
0118621613 Taking advantage of yet another trick to get installed browser plugins.
- With the software-browser-plugins script you can watch for Omniture
  advertising servers to grab the list of installed plugins.

- I reorganized the plugin detection a bit too to abstract it better.

- Removed the WEB_ prefix from all of the Software::Type HTTP enums.
  They were essentially redundant due to the full name already being
  HTTP::SERVER (for example).
2011-09-29 13:07:28 -04:00
Robin Sommer
a84a422240 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Various unit test cleanup.
2011-09-28 16:54:23 -07:00
Seth Hall
9e2ddac572 Fixes for known-services.
- I was wildly misunderstanding the semantics of the
  connection_state_remove event.  That's fixed now in
  my brain and in the script.

- If a service isn't detected, logging is delayed by
  2 minutes to try and allow for another connection
  to happen that actually does the protocol correctly
  and detectably.
2011-09-28 12:51:44 -04:00
Seth Hall
6b52ca5222 Small changes for the capture-loss script make the output more understandable. 2011-09-28 11:19:15 -04:00
Seth Hall
6db77dc285 Ported the capture-loss script back into Bro.
- I removed the byte loss estimate since everything indicated that
  it could frequently be inaccurate.

- It has it's own logging stream now.  Notices are only used
  when too much loss has been detected (CaptureLoss::Too_Much_Loss)

- The gap_report event isn't used anymore.  I'm scheduling events
  to get the same effect by using the get_gap_summary BiF to
  collect the gap summary on demand.
2011-09-28 00:08:53 -04:00
Seth Hall
19f1e34408 Deleting scripts that aren't ready to be included.
- scan.bro and hot.conn.bro will be returning soon.

- The rest are going to return as updated protocol analysis
  scripts and new/updated frameworks later.
2011-09-27 14:40:11 -04:00
Jon Siwek
a71ab223c4 Various unit test cleanup.
Updated README and collected coverage-related tests in a common dir.

There are still coverage failures resulting from either the following
scripts not being @load'd in the default bro mode:

base/frameworks/time-machine/notice.bro
base/protocols/http/partial-content.bro
base/protocols/rpc/main.bro

Or the following result in errors when @load'd:

policy/protocols/conn/scan.bro
policy/hot.conn.bro

If these are all scripts-in-progress, can we move them all to live
outside the main scripts/ directory until they're ready?
2011-09-27 12:41:30 -05:00
Seth Hall
8710d3749f New SSL policy scripts.
- protocols/ssl/expiring-certs uses time based information from
  certificates to determine if they will expire soon, have already
  expired, or haven't yet become valid.

- protocols/ssl/extract-certs-pem is a script for taking certs off
  the line and converting them to PEM certificates with the openssl
  command line tool then dumping them to a file.
2011-09-25 02:42:36 -04:00
Seth Hall
43ea0ba182 Some script level fixes.
- Fixed a type name conflict in the Known namespace.

- Fixed a DPD framework bug that was causing Reporter messages.
2011-09-25 02:09:50 -04:00
Jon Siwek
d2118200ea Fixing unit tests and some minor bugs. 2011-09-22 12:42:16 -05:00
Seth Hall
c8e6255666 More options for the header-names.bro script. 2011-09-14 22:44:17 -04:00
Seth Hall
f32b567c85 New script for logging header names and values.
- Closes #519.
2011-09-13 22:33:26 -04:00
Seth Hall
c87704cc25 Small usability and correctness updates.
- Removed an notice definition from the base SSL scripts.

- Moved a logging stream ID into the export section for known-services
  and bumped priority for creating the stream.

- Adding configuration knobs for the SQL injection attack detection
  script and renaming the HTTP::SQL_Injection_Attack notice to
  HTTP::SQL_Injection_Attack_Against

- Bumped priority when creating Known::CERTS_LOG.
2011-09-12 16:14:28 -04:00
Seth Hall
3bf98548f7 The script level pf_ring support isn't working so removing it. 2011-09-08 02:28:04 -04:00
Seth Hall
e07e4ca117 Cleaned up some small SSL mistakes. 2011-09-07 15:11:01 -04:00
Seth Hall
eda2245e9e Merge remote-tracking branch 'origin/topic/seth/pf_ring_support'
* origin/topic/seth/pf_ring_support:
  Added pf_ring load balancing support to the scripting layer.
2011-09-06 15:20:22 -04:00
Seth Hall
11c437faa3 Logging framework update and mass Log::ID renaming.
- Log path's are generated in the scripting land
  now.  The default Log stream ID to path string
  mapping works like this:
    - Notice::LOG -> "notice"
    - Notice::POLICY_LOG -> "notice_policy"
    - TestModule::LOG -> "test_module"

- Logging streams updated across all of the shipped
  scripts to be more user friendly.  Instead of
  the logging stream ID HTTP::HTTP, we now have
  HTTP::LOG, etc.

- The priorities on some bro_init handlers have
  been adjusted to make the process of applying
  filters or disabling streams easier for users.
2011-09-03 01:10:17 -04:00
Seth Hall
771f8bc910 Added pf_ring load balancing support to the scripting layer.
- If the misc/pf-ring-load-balancing script is loaded, the correct
  environment variables will be set to enable automatic flow based
  load balancing used pf_ring if Bro is built against the pf_ring
  libpcap wrapper.  Loading the script on non-Linux OSs or when Bro
  isn't linked against the correct libpcap has no known side effects
  since the script just sets environment variables.

- Added a BiF named setenv for setting environment variables.
2011-09-02 10:43:32 -04:00
Jon Siwek
13a09aa488 Fixes for GeoIP support (addresses #538).
- Missing GeoIP databases now generate warnings/errors that go through
  the reporter framework instead of hitting GeoIP's internal use of
  stderr

- lookup_location now just queries for country code if the city database
  was not loaded, which gets rid of invalid database type errors.

- lookup_location now leaves missing fields uninitialized in the
  returned geo_location record value.  Updated existing scripts to
  check for initialized fields in geo_location records before use.

- Fixed support for GeoIP's IPv6 API and databases
2011-08-30 17:02:07 -05:00
Seth Hall
fc5f22cb5d Merge remote-tracking branch 'origin/topic/jsiwek/reorg-followup' 2011-08-25 16:44:31 -04:00
Seth Hall
562abfb0d1 Merge remote-tracking branch 'origin/topic/gregor/script-polishing'
* origin/topic/gregor/script-polishing:
  Tune when c$conn is set.
  Set c$conn (for logging) in new_connection() event.
  (Semiautomatically) convert the comments in bare-init.bro into autodoc ones.
  Add ConnSize_Analyzer's fields to conn.log
  SSH base scripts: make sure ConnSizeAnalyzer variables are available before using them.
  Make reference to the other script a link
2011-08-25 13:17:49 -04:00
Seth Hall
c750f0c327 Fixing bug in "interesting hostnames" detection. 2011-08-22 16:38:24 -04:00
Seth Hall
a7f6e4c582 Adding metrics framework intermediate updates.
- Since each host in a cluster has it's own view of the metrics
  the only time the manager would get a chance for a global view
  is the break_interval.  This update improves that time.  If a
  worker crosses 10% of the full threshold, it will send it's
  value to the manager which can then ask the rest of the cluster
  for a global view.  The manager then adds all of the values for
  each workers metric indexes together and will do the notice
  if it crosses the threshold so that it isn't dependent on
  waiting for the break interval to hit.  This functionality
  works completely independently of the break_interval too.  Logging
  will happen as normal.

- Small update for SSH bruteforcer detection to match additions in
  the metrics framework API.

- The hope is that this update is mostly invisible from anyone's
  perspective.  The only affect it should have on users is to better
  the detection of metric values crossing thresholds on cluster
  deployments.
2011-08-21 00:32:00 -04:00
Seth Hall
82f94881c0 Improvements to metrics. SSH bruteforcing detection now done with metrics framework. 2011-08-16 11:47:49 -04:00
Jon Siwek
e37430ef66 Merge branch 'master' into topic/jsiwek/reorg-followup 2011-08-16 09:52:05 -05:00
Seth Hall
8286fdeea1 Updates for SQL injection attack detection to match the metrics framework updates. 2011-08-16 08:28:08 -04:00
Jon Siwek
33fce8a71d Misc. doc/script/test cleanup.
- fixing some Metrics::add_data() call signatures
- slight refactors to cluster framework @if and adding a NONE NodeType for
  so local_node_type() will return that instead of just emitting an error
  when cluster mode isn't enabled
- `make restdoc` target now uses bro's bare-mode
- bro scripts generated from bifs now really only live in the build/src/base/
  directory and changed the DocSourcesList.cmake to dynamically figure out
  what bifs exist by looking in src/ instead of build/src/
- add some missing @load dependencies
2011-08-15 17:29:41 -05:00
Jon Siwek
41dd0b98e9 Merge branch 'master' into topic/jsiwek/reorg-followup
Conflicts:
	scripts/base/frameworks/cluster/setup-connections.bro
	scripts/base/frameworks/metrics/main.bro
	scripts/base/frameworks/notice/actions/email_admin.bro
	scripts/base/frameworks/notice/weird.bro
	scripts/base/protocols/mime/file-hash.bro
	scripts/base/protocols/mime/file-ident.bro
	scripts/policy/frameworks/communication/listen-clear.bro
	scripts/policy/frameworks/communication/listen-ssl.bro
	scripts/policy/frameworks/control/controller.bro
	scripts/policy/frameworks/metrics/http-example.bro
	scripts/policy/frameworks/metrics/ssl-example.bro
	scripts/policy/protocols/conn/scan.bro
	src/CMakeLists.txt
2011-08-15 15:34:25 -05:00
Seth Hall
3919a35b9b Metrics framework update. Mostly to make metrics work on clusters.
- Metrics now work on cluster deployments with no caveats.  It should be
  completely transparent.  Intermediate updates to speed some detection
  will come later.
2011-08-15 15:57:48 -04:00
Jon Siwek
2a9ea6b8ba Merge branch 'master' into topic/jsiwek/autodoc-fixes
Conflicts:
	scripts/CMakeLists.txt
	scripts/base/frameworks/cluster/setup-connections.bro
	scripts/base/frameworks/communication/__load__.bro
	scripts/base/frameworks/metrics/conn-example.bro
	scripts/base/frameworks/metrics/http-example.bro
	scripts/site/local.bro
2011-08-13 09:31:06 -05:00
Gregor Maier
7ea0646f30 Make reference to the other script a link 2011-08-11 10:31:36 -07:00