-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate functional and security test
- Loading branch information
1 parent
bfe6a85
commit 9bf2176
Showing
3 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
## ACC | ||
# ENDPOINT=https://sbdevrel-fua-smartbearcoin-acc.azurewebsites.net/api/payees | ||
## PROD | ||
# ENDPOINT=https://sbdevrel-fua-smartbearcoin-prd.azurewebsites.net/api/payees | ||
|
||
ENDPOINT=${ENDPOINT:-'http://0.0.0.0:8000'} | ||
PROJECT_FOLDER=${PROJECT_FOLDER:-'ReadyAPI-Tests'} | ||
PROJECT_FILE=${PROJECT_FILE:-'secure-by-design-readyapi-project.xml'} | ||
|
||
MISSING=() | ||
[ ! "$PROJECT_FOLDER" ] && MISSING+=("PROJECT_FOLDER") | ||
[ ! "$PROJECT_FILE" ] && MISSING+=("PROJECT_FILE") | ||
[ ! "$ENDPOINT" ] && MISSING+=("ENDPOINT") | ||
[ ! "$SLM_API_KEY" ] && MISSING+=("SLM_API_KEY") | ||
|
||
case $(uname -sm) in | ||
'Darwin x86' | 'Darwin x86_64' | 'Darwin arm64' | 'Windows') | ||
ENDPOINT=${ENDPOINT/localhost/host.docker.internal} | ||
;; | ||
esac | ||
if [ ${#MISSING[@]} -gt 0 ]; then | ||
echo "ERROR: The following environment variables are not set:" | ||
printf '\t%s\n' "${MISSING[@]}" | ||
exit 1 | ||
fi | ||
|
||
echo "executing security tests for ${PROJECT_FILE}" | ||
docker run --rm --network="host" \ | ||
-v=${PWD}/${PROJECT_FOLDER}:/project \ | ||
-e SLM_LICENSE_SERVER="https://api.slm.manage.smartbear.com:443" \ | ||
-e API_KEY=${SLM_API_KEY} \ | ||
-e ENDPOINT=${ENDPOINT} \ | ||
-e PROJECT_FILE=${PROJECT_FILE} \ | ||
-e COMMAND_LINE="'-f/project' '-RSecurity Issues Report' -FPDF '-Elocal' /project/${PROJECT_FILE}" \ | ||
smartbear/readyapi-security-testrunner:latest |
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