trufflesecurity / trufflehog

Find, verify, and analyze leaked credentials
https://trufflesecurity.com
GNU Affero General Public License v3.0
15.7k stars 1.64k forks source link

--json flag still does not output as JSON standard #2164

Open agad98 opened 9 months ago

agad98 commented 9 months ago

When run the wizard and ask it to scan a filesystem, the output to stdio is just aa stream of objects, with no delimination or encapsulation with square brackets.

This was claimed to have been fixed in the new version in this issue https://github.com/trufflesecurity/trufflehog/issues/169

But I am running the latest version and it is still not fixed. I tried both, the dev and the packaged release, both behave the same.

TruffleHog Version

Latest dev trufflehog dev

Steps to Reproduce

run with --json flag, or set output to json true in the wizard

Environment

agad98 commented 9 months ago

I had to use trufflehog filesystem C:\some\directory --json | jq -s . to get the expected result. But it would be nice if we can do that natively. Or, have an option regarding how the user wants their json output.

baruchiro commented 6 months ago

Maybe we can add an option to output into a file?

galovics commented 2 months ago

I second this. Would be really nice to write directly to file instead of redirecting the output of the tool into a file.

I wanted to import the JSON output to excel but was unable to do so.