zeek/scripts/policy/frameworks/files/entropy-test-all-files.bro
Seth Hall 9c692bad39 Update and clean up to file entropy measurement.
- Updated to newer file analyzer api.
2015-02-03 15:04:36 -05:00

20 lines
No EOL
384 B
Text

module Files;
export {
redef record Files::Info += {
## The information density of the contents of the file,
## expressed as a number of bits per character.
entropy: double &log &optional;
};
}
event file_new(f: fa_file)
{
Files::add_analyzer(f, Files::ANALYZER_ENTROPY);
}
event file_entropy(f: fa_file, ent: entropy_test_result)
{
f$info$entropy = ent$entropy;
}