Network Guide

We offer three delivery methods (aka fulfillment options) for bucketAV:

  • Dedicated public VPC (dedicated-public-vpc)
  • Dedicated private VPC (dedicated-private-vpc)
  • Existing VPC (shared-vpc)

We recommend using the Dedicated public VPC or Dedicated private VPC delivery method for two reasons. First, in our opinion, you should isolate the network used by bucketAV to scan potentially infected files from any other networks. Second, the complexity of setting up bucketAV increases when choosing the Existing VPC delivery method.

This guide helps you debug networking issues using the Existing VPC delivery method. If you use Dedicated public VPC or Dedicated private VPC you can stop reading.

Debug network issues

If you follow our 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.

Use SSH to connect to one of the EC2 instances launched by bucketAV (Session Manager is likely not working if the network configuration is not yet complete). Check out My SSH connection is not working; what’s wrong? if you have trouble connecting to a machine.

To avoid instance termination because of a scale-in, set the AutoScalingMinSize to 1 (see How can I edit the configuration?).

Requires bucketAV version >= 2.8.0. To update to the latest version, follow our Update Guide.

Run the test script:

/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.

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).

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 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}.

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 parameter to true. Check out How can I edit the configuration? in case you need detailed instructions on how to do so.

Also, ensure that all subnets used by bucketAV (see Subnets 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 Subnets 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 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