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

Add Libsodium sodium support for sha256 filehashes #1381

Open
wants to merge 113 commits into
base: master
Choose a base branch
from

Conversation

ddpbsd
Copy link
Member

@ddpbsd ddpbsd commented Mar 15, 2018

EXPERIMENTAL: Add support for sha256 checksums in syscheckd. It's optional for now under USE_LIBSODIUM.
If libsodium is enabled, sha1 is disabled. There's currently no way to choose it over sha256.

Only tested on OpenBSD and CentOS 7. Completely untested on Windows and other unix-like systems. Requires libsodium development packages on systems where developers are second class citizens.

It will switch from running OS_md5_sha1_File to OS_algorithm_File
The output will be different. Enable with LIBSODIUM_ENABLED=y
!! Incomplete and untested !!
will be prepended with the hash type followed by an '='.
This will cause changes in analysisd, I think. It will have to handle
the different hash strings and types. I can probably either change to
a generic signature for "HASH changed," and maybe add the hash type
into a field in the alert (like src_ip). Or continue with the way rules
are currently written and add rules for the new hash types.
lots of devug left in, need to free file_sums or change how it's being handled
plenty of other cleanups available. sleep now. code later
ddpbsd added 21 commits June 28, 2018 14:12
The instances that are MAC_PATH stayed the same.
Get rid of a free that was apparently not ok.
the opts to the functions that needed it instead. Much cleaner.
looking at when investigating later. I'm not sure if I should use
GENERIC or BLAKE2B for the "generic" hash. It's set to GENERIC for now.

Hopefully correct some ifdef/else/endif LIBSODIUM stuff. I think alert_msg
was being overwritten in a few places making my actual hashes to be written
as "xxx:xxx" (no value, basically) instead of the actual computed hashes.

Also a bunch of debugging stuff that will be removed later.
Also try not to truncate the hashes when reporting changes.
@ddpbsd
Copy link
Member Author

ddpbsd commented Dec 31, 2018

src/analysisd/format/to_json.c has a bunch of goodies that need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants