Repository: prowler-cloud/prowler
Issue category: Bug Report

rds_instance_no_public_access reports incorrect SG
### Steps to Reproduce

1. prowler aws -c rds_instance_no_public_access
2. AWS
3. N/A
4. See finding's `status_detail`

### Expected behavior

The status detail should correctly identify the Security Group(s) that contain the rule(s)

### Actual Result with Screenshots or Logs

Only one group is in the detail, and it may not be the group that actually has the rule(s). Result may change between runs
![rds_check_correct](https://github.com/user-attachments/assets/743e8e8f-cd97-40f1-8e7e-e85f94c1eb1d)
![rds_check_incorrect](https://github.com/user-attachments/assets/fe7dd840-a636-4ff5-b19f-ef8a6eac5bfc)


### How did you install Prowler?

From pip package (pip install prowler)

### Environment Resource

ECS/Locally

### OS used

Amazon Linux 2/WSL

### Prowler version

Prowler 4.5.3 (You are running the latest version, yay!)

### Pip version

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

### Context

No changes made between scan runs.
`Default` SG is attached but has no rules.


Functions to edit:
prowler/providers/aws/services/rds/rds_instance_no_public_access/rds_instance_no_public_access.py:rds_instance_no_public_access.execute

Patch:
diff --git a/prowler/providers/aws/services/rds/rds_instance_no_public_access/rds_instance_no_public_access.py b/prowler/providers/aws/services/rds/rds_instance_no_public_access/rds_instance_no_public_access.py
index ca0e1b3bebe..dffa850693c 100644
--- a/prowler/providers/aws/services/rds/rds_instance_no_public_access/rds_instance_no_public_access.py
+++ b/prowler/providers/aws/services/rds/rds_instance_no_public_access/rds_instance_no_public_access.py
@@ -37,18 +37,21 @@ def execute(self):
                                     ):
                                         report.status_extended = f"RDS Instance {db_instance.id} is set as publicly accessible and security group {security_group.name} ({security_group.id}) has {db_instance.engine} port {db_instance_port} open to the Internet at endpoint {db_instance.endpoint.get('Address')} but is not in a public subnet."
                                         public_sg = True
+                                        if db_instance.subnet_ids:
+                                            for subnet_id in db_instance.subnet_ids:
+                                                if (
+                                                    subnet_id in vpc_client.vpc_subnets
+                                                    and vpc_client.vpc_subnets[
+                                                        subnet_id
+                                                    ].public
+                                                ):
+                                                    report.status = "FAIL"
+                                                    report.status_extended = f"RDS Instance {db_instance.id} is set as publicly accessible and security group {security_group.name} ({security_group.id}) has {db_instance.engine} port {db_instance_port} open to the Internet at endpoint {db_instance.endpoint.get('Address')} in a public subnet {subnet_id}."
+                                                    break
+                                    if public_sg:
                                         break
                             if public_sg:
                                 break
-                        if db_instance.subnet_ids:
-                            for subnet_id in db_instance.subnet_ids:
-                                if (
-                                    subnet_id in vpc_client.vpc_subnets
-                                    and vpc_client.vpc_subnets[subnet_id].public
-                                ):
-                                    report.status = "FAIL"
-                                    report.status_extended = f"RDS Instance {db_instance.id} is set as publicly accessible and security group {security_group.name} ({security_group.id}) has {db_instance.engine} port {db_instance_port} open to the Internet at endpoint {db_instance.endpoint.get('Address')} in a public subnet {subnet_id}."
-                                    break
 
             findings.append(report)