forked from openSUSE/osc
-
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.
added a simple way to verify osc code base with the python security s…
…canner bandit
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# you can pass as argument "csv","json" or "txt" (default) | ||
if [ "$1" != "" ];then | ||
OUTPUT=$1 | ||
else | ||
OUTPUT="txt" | ||
fi | ||
|
||
# check if bandit is installed | ||
command -v bandit >/dev/null 2>&1 || { echo "bandit should be installed. get the package from https://build.opensuse.org/package/show/home:vpereirabr/python-bandit. Aborting." >&2; exit 1; } | ||
|
||
bandit -c /usr/etc/bandit/bandit.yaml -r osc -f $OUTPUT | ||
|
||
if [ "$OUTPUT" == "csv" ];then | ||
cat bandit_results.csv | ||
rm -f bandit_results.csv | ||
fi |