Commit graph

13262 commits

Author SHA1 Message Date
Bernhard Amann
8875953751 A bunch of more changes for the raw reader
* send end_of_data event for all kind of streams
* send process_finished event containing exit code of child process for executed programs
* move raw-tests to separate directory
* expose name of input stream to readers
* better handling of some error cases in raw reader
* new force_kill option for raw reader which SIGKILLs progesses on exit

The ordering of events how they arrive in the main loop is a bit peculiar at the moment.
The process_finished event arrives in scriptland before all of the other events, even though
it should be sent last. I have not yet fully figured that out.
2013-03-18 21:49:16 -07:00
Scott Runnels
9ae8487844 Logging Framework (contrived) example: Logging factorials. 2013-03-18 23:44:36 -04:00
Scott Runnels
2e55399a85 Correction of spelling mistakes. 2013-03-18 23:27:31 -04:00
Scott Runnels
940910768b Start on Logging Framework. 2013-03-18 23:23:43 -04:00
Bernhard Amann
f1c91f02ce Merge remote-tracking branch 'origin/master' into topic/bernhard/input-update 2013-03-18 19:16:47 -07:00
Scott Runnels
19c401f8a6 Renamed Advanced Data Structures to simply Record Data Type. 2013-03-18 21:46:19 -04:00
Robin Sommer
9caf6e4884 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  fix gcc compile warning in Benchmark reader
  fix gcc compile warning in base64 encoder
2013-03-18 12:18:40 -07:00
Scott Runnels
daaeca5ef0 correct nomenclature for fields in a record. 2013-03-18 13:38:03 -04:00
Jon Siwek
b30211c178 FileAnalysis: fix unit tests. 2013-03-18 12:29:41 -05:00
Jon Siwek
294570ec2e Merge branch 'master' into topic/jsiwek/file-analysis 2013-03-18 11:48:05 -05:00
Jon Siwek
550c3c477d FileAnalysis: integrate w/ SMTP analyzer.
More generally w/ MIME_Mail messages, which POP3 analyzer also uses.
2013-03-18 11:30:59 -05:00
Bernhard Amann
4aab9921be fix gcc compile warning in Benchmark reader 2013-03-18 09:04:18 -07:00
Bernhard Amann
873d0549bf fix gcc compile warning in base64 encoder 2013-03-18 09:01:03 -07:00
Robin Sommer
c39223e226 Fixing potential leak in DNS error case. From Vlad.
Closes #967.
2013-03-17 17:37:06 -07:00
Robin Sommer
c180d04db9 Updating submodule(s).
[nomail]
2013-03-17 13:56:17 -07:00
Robin Sommer
6865f0438a Renaming Base64Decoder to Base64Converter.
It nows encodes and decodes.
2013-03-17 13:16:46 -07:00
Robin Sommer
f412a00ada Adding a test for extract-certs-pem.pem. 2013-03-17 13:06:24 -07:00
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
Robin Sommer
788c0d547d Merge remote-tracking branch 'origin/topic/seth/software-version-updates2'
* origin/topic/seth/software-version-updates2:
  Correctly handle DNS lookups for software version ranges.
  Improvements to vulnerable software detection.
  Update software version parsing and comparison to account for a third numeric subversion.

Closes #938.
2013-03-17 12:38:25 -07:00
Bernhard Amann
6fef99ee03 make reading from stdout and stderr simultaneously work.
Needs a few test-cases - but seems ok...
2013-03-16 09:54:48 -07:00
Robin Sommer
d11bd56b5d Changing semantics of thread stop methods.
PrepareStop() is now SignalStop() and just signals a thread that it
should terminate. After that's called, WaitForStop() (formerly Stop())
wait for it to actually finish processing.

When stopping writers during operation, we now no longer wait for them
to finish.
2013-03-15 17:57:58 -07:00
Bernhard Amann
3aeec7ec14 allow sending data to stdin of child process 2013-03-15 15:47:20 -07:00
Bernhard Amann
fc42c71dfa Streaming reads from external commands work without blocking anything. 2013-03-15 13:58:41 -07:00
Bernhard Amann
f2d67b5829 replace popen with fork and exec.
Note for future: eof only gets sent when the parent closes its in-pipe
after forking.
2013-03-15 13:32:28 -07:00
Bernhard Amann
5dd07e023d change raw reader to use basic c io instead of fdstream encapsulation class.
preparation for future changes.
2013-03-14 16:14:13 -07:00
Jon Siwek
31590fbb9b FileAnalysis: improve HTTP integration.
Seems to be working with various examples I tested, now including
multipart/byteranges.
2013-03-14 17:05:05 -05:00
Robin Sommer
38e1dc9ca4 Support for cleaning up threads that have terminated.
Once a BasicThread leaves its run() method, a thread is now marked for
cleaning up, and the ThreadMgr will soon join it to release the OS
resources.

Also, adding a function Log::remove_stream() that remove a logging
stream, stopping all writer threads that are associated with it.

