From 5283ee60a267490cfc99489f35e017498322b00a Mon Sep 17 00:00:00 2001 From: Eric Silva Date: Tue, 28 Dec 2021 16:23:40 -0600 Subject: [PATCH] Removed --fail parameter Removed --fail parameter and changed to exit with error code as the default behavior. --- log4j-finder.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/log4j-finder.py b/log4j-finder.py index 8239d55..566c4bc 100755 --- a/log4j-finder.py +++ b/log4j-finder.py @@ -290,7 +290,6 @@ def main(): help="be more quiet, disables banner and summary", ) parser.add_argument("-b", "--no-banner", action="store_true", help="disable banner") - parser.add_argument("-f", "--fail", action="store_true", help="Exit with error status when vulnerability is found") parser.add_argument( "-V", "--version", action="version", version=f"%(prog)s {__version__}" ) @@ -366,10 +365,8 @@ def main(): print_summary(stats) print(f"\nElapsed time: {elapsed:.2f} seconds") - # If we find vulnerabilities and the args -f (or --fail), then exit with a string which cause a error status on the exit. - if args.fail: - if stats["vulnerable"]: - return "Vulnerabilities found." + # If we find vulnerabilities then exit with error code (True = 1) + return stats["vulnerable"] > 0 if __name__ == "__main__": try: