Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 649 Bytes
#!/bin/bash
# Title security-checker
#
# Description Simple CLI tool for Sensio Security Advisories Checker.
# Fits great with your Continous Integration as it returns exit code 1 if security check fails.
# Usage: security-checker [composer_lock_path] [sensio_checker_url]
#
# Author Antoni Orfin <aorfin@imagin.pl>
# Copyright (C) 2014 IMAGIN Sp. z o.o.
COMPOSER=${1:-composer.lock}
CHECK_URL=${2:-https://security.sensiolabs.org/check_lock}
RESPONSE=$(curl -iL -s -S -H "Accept: text/plain" $CHECK_URL -F lock=@$COMPOSER)
if [[ ! $RESPONSE == *X-Alerts:\ 0* ]]
then
echo "$RESPONSE";
exit 1
fi
exit 0
You can’t perform that action at this time.