Commit graph

30 commits

Author SHA1 Message Date
Robin Sommer
d58a02aa01 Merge remote-tracking branch 'origin/topic/bernhard/base64'
* origin/topic/bernhard/base64:
  and re-enable caching of extracted certs
  and add bae64 bif tests.
  re-unify classes
  and modernize script.
  add base64-encode functionality and bif.

Closes #965.
2013-03-17 13:00:52 -07:00
Bernhard Amann
457ce10e99 and re-enable caching of extracted certs
I kind of deleted the line by accident...
2013-03-13 00:34:15 -07:00
Bernhard Amann
cfada61672 and modernize script.
thanks Seth.
2013-03-06 13:30:13 -08:00
Bernhard Amann
5e8e12182a add base64-encode functionality and bif.
This allows replacing an ugly openssl-call from one of
the policy scripts. The openssl call is now replaced with
a still-but-less-ugly call to base64_encode.

I do not know if I split the Base64 classes in a "smart" way... :)
2013-03-05 16:05:07 -08:00
Seth Hall
a2556642e6 Merge remote-tracking branch 'origin/topic/matthias/notary'
* origin/topic/matthias/notary:
  Small cosmetic changes.
  Give log buffer the correct name.
  Simplify delayed logging of SSL records.
  Implement delay-token style SSL logging.
  More style tweaks: replace spaces with tabs.
  Factor notary code into separte file.
  Adhere to Bro coding style guidelines.
  Enhance ssl.log with information from notary.

Closes #928
2013-02-05 02:06:33 -05:00
Matthias Vallentin
a635f96518 Small cosmetic changes. 2013-01-15 14:56:02 -08:00
Matthias Vallentin
7ff15f4599 Simplify delayed logging of SSL records. 2012-12-24 22:57:49 -08:00
Matthias Vallentin
9e81342c92 Implement delay-token style SSL logging.
This commit moves the notary script into the policy directory, along with some
architectural changes: the main SSL script now has functionality to add and
remove tokens for a given record. When adding a token, the script delays the
logging until the token has been removed or until the record exceeds a maximum
delay time.

As before, the base SSL script stores all records sequentially and buffers even
non-delayed records for the sake of having an ordered log file. If this turns
out to be not so important, we can easily revert to a simpler logic.

(This is still WiP, some debuggin statements still linger.)
2012-12-22 20:30:17 -08:00
Seth Hall
911d7d8436 Finished SSL & syslog autodocs. 2012-01-10 00:56:12 -05:00
Jon Siwek
a4117016e9 Merge branch 'master' into topic/script-reference
Conflicts:
	aux/broccoli
	aux/broctl
	scripts/base/frameworks/notice/main.bro
	src/event.bif
2011-12-19 16:17:58 -06:00
Jon Siwek
cc1459ef35 Fix some malformed Broxygen xref roles. 2011-12-16 14:30:36 -06:00
Seth Hall
ec721dffec Added is_orig fields to the SSL events and adapted script.
- Added a field named $last_alert to the SSL log.  This doesn't even
  indicate the direction the alert was sent, but we need to start somewhere.

- The x509_certificate function has an is_orig field now instead of
  is_server and it's position in the argument list has moved.

- A bit of reorganization and cleanup in the core analyzer.
2011-12-09 16:56:12 -05: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
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
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
Robin Sommer
a84a422240 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Various unit test cleanup.
2011-09-28 16:54:23 -07: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
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
e07e4ca117 Cleaned up some small SSL mistakes. 2011-09-07 15:11:01 -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
Jon Siwek
47500ceef4 Add a test that checks each individual script can be loaded in bare-mode.
Fixed most @load dependency issues in the process.  The test is still
failing in a "known" way due to hot.conn.bro and scan.bro.

Adressess #545
2011-08-10 15:38:21 -05:00
Seth Hall
597a4d6704 Hopefully the last major script reorganization.
- policy/ renamed to scripts/

- By default BROPATH now contains:
	- scripts/
	- scripts/policy
	- scripts/site

- *Nearly* all tests pass.

- All of scripts/base/ is loaded by main.cc
	- Can be disabled by setting $BRO_NO_BASE_SCRIPTS
	- Scripts in scripts/base/ don't use relative path loading to ease use of BRO_NO_BASE_SCRIPTS (to copy and paste that script).

- The scripts in scripts/base/protocols/ only (or soon will only) do logging and state building.

- The scripts in scripts/base/frameworks/ add functionality without causing any additional overhead.

- All "detection" activity happens through scripts in scripts/policy/.

- Communications framework modified temporarily to need an environment variable to actually enable (ENABLE_COMMUNICATION=1)
	- This is so the communications framework can be loaded as part
	  of the base without causing trouble when it's not needed.
	- This will be removed once a resolution to ticket #540 is reached.
2011-08-05 23:09:53 -04:00