Skip to content

Commit f3ff836

Browse files
NMueeMxxxxxF
andauthored
fix: extra7167 Advanced Shield and CloudFront bug parsing None output without distributions (prowler-cloud#1053)
* fix: not to flag as finding for account without cloudfront distributions * fix: output empty for None from cloudfront list-distributions Co-authored-by: moo.xin.foo <[email protected]>
1 parent 99d1868 commit f3ff836

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

checks/check_extra7167

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ CHECK_CAF_EPIC_extra7167='Infrastructure security'
2626

2727
extra7167() {
2828
if [[ "$($AWSCLI $PROFILE_OPT shield get-subscription-state --output text)" == "ACTIVE" ]]; then
29-
LIST_OF_CLOUDFRONT_DISTRIBUTIONS=$($AWSCLI cloudfront list-distributions $PROFILE_OPT --query 'DistributionList.Items[*].[Id,ARN]' --output text)
30-
if [[ $LIST_OF_CLOUDFRONT_DISTRIBUTIONS ]]; then
29+
LIST_OF_CLOUDFRONT_DISTRIBUTIONS=$($AWSCLI cloudfront list-distributions $PROFILE_OPT --query 'DistributionList.Items[*].[Id,ARN]' --output text | grep -v None)
30+
if [[ $LIST_OF_CLOUDFRONT_DISTRIBUTIONS]]; then
3131
while read -r distribution; do
3232
DISTRIBUTION_ID=$(echo $distribution | awk '{ print $1; }')
3333
DISTRIBUTION_ARN=$(echo $distribution | awk '{ print $2; }')

0 commit comments

Comments
 (0)