diff options
author | hagbard <vyosdev@derith.de> | 2019-06-18 12:57:21 -0700 |
---|---|---|
committer | hagbard <vyosdev@derith.de> | 2019-06-18 12:57:21 -0700 |
commit | a06fe4e9c5298b5bad883ab6badc3ccefd32ff49 (patch) | |
tree | 63f8f02165ec492c43ceb550bcfbd6b80161b5f8 /security-check.sh | |
parent | 6104cf2812bc454a3ec2585a9ace20974d87fccb (diff) | |
parent | b4efb2ddef5d749b3425b5a642da8316887aca48 (diff) | |
download | vyos-xe-guest-utilities-a06fe4e9c5298b5bad883ab6badc3ccefd32ff49.tar.gz vyos-xe-guest-utilities-a06fe4e9c5298b5bad883ab6badc3ccefd32ff49.zip |
Merge remote-tracking branch 'upstream/master' into current
Diffstat (limited to 'security-check.sh')
-rwxr-xr-x | security-check.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/security-check.sh b/security-check.sh new file mode 100755 index 0000000..7994875 --- /dev/null +++ b/security-check.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -x + +top_dir=$(pwd) +out_dir="" + +if [ ! -z $1 ];then + mkdir -p $1 + out_dir=$1 +fi + +tmp_dir=`mktemp -d` +cd $tmp_dir + +if [ ! -f ./bin/gosec ];then + curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s 2.0.0 +fi + +result_file=result.json +issue_file=issues.txt + +./bin/gosec -fmt=json -out=${result_file} ${top_dir}/... + + +python ${top_dir}/analyze.py -i ${result_file} ${issue_file} +ret=$? + +rm $result_file +chmod 666 $issue_file +if [ "x" != "x$out_dir" ];then + mv $issue_file $out_dir +fi +exit $ret |