AWS Transit Gateway auto accept vpc attachment is enabled misconfiguration detected in code
Rule Details
Cortex AppSec Rule ID
APPSEC_AWS_331
Category - Subcategory
Public Exposure - VPC VCN VNet
Provider
AWS
Severity
LOW
Framework
Terraform, Terraform Plan
Mapped CSPM/KSPM Rule
9ea06c8e-f1a9-47e9-9519-2a4604bdeb98
Impact
This rule verifies whether Transit Gateways are configured not to automatically accept Virtual Private Cloud (VPC) attachment requests. Transit Gateways allow for the connection of multiple VPCs and on-premises networks in a single gateway. The issue arises when these gateways are set to automatically accept VPC attachment requests, as this could potentially allow unauthorized or unintended networks to connect to the gateway. This could therefore provide a malicious entity or user with access to all networks connected to the gateway, leading to a potential breach of security and loss of sensitive data. Therefore, Transit Gateways should be securely configured to manually review and accept VPC attachment requests.
How to Fix
Resource: aws_ec2_transit_gateway
Arguments: auto_accept_shared_attachments
To fix the issue, you need to disable automatic acceptance of VPC attachment requests in your Terraform code. This can be done by setting the "auto_accept_shared_attachments" variable to "disable" in your AWS Transit Gateways configuration. Here is how to do this: [source,go]
resource "aws_ec2_transit_gateway" "example" { description = "example" auto_accept_shared_attachments = "disable" }
Last updated
Was this helpful?
