Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auditbeat] Add xxhash as a hash option for faster file integrity checks on large files #6626

Closed
geekpete opened this issue Mar 22, 2018 · 3 comments
Labels
Auditbeat enhancement good first issue Indicates a good issue for first-time contributors v6.4.0

Comments

@geekpete
Copy link
Member

xxhash is one of the best performing hashes for computing a hash against large files.

See benchmarks by @jpountz:
https://jpountz.github.io/lz4-java/1.2.0/xxhash-benchmark/
there's many other benchmarks out there if more evidence is needed.

Including xxhash in the list of available hashes that can be used with auditbeat would allow larger files to be hashed much much faster.
This might then provide the ability to increase the default max file size that is hashed, which currently defaults to excluding files over 100MiB being hashed at all, by either using xxhash for larger files and whatever other hash for smaller files or the ability to realise better overall audit hashing performance for larger files generally when using xxhash for greater visibility and auditing for use cases that deal with larger files.

@andrewkroh
Copy link
Member

So far we have not made available in Auditbeat any non-cryptographic hash functions. I was mostly thinking of security use cases, but for purely doing integrity checks I see no issues with adding non-cryptographic hash functions. We can differentiate them in the docs.

At the moment Auditbeat's most performant hash (at least on amd64 on my machine) is blake2b. Even though it is probably the fastest it is not the default. I wanted to keep SHA1 as the default because it's relatively fast and it common in data feeds from threat exchanges.

I found a pure Go implementation that we can try out. https://github.com/OneOfOne/xxhash

@andrewkroh
Copy link
Member

For anyone that's interested in contributing this feature: take a look at the touch points for SHA3 when it was added. Each of those same places will need updated for xxhash. The you can run the benchmark test (go test -bench BenchmarkHashFile -benchtime 10s -run XXX -v).

@andrewkroh andrewkroh changed the title Consider adding xxhash as a hash option for auditbeat file integrity for faster hashing of larger files [Auditbeat] Add xxhash as a hash option for faster file integrity checks on large files Mar 22, 2018
@andrewkroh andrewkroh added the good first issue Indicates a good issue for first-time contributors label Mar 22, 2018
original-brownbear added a commit to original-brownbear/beats that referenced this issue Jun 14, 2018
original-brownbear added a commit to original-brownbear/beats that referenced this issue Jun 14, 2018
original-brownbear added a commit to original-brownbear/beats that referenced this issue Jun 14, 2018
andrewkroh pushed a commit that referenced this issue Jun 15, 2018
Add xxh64 hash algorithm as an option for hashing files in the Auditbeat file_integrity module.
@andrewkroh
Copy link
Member

andrewkroh commented Jun 15, 2018

Feature has been added in #7311 to master and will be included in the next release - v6.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auditbeat enhancement good first issue Indicates a good issue for first-time contributors v6.4.0
Projects
None yet
Development

No branches or pull requests

2 participants