Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
targets = list(set(targets))
# Launch
breached_targets = target_factory(targets, user_args)
# These are not done inside the factory as the factory iterates over each target individually
# The following functions perform line by line checks of all targets per line
if user_args.bc_path:
breached_targets = breachcomp_check(breached_targets, user_args.bc_path)
local_found = None
# Handle cleartext search
if user_args.local_breach_src:
for arg in user_args.local_breach_src:
res = find_files(arg)
if user_args.single_file:
local_found = local_search_single(res, targets)
else:
local_found = local_search(res, targets)
if local_found is not None:
breached_targets = local_to_targets(breached_targets, local_found, user_args)
# Handle gzip search
if user_args.local_gzip_src:
for arg in user_args.local_gzip_src:
res = find_files(arg, "gz")
if user_args.single_file:
local_found = local_search_single_gzip(res, targets)
else:
local_found = local_gzip_search(res, targets)
if local_found is not None:
breached_targets = local_to_targets(breached_targets, local_found, user_args)
local_found = None
# Handle cleartext search
if user_args.local_breach_src:
for arg in user_args.local_breach_src:
res = find_files(arg)
if user_args.single_file:
local_found = local_search_single(res, targets)
else:
local_found = local_search(res, targets)
if local_found is not None:
breached_targets = local_to_targets(breached_targets, local_found, user_args)
# Handle gzip search
if user_args.local_gzip_src:
for arg in user_args.local_gzip_src:
res = find_files(arg, "gz")
if user_args.single_file:
local_found = local_search_single_gzip(res, targets)
else:
local_found = local_gzip_search(res, targets)
if local_found is not None:
breached_targets = local_to_targets(breached_targets, local_found, user_args)
print_results(breached_targets, user_args.hide)
print_summary(start_time, breached_targets)
if user_args.output_file:
save_results_csv(user_args.output_file, breached_targets)