forked from DataDog/guarddog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bash script to run test locally + rename the old file
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
runtest="$1" | ||
scan_dir="$2" | ||
|
||
if [ -z "$runtest" ] || [ -z "$scan_dir" ]; then | ||
echo "Add argument to specify the tests you want to do (false_positive, false_negative, all)" | ||
echo "and add a directory to scan" | ||
exit 0 | ||
fi | ||
|
||
if [ "$runtest" = "false_positive" ] || [ "$runtest" = "all" ]; then | ||
echo "[+] ## Test - False Positives" | ||
guarddog pypi scan "${scan_dir}" --output-format json | jq -c '.[]' | grep -v '"issues":0' > false_positive_result.json | ||
echo "[+] Result exported in false_positive_result.json" | ||
fi | ||
|
||
if [ "$runtest" = "false_negative" ] || [ "$runtest" = "all" ]; then | ||
echo "[+] ## Test - False Negatives" | ||
guarddog pypi scan "${scan_dir}" --output-format json | jq -c '.[]' | grep '"issues":0' > false_negative_result.json | ||
echo "[+] Result exported in false_negative_result.json" | ||
fi | ||
|
||
|