From b3aa82a3b0696580b4c9c49d478611a9a4188cf8 Mon Sep 17 00:00:00 2001 From: George Date: Wed, 8 Sep 2021 16:01:18 -0400 Subject: [PATCH 1/3] New Prowler Check 7148 by George O. submitted for review --- checks/check_extra7148 | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 checks/check_extra7148 diff --git a/checks/check_extra7148 b/checks/check_extra7148 new file mode 100644 index 00000000..1120478e --- /dev/null +++ b/checks/check_extra7148 @@ -0,0 +1,43 @@ +#!/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. +CHECK_ID_extra7148="7.148" +CHECK_TITLE_extra7148="[extra7148] Check if EFS File systems have backup enabled" +CHECK_SCORED_extra7148="NOT_SCORED" +CHECK_TYPE_extra7148="EXTRA" +CHECK_SEVERITY_extra7148="Medium" +CHECK_ASFF_RESOURCE_TYPE_extra7148="AwsEfsFileSystem" +CHECK_ALTERNATE_check7148="extra7148" +CHECK_SERVICENAME_extra7148="efs" +CHECK_RISK_extra7148='If backup is not enabled; data is vulnerable. Human error or bad actors could erase or modify data.' +CHECK_REMEDIATION_extra7148='Enable automated backup for production data. Define a retention period and periodically test backup restoration. A Disaster Recovery process should be in place to govern Data Protection approach.' +CHECK_DOC_extra7148='https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html' +CHECK_CAF_EPIC_extra7148='Data Protection' + +extra7148() { + for regx in $REGIONS; do + LIST_OF_EFS_SYSTEMS=$($AWSCLI efs describe-file-systems $PROFILE_OPT --region $regx --query 'FileSystems[*].FileSystemId' --output text) + if [[ $LIST_OF_EFS_SYSTEMS ]]; then + for filesystem in $LIST_OF_EFS_SYSTEMS; do + # if retention is 0 then is disabled + BACKUP_POLICY=$($AWSCLI efs describe-backup-policy $PROFILE_OPT --region $regx --file-system-id $filesystem --query BackupPolicy --output text) + if [[ $BACKUP_POLICY == "DISABLED" ]]; then + textFail "$regx: File system $filesystem does not have backup enabled!" "$regx" "$filesystem" + else + textPass "$regx: EFS File system $filesystem has backup enabled" "$regx" "$filesystem" + fi + done + else + textInfo "$regx: No EFS File systems found" "$regx" "$filesystem" + fi + done +} From e17d6e580f8e282dc558f82cc4f204c639351149 Mon Sep 17 00:00:00 2001 From: George Date: Fri, 10 Sep 2021 09:22:21 -0400 Subject: [PATCH 2/3] New Prowler Check 7149 by George O. submitted for review --- checks/check_extra7149 | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 checks/check_extra7149 diff --git a/checks/check_extra7149 b/checks/check_extra7149 new file mode 100644 index 00000000..85b35e6f --- /dev/null +++ b/checks/check_extra7149 @@ -0,0 +1,43 @@ +#!/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. +CHECK_ID_extra7149="7.149" +CHECK_TITLE_extra7149="[extra7149] Check if Redshift Clusters have automated snapshots enabled" +CHECK_SCORED_extra7149="NOT_SCORED" +CHECK_TYPE_extra7149="EXTRA" +CHECK_SEVERITY_extra7149="Medium" +CHECK_ASFF_RESOURCE_TYPE_extra7149="AwsRedshiftCluster" +CHECK_ALTERNATE_check7149="extra7149" +CHECK_SERVICENAME_extra7149="redshift" +CHECK_RISK_extra7149='If backup is not enabled; data is vulnerable. Human error or bad actors could erase or modify data.' +CHECK_REMEDIATION_extra7149='Enable automated backup for production data. Define a retention period and periodically test backup restoration. A Disaster Recovery process should be in place to govern Data Protection approach.' +CHECK_DOC_extra7149='https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Redshift.html' +CHECK_CAF_EPIC_extra7149='Data Protection' + +extra7149() { + # "Check if Redshift cluster has audit logging enabled " + for regx in $REGIONS; do + LIST_OF_REDSHIFT_CLUSTERS=$($AWSCLI redshift describe-clusters $PROFILE_OPT --region $regx --query 'Clusters[*].ClusterIdentifier' --output text) + if [[ $LIST_OF_REDSHIFT_CLUSTERS ]]; then + for redshiftcluster in $LIST_OF_REDSHIFT_CLUSTERS; do + REDSHIFT_SNAPSHOT_ENABLED=$($AWSCLI redshift describe-cluster-snapshots $PROFILE_OPT --region $regx --cluster-identifier $redshiftcluster --snapshot-type automated) + if [[ $REDSHIFT_SNAPSHOT_ENABLED ]]; then + textPass "$regx: Redshift cluster $redshiftcluster has automated snapshots $REDSHIFT_SNAPSHOT_ENABLED" "$regx" "$redshiftcluster" + else + textFail "$regx: Redshift cluster $redshiftcluster has automated snapshots disabled!" "$regx" "$redshiftcluster" + fi + done + else + textInfo "$regx: No Redshift cluster configured" "$regx" + fi + done +} From 8586b1073d4ee144483d1d32c364248c6f553d2f Mon Sep 17 00:00:00 2001 From: georgie969 <90351691+georgie969@users.noreply.github.com> Date: Fri, 10 Sep 2021 10:52:15 -0400 Subject: [PATCH 3/3] Delete extra_check7149 This file (7149) was committed in error --- checks/check_extra7149 | 43 ------------------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 checks/check_extra7149 diff --git a/checks/check_extra7149 b/checks/check_extra7149 deleted file mode 100644 index 85b35e6f..00000000 --- a/checks/check_extra7149 +++ /dev/null @@ -1,43 +0,0 @@ -#!/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. -CHECK_ID_extra7149="7.149" -CHECK_TITLE_extra7149="[extra7149] Check if Redshift Clusters have automated snapshots enabled" -CHECK_SCORED_extra7149="NOT_SCORED" -CHECK_TYPE_extra7149="EXTRA" -CHECK_SEVERITY_extra7149="Medium" -CHECK_ASFF_RESOURCE_TYPE_extra7149="AwsRedshiftCluster" -CHECK_ALTERNATE_check7149="extra7149" -CHECK_SERVICENAME_extra7149="redshift" -CHECK_RISK_extra7149='If backup is not enabled; data is vulnerable. Human error or bad actors could erase or modify data.' -CHECK_REMEDIATION_extra7149='Enable automated backup for production data. Define a retention period and periodically test backup restoration. A Disaster Recovery process should be in place to govern Data Protection approach.' -CHECK_DOC_extra7149='https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Redshift.html' -CHECK_CAF_EPIC_extra7149='Data Protection' - -extra7149() { - # "Check if Redshift cluster has audit logging enabled " - for regx in $REGIONS; do - LIST_OF_REDSHIFT_CLUSTERS=$($AWSCLI redshift describe-clusters $PROFILE_OPT --region $regx --query 'Clusters[*].ClusterIdentifier' --output text) - if [[ $LIST_OF_REDSHIFT_CLUSTERS ]]; then - for redshiftcluster in $LIST_OF_REDSHIFT_CLUSTERS; do - REDSHIFT_SNAPSHOT_ENABLED=$($AWSCLI redshift describe-cluster-snapshots $PROFILE_OPT --region $regx --cluster-identifier $redshiftcluster --snapshot-type automated) - if [[ $REDSHIFT_SNAPSHOT_ENABLED ]]; then - textPass "$regx: Redshift cluster $redshiftcluster has automated snapshots $REDSHIFT_SNAPSHOT_ENABLED" "$regx" "$redshiftcluster" - else - textFail "$regx: Redshift cluster $redshiftcluster has automated snapshots disabled!" "$regx" "$redshiftcluster" - fi - done - else - textInfo "$regx: No Redshift cluster configured" "$regx" - fi - done -}