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

Issue:
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.


Hints:
Looks like in code the IF Statement will `break ` on the first instance of port=DB PORT (3306) and source=ANY and will not report on any other Security groups. Its either public or its not. I suspect that the check doesnt matter how many SGs allow access from ANY, its the fact the RDS instance is publicly available flags it as a fail.


Thanks for the ping! @jmanduca-psfy I'll review your issue with the team.
Thanks @garym-krrv for the insight too, that looks strange 🤔 

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)
 


Test patch: