Repository: prowler-cloud/prowler

Issue:
[Bug]: backup_plans_exist and backup_reportplans_exist trigger in regions where not backups exist
### Steps to Reproduce

The mentioned checks are triggered even if no backups are present or configured.

### Expected behavior

When the check can't find a resource ID (it actually says "No Backups"), the check shouldn't trigger

### Actual Result with Screenshots or Logs

![image](https://user-images.githubusercontent.com/49124793/234267687-dcbcbe11-2d15-43ba-84ee-575f28719ffd.png)


### How did you install Prowler?

From pip package (pip install prowler)

### Environment Resource

Workstation

### OS used

WSL2 under Windows 11

### Prowler version

Prowler 3.4.0 (it is the latest version, yay!)

### Pip version

pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

### Context

_No response_


Discussion:
Hi @blaargh, we are checking that. We will get back to you when we finish our analysis.

Thanks for using Prowler 🚀 

Resolving patch:
diff --git a/prowler/providers/aws/services/backup/backup_plans_exist/backup_plans_exist.py b/prowler/providers/aws/services/backup/backup_plans_exist/backup_plans_exist.py
--- a/prowler/providers/aws/services/backup/backup_plans_exist/backup_plans_exist.py
+++ b/prowler/providers/aws/services/backup/backup_plans_exist/backup_plans_exist.py
@@ -9,11 +9,13 @@ def execute(self):
         report.status = "FAIL"
         report.status_extended = "No Backup Plan Exist"
         report.resource_arn = ""
-        report.resource_id = "No Backups"
+        report.resource_id = "Backups"
         report.region = backup_client.region
         if backup_client.backup_plans:
             report.status = "PASS"
-            report.status_extended = f"At least one backup plan exists: { backup_client.backup_plans[0].name}"
+            report.status_extended = (
+                f"At least one backup plan exists: {backup_client.backup_plans[0].name}"
+            )
             report.resource_arn = backup_client.backup_plans[0].arn
             report.resource_id = backup_client.backup_plans[0].name
             report.region = backup_client.backup_plans[0].region
diff --git a/prowler/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist.py b/prowler/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist.py
--- a/prowler/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist.py
+++ b/prowler/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist.py
@@ -5,18 +5,20 @@
 class backup_reportplans_exist(Check):
     def execute(self):
         findings = []
-        report = Check_Report_AWS(self.metadata())
-        report.status = "FAIL"
-        report.status_extended = "No Backup Report Plan Exist"
-        report.resource_arn = ""
-        report.resource_id = "No Backups"
-        report.region = backup_client.region
-        if backup_client.backup_report_plans:
-            report.status = "PASS"
-            report.status_extended = f"At least one backup report plan exists: { backup_client.backup_report_plans[0].name}"
-            report.resource_arn = backup_client.backup_report_plans[0].arn
-            report.resource_id = backup_client.backup_report_plans[0].name
-            report.region = backup_client.backup_report_plans[0].region
+        # We only check report plans if backup plans exist, reducing noise
+        if backup_client.backup_plans:
+            report = Check_Report_AWS(self.metadata())
+            report.status = "FAIL"
+            report.status_extended = "No Backup Report Plan Exist"
+            report.resource_arn = ""
+            report.resource_id = "Backups"
+            report.region = backup_client.region
+            if backup_client.backup_report_plans:
+                report.status = "PASS"
+                report.status_extended = f"At least one backup report plan exists: { backup_client.backup_report_plans[0].name}"
+                report.resource_arn = backup_client.backup_report_plans[0].arn
+                report.resource_id = backup_client.backup_report_plans[0].name
+                report.region = backup_client.backup_report_plans[0].region
 
-        findings.append(report)
+            findings.append(report)
         return findings
diff --git a/prowler/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist.py b/prowler/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist.py
--- a/prowler/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist.py
+++ b/prowler/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist.py
@@ -9,7 +9,7 @@ def execute(self):
         report.status = "FAIL"
         report.status_extended = "No Backup Vault Exist"
         report.resource_arn = ""
-        report.resource_id = "No Backups"
+        report.resource_id = "Backups"
         report.region = backup_client.region
         if backup_client.backup_vaults:
             report.status = "PASS"


Test patch:
diff --git a/tests/providers/aws/services/backup/backup_plans_exist/backup_plans_exist_test.py b/tests/providers/aws/services/backup/backup_plans_exist/backup_plans_exist_test.py
--- a/tests/providers/aws/services/backup/backup_plans_exist/backup_plans_exist_test.py
+++ b/tests/providers/aws/services/backup/backup_plans_exist/backup_plans_exist_test.py
@@ -26,7 +26,7 @@ def test_no_backup_plans(self):
             assert len(result) == 1
             assert result[0].status == "FAIL"
             assert result[0].status_extended == "No Backup Plan Exist"
-            assert result[0].resource_id == "No Backups"
+            assert result[0].resource_id == "Backups"
             assert result[0].resource_arn == ""
             assert result[0].region == AWS_REGION
 
diff --git a/tests/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist_test.py b/tests/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist_test.py
--- a/tests/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist_test.py
+++ b/tests/providers/aws/services/backup/backup_reportplans_exist/backup_reportplans_exist_test.py
@@ -1,15 +1,47 @@
 from datetime import datetime
 from unittest import mock
 
-from prowler.providers.aws.services.backup.backup_service import BackupReportPlan
+from prowler.providers.aws.services.backup.backup_service import (
+    BackupPlan,
+    BackupReportPlan,
+)
 
 AWS_REGION = "eu-west-1"
 
 
 class Test_backup_reportplans_exist:
+    def test_no_backup_plans(self):
+        backup_client = mock.MagicMock
+        backup_client.region = AWS_REGION
+        backup_client.backup_plans = []
+        with mock.patch(
+            "prowler.providers.aws.services.backup.backup_service.Backup",
+            new=backup_client,
+        ):
+            # Test Check
+            from prowler.providers.aws.services.backup.backup_reportplans_exist.backup_reportplans_exist import (
+                backup_reportplans_exist,
+            )
+
+            check = backup_reportplans_exist()
+            result = check.execute()
+
+            assert len(result) == 0
+
     def test_no_backup_report_plans(self):
         backup_client = mock.MagicMock
         backup_client.region = AWS_REGION
+        backup_client.backup_plans = [
+            BackupPlan(
+                arn="ARN",
+                id="MyBackupPlan",
+                region=AWS_REGION,
+                name="MyBackupPlan",
+                version_id="version_id",
+                last_execution_date=datetime(2015, 1, 1),
+                advanced_settings=[],
+            )
+        ]
         backup_client.backup_report_plans = []
         with mock.patch(
             "prowler.providers.aws.services.backup.backup_service.Backup",
@@ -26,13 +58,24 @@ def test_no_backup_report_plans(self):
             assert len(result) == 1
             assert result[0].status == "FAIL"
             assert result[0].status_extended == "No Backup Report Plan Exist"
-            assert result[0].resource_id == "No Backups"
+            assert result[0].resource_id == "Backups"
             assert result[0].resource_arn == ""
             assert result[0].region == AWS_REGION
 
     def test_one_backup_report_plan(self):
         backup_client = mock.MagicMock
         backup_client.region = AWS_REGION
+        backup_client.backup_plans = [
+            BackupPlan(
+                arn="ARN",
+                id="MyBackupPlan",
+                region=AWS_REGION,
+                name="MyBackupPlan",
+                version_id="version_id",
+                last_execution_date=datetime(2015, 1, 1),
+                advanced_settings=[],
+            )
+        ]
         backup_client.backup_report_plans = [
             BackupReportPlan(
                 arn="ARN",
diff --git a/tests/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist_test.py b/tests/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist_test.py
--- a/tests/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist_test.py
+++ b/tests/providers/aws/services/backup/backup_vaults_exist/backup_vaults_exist_test.py
@@ -25,7 +25,7 @@ def test_no_backup_vaults(self):
             assert len(result) == 1
             assert result[0].status == "FAIL"
             assert result[0].status_extended == "No Backup Vault Exist"
-            assert result[0].resource_id == "No Backups"
+            assert result[0].resource_id == "Backups"
             assert result[0].resource_arn == ""
             assert result[0].region == AWS_REGION