-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement security tests thanks to
trivy
close #28
- Loading branch information
1 parent
b8c838d
commit 07da736
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
DEBUG=${DEBUG:=0} | ||
[[ $DEBUG -eq 1 ]] && set -o xtrace | ||
|
||
GITHUB_TOKEN=${GITHUB_TOKEN:=''} | ||
TRIVY_TIMEOUT_SEC=${TRIVY_TIMEOUT_SEC:='360s'} | ||
|
||
export TRIVY_TIMEOUT_SEC | ||
|
||
# shellcheck disable=SC2145 | ||
echo "--> trivy $@" | ||
|
||
# shellcheck disable=SC2046 | ||
docker run --network host --rm --name "trivy_$(date +'%Y%m%d%H%M%S')" \ | ||
-e GITHUB_TOKEN="${GITHUB_TOKEN}" \ | ||
-v $(pwd)/.cache:/root/.cache/ \ | ||
-v ~/.docker/config.json:/root/.docker/config.json:ro \ | ||
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | ||
-t $(tty &>/dev/null && echo '-i') \ | ||
aquasec/trivy:0.6.0 \ | ||
"$@" |