Fix (extra7148 and add action #1017 (#1021)

This commit is contained in:
Toni de la Fuente
2022-02-04 11:58:22 -05:00
committed by GitHub
parent 679414418e
commit 1d409d04f2
7 changed files with 13 additions and 3 deletions

View File

@@ -33,7 +33,11 @@ extra7148() {
if [[ $LIST_OF_EFS_SYSTEMS ]]; then if [[ $LIST_OF_EFS_SYSTEMS ]]; then
for filesystem in $LIST_OF_EFS_SYSTEMS; do for filesystem in $LIST_OF_EFS_SYSTEMS; do
# if retention is 0 then is disabled # 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) BACKUP_POLICY=$($AWSCLI efs describe-backup-policy $PROFILE_OPT --region $regx --file-system-id $filesystem --query BackupPolicy --output text 2>&1)
if [[ $(echo "$BACKUP_POLICY" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to describe backup policy" "$regx"
continue
fi
if [[ $BACKUP_POLICY == "DISABLED" ]]; then if [[ $BACKUP_POLICY == "DISABLED" ]]; then
textFail "$regx: File system $filesystem does not have backup enabled!" "$regx" "$filesystem" textFail "$regx: File system $filesystem does not have backup enabled!" "$regx" "$filesystem"
else else

View File

@@ -67,4 +67,5 @@ Resources:
- 's3:GetAccountPublicAccessBlock' - 's3:GetAccountPublicAccessBlock'
- 'shield:GetSubscriptionState' - 'shield:GetSubscriptionState'
- 'shield:DescribeProtection' - 'shield:DescribeProtection'
- 'elasticfilesystem:DescribeBackupPolicy'
Resource: '*' Resource: '*'

View File

@@ -14,7 +14,8 @@
"glue:SearchTables", "glue:SearchTables",
"s3:GetAccountPublicAccessBlock", "s3:GetAccountPublicAccessBlock",
"shield:GetSubscriptionState", "shield:GetSubscriptionState",
"shield:DescribeProtection" "shield:DescribeProtection",
"elasticfilesystem:DescribeBackupPolicy"
], ],
"Resource": "*", "Resource": "*",
"Effect": "Allow", "Effect": "Allow",

View File

@@ -196,6 +196,7 @@ Resources:
- s3:GetAccountPublicAccessBlock - s3:GetAccountPublicAccessBlock
- shield:GetSubscriptionState - shield:GetSubscriptionState
- shield:DescribeProtection - shield:DescribeProtection
- elasticfilesystem:DescribeBackupPolicy
Effect: Allow Effect: Allow
Resource: !Sub 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:catalog' Resource: !Sub 'arn:aws:glue:${AWS::Region}:${AWS::AccountId}:catalog'
- PolicyName: CodeBuild - PolicyName: CodeBuild

View File

@@ -98,6 +98,7 @@ Resources:
- tag:GetTagKeys - tag:GetTagKeys
- shield:GetSubscriptionState - shield:GetSubscriptionState
- shield:DescribeProtection - shield:DescribeProtection
- elasticfilesystem:DescribeBackupPolicy
- PolicyName: Prowler-S3-Reports - PolicyName: Prowler-S3-Reports
PolicyDocument: PolicyDocument:
Version: 2012-10-17 Version: 2012-10-17

View File

@@ -99,6 +99,7 @@ Resources:
- tag:GetTagKeys - tag:GetTagKeys
- shield:GetSubscriptionState - shield:GetSubscriptionState
- shield:DescribeProtection - shield:DescribeProtection
- elasticfilesystem:DescribeBackupPolicy
- PolicyName: Prowler-S3-Reports - PolicyName: Prowler-S3-Reports
PolicyDocument: PolicyDocument:
Version: 2012-10-17 Version: 2012-10-17

View File

@@ -322,7 +322,8 @@ resource "aws_iam_policy" "prowler_kickstarter_iam_policy" {
"glue:SearchTables", "glue:SearchTables",
"s3:GetAccountPublicAccessBlock", "s3:GetAccountPublicAccessBlock",
"shield:GetSubscriptionState", "shield:GetSubscriptionState",
"shield:DescribeProtection" "shield:DescribeProtection",
"elasticfilesystem:DescribeBackupPolicy"
] ]
Effect = "Allow" Effect = "Allow"
Resource = "arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:catalog" Resource = "arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:catalog"