This PR adds an output_file argument to the private scan_dir function in duroc_hog, and refactors the scan_dir function to repeat less code and separate directory iteration approaches from file scanning, resulting in less repeating code.
By filtering the files in the scanned directory, these changes avoid scanning duroc_hog's output file, avoiding false finds after repeated runs.
This PR also adds a whitelist option to duroc_hog by using the SecretScanner's is_whitelisted method inside the scan_file and scan_bytes functions
Testing
Integration tests for duroc_hog have been included. The binary build does slow the tests down somewhat, and escargot has been included as a dev-dependency.
Fixes #15 Fixes #16
What
This PR adds an
output_file
argument to the privatescan_dir
function induroc_hog
, and refactors thescan_dir
function to repeat less code and separate directory iteration approaches from file scanning, resulting in less repeating code.By filtering the files in the scanned directory, these changes avoid scanning
duroc_hog
's output file, avoiding false finds after repeated runs.This PR also adds a whitelist option to
duroc_hog
by using the SecretScanner'sis_whitelisted
method inside thescan_file
andscan_bytes
functionsTesting
Integration tests for
duroc_hog
have been included. The binary build does slow the tests down somewhat, and escargot has been included as a dev-dependency.