(cherry picked from commit b89f67bba131da263828e258cc474a460ee3ebcc)
This commit is contained in:
Or Evron
2020-01-29 12:54:00 +02:00
committed by Nimrod Kor
parent 029c330ed1
commit aca93b7526

View File

@@ -26,16 +26,16 @@ extra764(){
$AWSCLI s3api get-bucket-policy $PROFILE_OPT --bucket $bucket --output text --query Policy > $TEMP_STP_POLICY_FILE 2>&1
cat $TEMP_STP_POLICY_FILE
cat $bucket
# if [[ $(grep AccessDenied $TEMP_STP_POLICY_FILE) ]]; then
# textFail "Access Denied Trying to Get Bucket Policy for $bucket"
# rm -f $TEMP_STP_POLICY_FILE
# continue
# fi
# if [[ $(grep NoSuchBucketPolicy $TEMP_STP_POLICY_FILE) ]]; then
# textFail "No bucket policy for $bucket"
# rm -f $TEMP_STP_POLICY_FILE
# continue
# fi
if [[ $(grep AccessDenied $TEMP_STP_POLICY_FILE) ]]; then
textFail "Access Denied Trying to Get Bucket Policy for $bucket"
rm -f $TEMP_STP_POLICY_FILE
continue
fi
if [[ $(grep NoSuchBucketPolicy $TEMP_STP_POLICY_FILE) ]]; then
textFail "No bucket policy for $bucket"
rm -f $TEMP_STP_POLICY_FILE
continue
fi
# https://aws.amazon.com/premiumsupport/knowledge-center/s3-bucket-policy-for-config-rule/
# checking if $TEMP_STP_POLICY_FILE is a valid json before converting it to json with jq