Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
Issue
Check CKV2_AWS_5 is failing when you try to create an Elastic DocumentDB cluster using Terraform because the Security Group attached to the cluster is not recognized.
Check: CKV2_AWS_5: "Ensure that Security Groups are attached to another resource"
FAILED for resource: aws_security_group.docdb_sg
File: /main.tf:39-58
Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-networking-policies/ensure-that-security-groups-are-attached-to-ec2-instances-or-elastic-network-interfaces-enis
Issue Check CKV2_AWS_5 is failing when you try to create an Elastic DocumentDB cluster using Terraform because the Security Group attached to the cluster is not recognized.
Example