-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added check extra756 Redshift cluster public
- Loading branch information
Toni de la Fuente
committed
May 16, 2019
1 parent
5cd7214
commit b8c7915
Showing
1 changed file
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/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 (Not Scored) (Not part of CIS benchmark)" | ||
CHECK_SCORED_extra756="NOT_SCORED" | ||
CHECK_TYPE_extra756="EXTRA" | ||
CHECK_ALTERNATE_check756="extra756" | ||
|
||
extra756(){ | ||
for regx in $REGIONS; do | ||
LIST_OF_RS_CLUSTERS=$($AWSCLI $PROFILE_OPT --region $regx redshift describe-clusters --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 --region $regx redshift describe-clusters --cluster-identifier $cluster --query Clusters[*].PubliclyAccessible --output text|grep True) | ||
if [[ $IS_PUBLICLY_ACCESSIBLE ]]; then | ||
textFail "$regx: Redshift cluster $cluster is publicly accessible" "$regx" | ||
else | ||
textPass "$regx: Redshift cluster $cluster is not publicly accessible" "$regx" | ||
fi | ||
done | ||
else | ||
textInfo "$regx: Redshift clusters found" "$regx" | ||
fi | ||
done | ||
} |