Note, however, that removing a *filter* from a stream still doesn't
clean up any threads. The problem is that because of the output paths
potentially being created dynamically it's unclear if the writer
thread will still be needed in the future. We could add clean writers
up with timeouts, but that doesn't sound great either. So for now, the
only way to sure clean up logging threads is to remove the entire
stream.

Also note that cleanup doesn't work with input threads yet, which
don't seem to terminate (at least in the case I tried).
2013-03-14 14:59:05 -07:00
Jon Siwek
e0f3713912 FileAnalysis: change file handle -> file id mapping process.
They're now actually directly related via a hash function that will
produce the same results among different instances in a cluster.
2013-03-14 14:08:26 -05:00
Jon Siwek
637fe69cf9 FileAnalysis: buffer input that can't get unique file handle immediately
A retry happens on every new input and also periodically based on a
timer.  If a file handle is returned at those times, the input is
forwarded for analysis, else it keeps retrying until a timeout
threshold.
2013-03-14 10:57:16 -05:00
Seth Hall
b1f1b64dde Checkpoint 2013-03-14 11:19:39 -04:00
Seth Hall
5734f9ef71 Merge remote-tracking branch 'origin/master' into topic/seth/software-version-updates2 2013-03-14 09:21:13 -04:00
Seth Hall
8778761c07 Checkpoint 2013-03-13 22:55:03 -04:00
Seth Hall
0f99956417 Added Exec, Dir, and ActiveHTTP modules. 2013-03-13 14:36:27 -04:00
Jon Siwek
878dfff2f2 FileAnalysis: decentralize unique file handle generator callbacks.
The framework now cycles through callbacks based on a table indexed
by analyzer tags, or the special case of service strings if a given
analyzer is overloaded for multiple protocols (FTP/IRC data).  This
lets each protocol script bundle implement the callback locally and
reduces the FAF's external dependencies.
2013-03-13 10:48:26 -05:00
Robin Sommer
b4824f4207 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add check for truncated link frames.  Addresses #962.
  Fix large memory allocation in IP fragment reassembly.  Addresses #961.
2013-03-13 07:20:12 -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
Seth Hall
09cbaa7ccc Merge remote-tracking branch 'origin/master' into topic/seth/metrics-merge
Conflicts:
	testing/btest/Baseline/coverage.default-load-baseline/canonified_loaded_scripts.log
	testing/btest/Baseline/scripts.base.frameworks.notice.cluster/manager-1.notice.log
	testing/btest/Baseline/scripts.base.frameworks.notice.suppression-cluster/manager-1.notice.log
	testing/btest/Baseline/scripts.base.protocols.ftp.gridftp/notice.log
2013-03-13 00:26:55 -04:00
Jon Siwek
bb3228e8f6 FileAnalysis: small tweak to file handle generation.
For files that go over a single connection, add connection start time
to handle, so the file id will always differ even if the same connection
parameters are later used to transfer a file (same one or different).
2013-03-12 16:06:06 -05:00
Scott Runnels
afdb80a334 Include required blank line after btest directive to avoid python error. 2013-03-12 16:03:17 -04:00
Jon Siwek
3dd513e26e FileAnalysis: move unique file handle string generation to script-layer
And add minimal integration with HTTP analyzer.
2013-03-12 13:44:31 -05:00
Bernhard Amann
a5161783ef and add bae64 bif tests. 2013-03-12 09:33:49 -07:00
Bernhard Amann
a1896fde90 Merge remote-tracking branch 'origin/master' into topic/bernhard/base64 2013-03-12 09:28:07 -07:00
Bernhard Amann
2b28c3a578 re-unify classes 2013-03-12 09:27:59 -07:00
Bernhard Amann
fdc8de7596 add sqlite tests and fix small vector/set escaping bugs 2013-03-11 14:22:35 -07:00
Bernhard Amann
a251a1c39a fix small bug with vectors and sets.
On a first glance - this kind of seems to work. On mac-os you need
a newer than the system-installed sqlite - the hanging problem only
occurs with that one...
2013-03-11 13:10:56 -07:00
Bernhard Amann
5d12765886 make work with newer AsciiFormatter. 2013-03-11 12:01:49 -07:00
Bernhard Amann
8cb91de93a Merge remote-tracking branch 'origin/master' into topic/bernhard/sqlite
Conflicts:
	src/threading/AsciiFormatter.cc
2013-03-11 11:47:10 -07:00
Jon Siwek
1f6cac9b6d Merge branch 'master' into topic/jsiwek/file-analysis 2013-03-11 13:20:45 -05:00
Jon Siwek
90ca2b87c4 Add check for truncated link frames. Addresses #962.
Patch provided by jbaines, modified with a more descriptive Weird name.
2013-03-11 11:58:54 -05:00
Jon Siwek
8d5434ef2d Fix large memory allocation in IP fragment reassembly. Addresses #961.
Patch by jbaines modified slightly to return earlier so that the
problem packet can't cause any state change in the FragReassembler.
2013-03-11 10:54:51 -05:00