Samsung / CredSweeper

CredSweeper is a tool to detect credentials in any directories or files. CredSweeper could help users to detect unwanted exposure of credentials (such as token, passwords, api keys etc.) in advance. By scanning lines, filtering, and using AI model as option, CredSweeper reports lines with possible credentials, where the line is, and expected type o

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redundant CLI output

meanrin opened this issue · comments

At the moment credsweeper produce output to the CLI event if --save-json option is selected
This creates redundancy, as CLI output duplicate same data that saved to the json file
Apparently it might create issue if credsweeper called as sub-process in a java application, as CLI out is too long to be parsed properly. That might create a zombie process as a result

https://stackoverflow.com/questions/63468663/linux-zombies-processes-left-unterminated-with-java-processbuilder

$ python -m credsweeper --path "tests/samples/password" --ml_validation --save-json o.json
rule: Password / severity: medium / line_data_list: [line: 'password = "cackle!"' / line_num: 1 / path: tests/samples/password / value: 'cackle!' / entropy_validation: False] / api_validation: NOT_AVAILABLE / ml_validation: VALIDATED_KEY

Propose to suppress CLI out if --save-json selected

$ python -m credsweeper --path "tests/samples/password" --ml_validation --save-json o.json

OR add -q/--quiet as an option to suppress CLI out

$ python -m credsweeper --path "tests/samples/password" --ml_validation --save-json o.json -q

I agree to suppress CLI output when --save-json selected.
Thank you for propose!