logpresso / CVE-2021-44228-Scanner

Vulnerability scanner and mitigation patch for Log4j2 CVE-2021-44228
Apache License 2.0
851 stars 174 forks source link

Feature Request: -f file_containing_list_to_scan or read from stdin or file #107

Closed jlellis closed 2 years ago

jlellis commented 2 years ago

The scanner could be more easily leveraged in shell and powershell if it could either accept a list of paths to scan on its command line or its stdin, or could be provided a file with the list of names.

Examples: java -jar scanner.jar /path/1 /path2 /path3 ... find / -name ".jar" > /tmp/jars.txt; java -jar scanner.jar -f /tmp/jars.txt java -jar scanner.jar -f <(find / -name '.jar') java -jar scanner.jar </tmp/jars.txt find / -name '*.jar' | scanner.exe

What I'm having to do is create a wrapper shell script with a list of paths to scan, and loop that list into separate invocations of scanner.jar. The loop would be unnecessary if Scanner would read a list of paths.

DrNeutron commented 2 years ago

@jlellis We are having to do the exact same thing, a list of paths would be a fantastic addition.

xeraph commented 2 years ago

@jlellis @DrNeutron I will address this issue in the next release.

xeraph commented 2 years ago

@jlellis @DrNeutron Would you test v2.1.0 release? It support multiple target paths.

DrNeutron commented 2 years ago

@jlellis @DrNeutron Would you test v2.1.0 release? It support multiple target paths.

Tested here on RHEL 7.x Linux, works as expected. Thanks.

xeraph commented 2 years ago

@jlellis Would you test v2.1.4 release? It support -f option.