Files
prowler/checks/check_extra7125
2020-11-09 18:48:11 +01:00

49 lines
1.9 KiB
Bash

#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Remediation:
#
# https://www.cloudconformity.com/knowledge-base/aws/RDS/instance-deletion-protection.html
# https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html
#
# aws rds modify-db-instance \
# --region us-east-1 \
# --db-instance-identifier test-db \
# --deletion-protection \
# [--apply-immediately | --no-apply-immediately]
CHECK_ID_extra7125="7.125"
CHECK_TITLE_extra7125="[extra7125] Checks if AWS Glue is used with VPC Endpoints."
CHECK_SCORED_extra7125="NOT_SCORED"
CHECK_TYPE_extra7125="EXTRA"
CHECK_SEVERITY_extra7125="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7125="AwsGlue"
CHECK_ALTERNATE_check7125="extra7125"
extra7125(){
textInfo "Looking for Development Endpoints in all regions... "
for regx in $REGIONS; do
LIST_GLUE_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].PrivateAddress' --output text)
if [[ $LIST_GLUE_SC ]]; then
for pa in $(echo '${LIST_GLUE_SC}'| jq -r '.[] | @base64');do
if [[ ! pa ]]; then
textFail "$regx: AWS Glue uses a VPC Endpoint $pa" "$regx"
else
textPass "$regx: AWS Glue does not use a VPC Endpoint $pa" "$regx"
fi
done
else
textInfo "$regx: No Security Configuration found" "$regx"
fi
done
}