Skip to content

Instantly share code, notes, and snippets.

@tom-butler
Created February 27, 2017 21:41
Show Gist options
  • Save tom-butler/4f326eea8323965e81e4a2057ebc13c9 to your computer and use it in GitHub Desktop.
Save tom-butler/4f326eea8323965e81e4a2057ebc13c9 to your computer and use it in GitHub Desktop.
scout2-pipeline
#!/bin/bash
#AWS keys should be set before this
echo "Installing Scout security auditor"
git clone https://github.com/nccgroup/Scout2
cd Scout2
pip3 install -r requirements.txt
python Scout2.py
# Find each result
# Filter to only results that have flagged_items > 0 and a level of danger
# Only return the description
results=$(cat inc-awsconfig/aws_config.js | grep -oP '"description[^}]*?"flagged_items": [1-9][^}]*?"level":\s"danger"' | grep -oP '"description": ".*?"')
# If we have any results throw an error
if [ ! $results ]
then
echo ${RESULTS}
exit(1)
else
echo "Security tests completed, no exploits found"
exit(0)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment