Created
April 22, 2022 13:24
-
-
Save garymalaysia/0c512a4d7b3580e0227281738c8442e7 to your computer and use it in GitHub Desktop.
Advance ENTRYPOINT for Docker Container
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
#!/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 "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credit to https://dille.name/blog/2019/12/05/creating-advanced-entrypoints-for-containers/