Repository: bridgecrewio/checkov (language: python)

Issue:
Security group attached to aws_mskconnect_connector is not recognized
**Describe the issue**
Check CKV2_AWS_5 is failing when you try to create an MSK Connect connector using Terraform because the Security Group attached to the cluster is not recognized.

**Examples**
```
resource "aws_security_group" "main" {
...
}

resource "aws_mskconnect_connector" "pass_msk_connect" {
  ...
  kafka_cluster {
    apache_kafka_cluster {
      vpc {
        security_groups = [aws_security_group.main.id]
      }
    }
  }
  ...
}
```
**Version (please complete the following information):**
 - 3.2.267

**Additional context**
```
Check: CKV2_AWS_5: "Ensure that Security Groups are attached to another resource"
  FAILED for resource: aws_security_group.msk-connect
  File: /connect.tf:145-155
```


Discussion / hints:

Fix patch:
diff --git a/checkov/terraform/checks/graph_checks/aws/SGAttachedToResource.yaml b/checkov/terraform/checks/graph_checks/aws/SGAttachedToResource.yaml
index a2ba34363d6..8d5a2f9b0ae 100644
--- a/checkov/terraform/checks/graph_checks/aws/SGAttachedToResource.yaml
+++ b/checkov/terraform/checks/graph_checks/aws/SGAttachedToResource.yaml
@@ -47,6 +47,7 @@ definition:
         - aws_memorydb_cluster
         - aws_mq_broker
         - aws_msk_cluster
+        - aws_mskconnect_connector
         - aws_mwaa_environment
         - aws_neptune_cluster
         - aws_network_interface


Test patch:
diff --git a/tests/terraform/graph/checks/resources/SGAttachedToResource/expected.yaml b/tests/terraform/graph/checks/resources/SGAttachedToResource/expected.yaml
index d3c33dc1bbe..f4009b9a389 100644
--- a/tests/terraform/graph/checks/resources/SGAttachedToResource/expected.yaml
+++ b/tests/terraform/graph/checks/resources/SGAttachedToResource/expected.yaml
@@ -35,6 +35,7 @@ pass:
   - "aws_security_group.pass_mq"
   - "aws_security_group.pass_mq_broker"
   - "aws_security_group.pass_msk"
+  - "aws_security_group.pass_msk_connect"
   - "aws_security_group.pass_mwaa"
   - "aws_security_group.pass_neptune"
   - "aws_security_group.pass_quicksight"
diff --git a/tests/terraform/graph/checks/resources/SGAttachedToResource/main.tf b/tests/terraform/graph/checks/resources/SGAttachedToResource/main.tf
index 3b1fbe791df..794c7e91e31 100644
--- a/tests/terraform/graph/checks/resources/SGAttachedToResource/main.tf
+++ b/tests/terraform/graph/checks/resources/SGAttachedToResource/main.tf
@@ -694,6 +694,37 @@ resource "aws_msk_cluster" "pass_msk" {
   }
 }
 
+
+# MSK Connect
+
+resource "aws_security_group" "pass_msk_connect" {
+  ingress {
+    description = "TLS from VPC"
+    from_port   = 443
+    to_port     = 443
+    protocol    = "tcp"
+    cidr_blocks = ["0.0.0.0/0"]
+  }
+}
+
+resource "aws_mskconnect_connector" "pass_msk_connect" {
+  connector_configuration    = {}
+  kafkaconnect_version       = "example-version"
+  name                       = "msk-connect"
+  service_execution_role_arn = "aws_iam_role.msk_connect.arn"
+
+  kafka_cluster {
+    apache_kafka_cluster {
+      bootstrap_servers = "bootstrap-servers"
+
+      vpc {
+        security_groups = [aws_security_group.pass_msk_connect.id]
+        subnets         = []
+      }
+    }
+  }
+}
+
 # MWAA
 
 resource "aws_security_group" "pass_mwaa" {