Files
piratepoet/mailpoet/tools/semgrep.sh
alex-mailpoet f7212e583a Update Semgrep rules cloning
[MAILPOET-5230]
2023-04-26 10:01:51 +02:00

16 lines
590 B
Bash
Executable File

#!/usr/bin/env bash
# Save our starting location, so we can jump back there later.
scriptdirectory=${PWD}
rulesdirectory='tools/wpscan-semgrep-rules'
# Make sure we have a copy of WPScan's Semgrep rules.
if [ ! -d $scriptdirectory/$rulesdirectory ]
then
echo "Cloning WPScan's Semgrep rules repository..."
git clone --depth=1 git@github.com:Automattic/wpscan-semgrep-rules.git $scriptdirectory/$rulesdirectory
fi
# Run Semgrep
docker run --rm -v "${scriptdirectory}:/src" returntocorp/semgrep semgrep --error --text --metrics=off -c "/src/${rulesdirectory}/audit" $@