-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun-dependency-check.sh
executable file
·39 lines (31 loc) · 1.04 KB
/
run-dependency-check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# https://hub.docker.com/r/owasp/dependency-check/
OWASPDC_DIRECTORY=$HOME/OWASP-Dependency-Check
DATA_DIRECTORY="$OWASPDC_DIRECTORY/data"
# REPORT_DIRECTORY="$OWASPDC_DIRECTORY/reports"
REPORT_DIRECTORY="$(pwd)/reports"
if [ ! -d "$DATA_DIRECTORY" ]; then
echo "Initially creating persistent directories"
mkdir -p "$DATA_DIRECTORY"
chmod -R 777 "$DATA_DIRECTORY"
mkdir -p "$REPORT_DIRECTORY"
chmod -R 777 "$REPORT_DIRECTORY"
fi
# Make sure we are using the latest version
docker pull owasp/dependency-check
#docker run
# -u=$UID:$(id -g $USER)
docker run --rm \
--volume "$(pwd)/target":/src \
--volume "$DATA_DIRECTORY":/usr/share/dependency-check/data \
--volume "$REPORT_DIRECTORY":/report \
owasp/dependency-check \
--scan /src \
--format "ALL" \
--project "My OWASP Dependency Check Project"
# Use suppression like this: (/src == $pwd)
# --suppression "/src/security/dependency-check-suppression.xml"
ls -latr target
mv target/dependency-* reports
# Force "ok" for Travis
exit 0