Created
November 17, 2019 14:02
-
-
Save chrisdlangton/d2efd283104d775a761329868f72d5eb to your computer and use it in GitHub Desktop.
Install OWASP dependency-check
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
#!/usr/bin/env bash | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
CUR_USER=$(whoami) | |
TARGET=$(pwd)/vendored | |
export DEPENDENCY_CHECK_VERSION=5.2.4 | |
chown -R ${CUR_USER} /home/${CUR_USER}/.gnupg | |
find /home/${CUR_USER}/.gnupg -type f -exec chmod 600 {} \; | |
find /home/${CUR_USER}/.gnupg -type d -exec chmod 700 {} \; | |
echo -e "$GREEN✔$NC Prepare GPG" | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys F9514E84AE3708288374BBBE097586CFEA37F9A6 | |
echo -e "$GREEN✔$NC Added keys" | |
echo -e "Installing dependency-check version ${DEPENDENCY_CHECK_VERSION}" | |
python3 -m pip -q install -U dependency-check --target ${TARGET} && echo -e "$GREEN✔$NC Downloaded dependency-check" | |
if [[ -d /etc/cron.hourly ]] && [[ ! -f /etc/cron.hourly/dependency-check-update.sh ]]; then | |
cat << EOF > /etc/cron.hourly/dependency-check-update.sh | |
#!/usr/bin/env bash | |
dependency-check --updateonly | |
EOF | |
echo -e "$GREEN✔$NC Added hourly database update cron job" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment