mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
43 lines
2.1 KiB
Bash
43 lines
2.1 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Prowler - the handy cloud security tool (copyright 2019) 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.
|
|
CHECK_ID_extra756="7.56"
|
|
CHECK_TITLE_extra756="[extra756] Check if Redshift cluster is Public Accessible"
|
|
CHECK_SCORED_extra756="NOT_SCORED"
|
|
CHECK_TYPE_extra756="EXTRA"
|
|
CHECK_SEVERITY_extra756="High"
|
|
CHECK_ASFF_RESOURCE_TYPE_extra756="AwsRedshiftCluster"
|
|
CHECK_ALTERNATE_check756="extra756"
|
|
CHECK_SERVICENAME_extra756="redshift"
|
|
CHECK_RISK_extra756='Publicly accessible services could expose sensible data to bad actors.'
|
|
CHECK_REMEDIATION_extra756='Ensure there is a business requirement for service to be public. Use the cluster security group to control access to the service.'
|
|
CHECK_DOC_extra756='https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html'
|
|
CHECK_CAF_EPIC_extra756='Infrastructure Security'
|
|
|
|
extra756(){
|
|
for regx in $REGIONS; do
|
|
LIST_OF_RS_CLUSTERS=$($AWSCLI $PROFILE_OPT redshift describe-clusters --region $regx --query Clusters[*].ClusterIdentifier --output text)
|
|
if [[ $LIST_OF_RS_CLUSTERS ]];then
|
|
for cluster in $LIST_OF_RS_CLUSTERS; do
|
|
IS_PUBLICLY_ACCESSIBLE=$($AWSCLI $PROFILE_OPT redshift describe-clusters --region $regx --cluster-identifier $cluster --query Clusters[*].PubliclyAccessible --output text|grep True)
|
|
if [[ $IS_PUBLICLY_ACCESSIBLE ]]; then
|
|
textFail "$regx: Redshift cluster $cluster is publicly accessible" "$regx" "$cluster"
|
|
else
|
|
textPass "$regx: Redshift cluster $cluster is not publicly accessible" "$regx" "$cluster"
|
|
fi
|
|
done
|
|
else
|
|
textInfo "$regx: No Redshift clusters found" "$regx"
|
|
fi
|
|
done
|
|
}
|