Skip to content

Instantly share code, notes, and snippets.

@garymalaysia
Created April 22, 2022 13:24
Show Gist options
  • Save garymalaysia/0c512a4d7b3580e0227281738c8442e7 to your computer and use it in GitHub Desktop.
Save garymalaysia/0c512a4d7b3580e0227281738c8442e7 to your computer and use it in GitHub Desktop.
Advance ENTRYPOINT for Docker Container
#!/bin/bash
set -o errexit
case $1 in
trivy)
case "$2" in
image|i|filesystem|fs|repo|repository)
echo ""
echo "########################"
echo " Scanning ......... "
echo "########################"
echo ""
"$@"
;;
esac
;;
semgrep)
case "$2" in
--config|-f|-c)
echo ""
echo "##############################################################################################################"
echo "# Append --config=/home/sec-tool/semgrep-rules/ci --config=/home/sec-tool/semgrep-rules/secrets #"
echo "# to skip external audit download Air-gapped area #"
echo "##############################################################################################################"
echo ""
"$@"
;;
esac
;;
"")
echo "Available Commands:"
echo " [*] trivy"
echo " [*] semgrep"
;;
esac
exec "$@"
@garymalaysia
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment