Skip to content

Commit

Permalink
Update check_cmd_injection.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
VincyZhang authored Nov 22, 2024
1 parent dd05114 commit b9327db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/scripts/check_cmd_injection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
set -e
cd ${WORKSPACE}
[[ -f ${WORKSPACE}/diff_file ]] && rm -f ${WORKSPACE}/diff_file
source .github/workflows/scripts/change_color
# docker control/rm/scp/rsync/git cmd
check_list=("docker stop" "docker rm" "docker kill" "sudo rm" "git .* -f")

Expand Down Expand Up @@ -38,7 +39,7 @@ do
#done
for (( i=0; i<${#check_list[@]}; i++)); do
if [[ $(cat diff_file | grep -c "${check_list[$i]}") != 0 ]]; then
echo "Found Dangerous Command: ${check_list[$i]} in $file, Please Check"
$BOLD_RED && echo "Found Dangerous Command: ${check_list[$i]} in $file, Please Check"
status="failed"
fi;
done;
Expand Down

0 comments on commit b9327db

Please sign in to comment.