-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from aws-ia/sra-mig
scotsuite scanning addition
- Loading branch information
Showing
14 changed files
with
54 additions
and
77 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 was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
.project_automation/functional_tests/entrypoint_scotsuite.sh
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
..._tests/abi-scoutsuite-custom-ruleset.json → ...tsuite/abi-scoutsuite-custom-ruleset.json
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
40 changes: 40 additions & 0 deletions
40
.project_automation/functional_tests/scoutsuite/scoutsuite.sh
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,40 @@ | ||
#!/bin/bash -ex | ||
|
||
|
||
## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between | ||
# managed and local tasks always use these variables for the project and project type path | ||
PROJECT_PATH=${BASE_PATH}/project | ||
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype | ||
|
||
cd ${PROJECT_PATH} | ||
|
||
# Retrieve the AWS account ID and store it in a variable | ||
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text) | ||
|
||
run_scoutsuite() { | ||
#Create Scoutsuite security scan custom rule | ||
python3 .project_automation/functional_tests/scoutsuite/create-scoutsuite-custom-rule.py | ||
# Execute Scoutsuite security scan | ||
scout aws -r us-east-1 --ruleset .project_automation/functional_tests/scoutsuite/abi-scoutsuite-custom-ruleset.json --no-browser --max-rate 5 --max-workers 5 -f | ||
# Upload Scoutsuite security scan results to S3 bucket named scoutsuite-results-aws-AWS-ACCOUNT-ID | ||
python3 .project_automation/functional_tests/scoutsuite/process-scoutsuite-report.py | ||
# Delete taskcat e2e test resources | ||
taskcat test clean ALL | ||
process_scoutsuite_report | ||
} | ||
|
||
process_scoutsuite_report() { | ||
# Check Scoutsuite security scan result for Danger level findings (Non-0 exit code) | ||
scoutsuite_sysout_result=$(cat scoutsuite_sysout.txt) | ||
scoutsuite_s3_filename=$(cat scoutsuite_s3_filename.txt) | ||
rm scoutsuite_sysout.txt | ||
rm scoutsuite_s3_filename.txt | ||
if [ "$scoutsuite_sysout_result" -ne 0 ]; then | ||
# The value is non-zero, indicating Scoutsuite report needs to be checked for security issues | ||
echo "Scoutsuite report contains security issues. For details please check the log messages above or the file $scoutsuite_s3_filename in the S3 bucket named scoutsuite-results-aws-$AWS_ACCOUNT_ID in the AWS test account provided by the ABI team." | ||
exit 1 | ||
fi | ||
} | ||
|
||
#Run Scoutsuite security test | ||
run_scoutsuite |
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