Existing VPC Network Guide

This guide helps you to prepare your VPC and debug networking issues using the Existing VPC delivery method.

You can stop reading if you use the delivery method Dedicated public VPC or Dedicated private VPC.

Required outbound communication

Required outbound ports are TCP/80 and TCP/443. If you use Delivery Method Existing VPC in a VPC with enableDnsSupport set to false, you also have to allow TCP/53 and UDP/53.

The following outbound requests are made (replace REGION with AWS Region, e.g., us-east-1; get the value from the top right in the AWS UI).

  • https://sns.REGION.amazonaws.com: SNS API to publish scan results to the Findings Topic.
  • https://sqs.REGION.amazonaws.com: SQS API to read from the Scan Queue.
  • http(s)://s3.REGION.amazonaws.com: S3 API to interact with files; also required for cfn-init and cfn-signal tools and Amazon Linux 2 yum repo.
  • http(s)://s3.amazonaws.com: S3 API to interact with files; also required for cfn-init and cfn-signal tools and Amazon Linux 2 yum repo.
  • https://monitoring.REGION.amazonaws.com: CloudWatch API to publish memory, disk, and swap metrics.
  • https://logs.REGION.amazonaws.com: CloudWatch Logs API to publish logs.
  • https://cloudformation.REGION.amazonaws.com: CloudFormation API required for cfn-init and cfn-signal tools.
  • https://ssm.REGION.amazonaws.com: SSM API for Session Manager (if SystemsManagerAccess is set to true).
  • https://ssmmessages.REGION.amazonaws.com: SSM API for Session Manager (if SystemsManagerAccess is set to true).
  • https://ec2messages.REGION.amazonaws.com: SSM API for Session Manager (if SystemsManagerAccess is set to true).
  • https://metering.marketplace.REGION.amazonaws.com: AWS Marketplace (bucketAV powered by Sophos® only).
  • https://REGION.savmirror.bucketav.com: bucketAV Sophos mirror manifest (bucketAV powered by Sophos® only).

You can’t restrict the IP address range. The resolved IP addresses change frequently.

Outbound requests to https://database.clamav.net and https://ec2.REGION.amazonaws.com as well as DNS lookups of current.cvd.clamav.net are removed since bucketAV powered by ClamAV® version >= 2.5.0.

If you are using an endpoint policy to protect your S3 VPC gateway interface, you must allowlist the S3 buckets you want bucketAV to access and bucketav-clamav-mirror-${REGION} or bucketav-sophos-mirror-${REGION}.

Debug network issues

If you follow the Setup Guide, we advise you to skip the CloudFormation Configure stack options step and tell you to “Scroll to the bottom of the page and click on Next”. To debug a networking issue, you must set the Stack failure options to Preserve successfully provisioned resources to avoid a stack rollback. After fixing the issues, please remove the CloudFormation stack and start from scratch.

Connect to one of the bucketAV EC2 instances (Session Manager is likely not working if the network configuration is not yet complete).

To avoid instance termination because of a scale-in, set the AutoScalingMinSize configuration parameter to 1.

Requires bucketAV powered by ClamAV® version >= 2.8.0 or bucketAV powered by Sophos® version >= 2.0.0. To update to the latest version, follow the Update Guide.

Run the test script:

sudo /home/ec2-user/networktest.sh

The script output should look like this.

[SUCCESS] Connected to SNS successfully.
[SUCCESS] Connected to SQS successfully.
[SUCCESS] Connected to S3 (Region) successfully.
[SUCCESS] Connected to S3 (HTTP) successfully.
[SUCCESS] Connected to S3 (Global) successfully.
[SUCCESS] Connected to CloudWatch Monitoring successfully.
[SUCCESS] Connected to CloudWatch Logs successfully.
[SUCCESS] Connected to CloudFormation successfully.
[SUCCESS] Connected to SSM successfully.
[SUCCESS] Connected to SSM Messages successfully.
[SUCCESS] Connected to EC2 Messages successfully.
[SUCCESS] Connected to ClamAV Mirror successfully.
[SUCCESS] Connected to Amazon Linux 2 Repository successfully.

Watch out for [FAILURE] messages.

Fixing networking issues

As network configurations differ, we cannot provide a solution but give you some hints.

Internet Gateway

Check the routing table attached to the subnet of a bucketAV instance. In case the route table contains an entry for 0.0.0.0/0 pointing to an Internet Gateway (igw-) you are deploying bucketAV into a public subnet.

In this case, you must ensure that bucketAV attaches a public IP address when launching an EC2 instance. Set the AssociatePublicIpAddress configuration parameter to true.

Also, ensure that all subnets used by bucketAV (see the Subnets configuration parameter) use a routing table with an entry pointing to the Internet Gateway.

NAT Gateway

If you deployed bucketAV into a subnet without an Internet Gateway, you might use a typical VPC configuration with private and public subnets. Again, check the routing table attached to the subnet of a bucketAV instance. In case the route table contains an entry for 0.0.0.0/0 pointing to a NAT Gateway (ngw-) you are deploying bucketAV into a private subnet with access to a NAT Gateway.

  1. Verify that the Network Access Control List attached to the subnet used by bucketAV and the NAT Gateway allow outbound traffic on port 443 (HTTPS) and 80 (HTTP) as well as inbound traffic on high ports.
  2. Verify that all subnets used by bucketAV (see the Subnets configuration parameter) use a routing table with an entry pointing to the NAT Gateway.

VPC Endpoint

If the subnets are neither connected with an Internet Gateway nor a NAT Gateway, we recommend configuring VPC Endpoints for the AWS services required by bucketAV (replace REGION with AWS Region, e.g., us-east-1; get the value from the top right in the AWS UI).

com.amazonaws.REGION.sns (Interface)
com.amazonaws.REGION.sqs (Interface)
com.amazonaws.REGION.s3 (Gateway)
com.amazonaws.REGION.monitoring (Interface)
com.amazonaws.REGION.logs (Interface)
com.amazonaws.REGION.cloudformation (Interface)

If you set the SystemsManagerAccess configuration parameter to true, additional VPC endpoints are required.

com.amazonaws.REGION.ssm (Interface)
com.amazonaws.REGION.ssmmessages (Interface)
com.amazonaws.REGION.ec2messages (Interface)

Need more help?

Write us, and we'll get back to you as soon as we can.

Send us an email