restructure and adding functionality

This commit is contained in:
2026-04-03 00:22:36 -04:00
parent d26348d065
commit 4a98d66b24
6 changed files with 128 additions and 77 deletions

34
src/security.sh Normal file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
set -eo pipefail
if [[ "$STATIC_FLAG" == "no" && "$VULN_SCAN" == "no" ]]; then
echo "[INFO] no security flags set, skipping!";
exit 0;
fi
if [[ "$STATIC_FLAG" == "yes" ]]; then
if gosec ./...; then
echo "[INFO] gosec passed!";
else
if [[ "$STATIC_FAIL" == "yes" ]]; then
echo "[FATAL] gosec failed!";
exit 1;
else
echo "[INFO] gosec failed!";
fi
fi
fi
if [[ "$VULN_CHECK" == "yes" ]]; then
if govulncheck ./...; then
echo "[INFO] govulncheck passed!";
else
if [[ "$VULN_FAIL" == "yes" ]]; then
echo "[FATAL] govulncheck failed!"
exit 1;
else
echo "[INFO] govulncheck failed!"
fi
fi
fi