Amazon EC2 with Suricata on the AWS Cloud
Quick Start Reference Deployment

September 2021
Pratik R. Mankad, AWS Strategic Accounts; Vaibhav Katkade, Amazon EC2 Product Management
Vinod Shukla, AWS Integration & Automation Team
Visit our GitHub repository for source files and to post feedback, report bugs, or submit feature ideas for this Quick Start. |
This Quick Start was created by Amazon Web Services (AWS). Quick Starts are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices.
Overview
This Quick Start deployment guide provides instructions for deploying an Amazon Elastic Compute Cloud (Amazon EC2) instance with Suricata, an open-source tool for monitoring network traffic with Amazon VPC Traffic Mirroring.
This Quick Start is for security, DevSecOps, and network engineers who want to monitor Amazon EC2 instance network traffic using Suricata.
The Quick Start provides AWS CloudFormation templates for deploying Suricata on a single Amazon Linux 2 EC2 instance for limited scale deployments or behind a Network Load Balancer in an Auto Scaling group for highly available larger deployments.
This Quick Start does not configure VPC Traffic Mirroring. For information about configuring Traffic Mirroring to monitor your network traffic, see the Traffic Mirroring getting start guide. |
Amazon EC2 with Suricata on AWS
Suricata is an open-source network intrusion detection system (IDS), intrusion prevention system (IPS), and network security monitoring (NSM) engine. Suricata supports Virtual Extensible LAN (VXLAN) for packet decapsulation. You can install Suricata on an EC2 instance to monitor VPC traffic using Traffic Mirroring, a feature of Amazon VPC.
Using Traffic Mirroring, you can copy network traffic from an elastic network interface of Amazon EC2 instances and then send the traffic to out-of-band security and monitoring appliances. Traffic Mirroring is used for troubleshooting, content inspection, and threat monitoring.
You can deploy Suricata’s security and monitoring appliances as individual instances, or as a fleet of instances behind a Network Load Balancer with a User Datagram Protocol (UDP) listener. Traffic Mirroring supports filters and packet truncation, so you extract only the desired traffic of interest using a monitoring tool such as Suricata.
AWS costs
You are responsible for the cost of the AWS services and any third-party licenses used while running this Quick Start. There is no additional cost for using the Quick Start.
The AWS CloudFormation templates for Quick Starts include configuration parameters that you can customize. Some of the settings, such as the instance type, affect the cost of deployment. For cost estimates, see the pricing pages for each AWS service you use. Prices are subject to change.
After you deploy the Quick Start, create AWS Cost and Usage Reports to deliver billing metrics to an Amazon Simple Storage Service (Amazon S3) bucket in your account. These reports provide cost estimates based on usage throughout each month and aggregate the data at the end of the month. For more information, see What are AWS Cost and Usage Reports? |
Software licenses
This Quick Start installs Suricata on an Amazon Linux 2 EC2 instance. The Suricata source code is licensed under version 2 of the GNU General Public License.
Architecture
Deploying this Quick Start for a new virtual private cloud (VPC) with default parameters builds the following Suricata on Amazon Linux 2 environment in the AWS Cloud.

As shown in Figure 1, the Quick Start sets up the following:
-
A highly available architecture that spans multiple Availability Zones.*
-
A VPC configured with public and private subnets according to AWS best practices, to provide you with your own virtual network on AWS.*
-
In the public subnets:
-
Managed network address translation (NAT) gateways to allow outbound internet access for resources in the private subnets.*
-
A Linux bastion host in an Auto Scaling group to allow inbound Secure Shell (SSH) access to EC2 instances in public and private subnets.*
-
-
In the private subnets:
-
EC2 instances in an Auto Scaling group used for deploying across two Availability Zones, offering high availability.
-
A Network Load Balancer to balance traffic between the EC2 instances. For limited scale deployments, you can skip the Network Load Balancer setup and work directly with Suricata deployed on a single Amazon Linux 2 instance by choosing
TrafficMirrorTargetType
asENI
andNumTargetEC2Instances
as1
. See Parameter reference section for details.
-
*The template that deploys the Quick Start into an existing VPC skips the components marked by asterisks and prompts you for your existing VPC configuration.
This Quick Start does not configure VPC Traffic Mirroring. For information about configuring Traffic Mirroring to monitor your network traffic, see the Traffic Mirroring getting start guide. |
Planning the deployment
Specialized knowledge
This deployment requires a moderate level of familiarity with AWS services. If you’re new to AWS, see Getting Started Resource Center and AWS Training and Certification. These sites provide materials for learning how to design, deploy, and operate your infrastructure and applications on the AWS Cloud.
This Quick Start assumes familiarity with Suricata and the following AWS services and components:
AWS account
If you don’t already have an AWS account, create one at https://aws.amazon.com by following the on-screen instructions. Part of the sign-up process involves receiving a phone call and entering a PIN using the phone keypad.
Your AWS account is automatically signed up for all AWS services. You are charged only for the services you use.
Technical requirements
Before you launch the Quick Start, review the following information and ensure that your account is properly configured. Otherwise, deployment might fail.
Resource quotas
If necessary, request service quota increases for the following resources. You might need to request increases if your existing deployment currently uses these resources and if this Quick Start deployment could result in exceeding the default quotas. The Service Quotas console displays your usage and quotas for some aspects of some services. For more information, see What is Service Quotas? and AWS service quotas.
Resource | This deployment uses |
---|---|
VPCs |
1 |
Elastic IP addresses |
3 |
Security groups |
2 |
AWS Identity and Access Management (IAM) roles |
1 |
Auto Scaling groups |
2 |
Network Load Balancers |
1 |
c5n.large instances |
2 |
t2.micro instances |
1 |
Supported AWS Regions
For any Quick Start to work in a Region other than its default Region, all the services it deploys must be supported in that Region. You can launch a Quick Start in any Region and see if it works. If you get an error such as “Unrecognized resource type,” the Quick Start is not supported in that Region.
For an up-to-date list of AWS Regions and the AWS services they support, see AWS Regional Services.
Certain Regions are available on an opt-in basis. For more information, see Managing AWS Regions. |
Amazon EC2 key pairs
Ensure that at least one Amazon EC2 key pair exists in your AWS account in the Region where you plan to deploy the Quick Start. Note the key-pair name because you will use it during deployment. To create a key pair, see Amazon EC2 key pairs and Linux instances.
For testing or proof-of-concept purposes, we recommend creating a new key pair instead of using one that’s already being used by a production instance.
IAM permissions
Before launching the Quick Start, you must sign in to the AWS Management Console with IAM permissions for the resources that the templates deploy. The AdministratorAccess managed policy within IAM provides sufficient permissions, although your organization may choose to use a custom policy with more restrictions. For more information, see AWS managed policies for job functions.
Deployment options
This Quick Start provides two deployment options:
-
Deploy Suricata on Amazon Linux 2 into a new VPC. This option builds a new AWS environment consisting of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys Suricata on Amazon Linux 2 into this new VPC.
-
Deploy Suricata on Amazon Linux 2 into an existing VPC. This option provisions Suricata on Amazon Linux 2 in your existing AWS infrastructure.
The Quick Start provides separate templates for these options. It also lets you configure Classless Inter-Domain Routing (CIDR) blocks, Traffic Mirroring target type, instance types, and Suricata on Amazon Linux 2 settings, as discussed later in this guide.
Deployment steps
Confirm your AWS account configuration
-
Sign in to your AWS account at https://aws.amazon.com with an IAM user role that has the necessary permissions. For details, see Planning the deployment earlier in this guide.
-
Make sure that your AWS account is configured correctly, as discussed in the Technical requirements section.
Launch the Quick Start
If you’re deploying Suricata on Amazon Linux 2 into an existing VPC, make sure that your VPC has two private subnets in different Availability Zones for the workload instances and that the subnets aren’t shared. This Quick Start doesn’t support shared subnets. These subnets require NAT gateways in their route tables to allow the instances to download packages and software without exposing them to the internet. Also make sure that the domain name option in the DHCP options is configured as explained in DHCP options sets. You provide your VPC settings when you launch the Quick Start. |
Each deployment takes about 10 minutes to complete.
-
Sign in to your AWS account, and choose one of the following options to launch the AWS CloudFormation template. For help with choosing an option, see Deployment options earlier in this guide.
Deploy Suricata on Amazon Linux 2 into an existing VPC on AWS
-
Check the AWS Region that’s displayed in the upper-right corner of the navigation bar, and change it if necessary. This Region is where you build the network infrastructure. The template is launched in the us-west-2 Region by default. For other choices, see Supported Regions earlier in this guide.
-
On the Create stack page, keep the default setting for the template URL, and then choose Next.
-
On the Specify stack details page, change the stack name if needed. Review the parameters for the template. Provide values for the parameters that require input. For all other parameters, review the default settings and customize them as necessary. For details on each parameter, see the Parameter reference section of this guide. When you finish reviewing and customizing the parameters, choose Next.
-
On the Configure stack options page, you can specify tags (key-value pairs) for resources in your stack and set advanced options. When you finish, choose Next.
-
On the Review page, review and confirm the template settings. Under Capabilities, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros.
-
Choose Create stack to deploy the stack.
-
Monitor the status of the stack. When the status is CREATE_COMPLETE, the Suricata on Amazon Linux 2 deployment is ready.
-
To view the created resources, see the values displayed in the Outputs tab for the stack.
Test the deployment
Perform the following steps to verify that Suricata is installed and running on the target instances.
-
Make a note of the TargetInstanceASG value shown in the Outputs tab.
-
Using either AWS CLI or the AWS Management Console, identify the IDs of the instances in the Auto Scaling group. For example, you can use the following CLI command to fetch the instance IDs.
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name ${YOUR_ASG_NAME} --region ${DEPLOY_REGION} | grep -i instanceid | awk '{print $2}'
Sample output:
"i-0c28001ae82907b0a", "i-0c425ea76fe462214",
-
Using either AWS CLI or the AWS Management Console, connect to any of the instances in the output of the previous command and verify that Suricata is installed.
aws ssm start-session --target ${INSTANCE_ID} --region ${DEPLOY_REGION} # In the started session sudo su ec2-user # Verify Suricata version suricata build-info | head -1 # Verify Suricata service status systemctl status suricata
Sample output:
% aws ssm start-session --target ${INSTANCE_ID} --region ${DEPLOY_REGION} Starting session with SessionId: xxxx-yyyy-12345678abcd8888a sh-4.2$ sudo su ec2-user [ec2-user@ip-10-0-17-42 bin]$ suricata build-info | head -1 Suricata 6.0.3 [ec2-user@ip-10-0-17-42 bin]$ systemctl status suricata ● suricata.service - Suricata Intrusion Detection Service Loaded: loaded (/usr/lib/systemd/system/suricata.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-07-22 05:17:33 UTC; 24h ago Docs: man:suricata(1) Main PID: 6879 (Suricata-Main) CGroup: /system.slice/suricata.service └─6879 /sbin/suricata -c /etc/suricata/suricata.yaml --pidfile /var/run/suricata.pid -i eth0 --user suricata Jul 22 05:17:33 ip-10-0-17-42.us-west-2.compute.internal systemd[1]: Starting Suricata Intrusion Detection Service... Jul 22 05:17:33 ip-10-0-17-42.us-west-2.compute.internal systemd[1]: Started Suricata Intrusion Detection Service. ...output truncated...
FAQ
Q. I encountered a CREATE_FAILED error when I launched the Quick Start.
A. If AWS CloudFormation fails to create the stack, relaunch the template with Rollback on failure set to Disabled. This setting is under Advanced in the AWS CloudFormation console on the Configure stack options page. With this setting, the stack’s state is retained, and the instance keeps running so that you can troubleshoot the issue. (For Windows, look at the log files in %ProgramFiles%\Amazon\EC2ConfigService
and C:\cfn\log
.)
When you set Rollback on failure to Disabled, you continue to incur AWS charges for this stack. Delete the stack when you finish troubleshooting. |
For more information, see Troubleshooting AWS CloudFormation.
Q. I encountered a size-limitation error when I deployed the AWS CloudFormation templates.
A. Launch the Quick Start templates from the links in this guide or from another S3 bucket. If you deploy the templates from a local copy on your computer or from a location other than an S3 bucket, you might encounter template-size limitations. For more information, see AWS CloudFormation quotas.
Q. I am using the Network Load Balancer as the VPC Traffic Mirroring target, but I don’t see mirrored traffic.
A. By default, each load balancer node distributes traffic across the registered targets in its Availability Zone only. Verify that the EC2 instances running Suricata are instantiated in both the Availability Zones. You can also research how to enable cross-zone load balancing.
Customer responsibility
After you successfully deploy this Quick Start, confirm that your resources and services are updated and configured — including any required patches — to meet your security and other needs. For more information, see the AWS Shared Responsibility Model.
Parameter reference
Unless you are customizing the Quick Start templates for your own deployment projects, keep the default settings for the parameters labeled Quick Start S3 bucket name, Quick Start S3 bucket Region, and Quick Start S3 key prefix. Changing these parameter settings automatically updates code references to point to a new Quick Start location. For more information, see the AWS Quick Start Contributor’s Guide. |
Parameters for deploying into a new VPC
Parameter label (name) | Default value | Description |
---|---|---|
Availability Zones
( |
|
List of Availability Zones to use for the subnets in the VPC. |
VPC CIDR
( |
|
CIDR Block for the VPC. |
Private subnet 1 CIDR
( |
|
CIDR block for private subnet 1, located in Availability Zone 1. |
Private subnet 2 CIDR
( |
|
CIDR block for private subnet 2, located in Availability Zone 2. |
Public subnet 1 CIDR
( |
|
CIDR block for the public DMZ subnet 1, located in Availability Zone 1. |
Public subnet 2 CIDR
( |
|
CIDR block for the public DMZ subnet 2, located in Availability Zone 2. |
Allowed bastion external access CIDR
( |
|
Allowed CIDR block for external SSH access to the bastion hosts. |
VPC tenancy
( |
|
The allowed tenancy of instances launched into the VPC. |
Parameter label (name) | Default value | Description |
---|---|---|
Key pair name
( |
|
Name of an existing public/private key pair, which allows you to securely connect to your instance after it launches. |
Bastion AMI operating system
( |
|
The Linux distribution for the AMI used for the bastion instances. |
Bastion instance type
( |
|
Amazon EC2 instance type for the bastion instances. |
Parameter label (name) | Default value | Description |
---|---|---|
Number of bastion hosts
( |
|
The number of bastion hosts to create. The maximum number is four. |
Bastion hostname
( |
|
The value used for the name tag of the bastion host. |
Bastion tenancy
( |
|
Bastion VPC tenancy (dedicated or default). |
Bastion banner
( |
|
Choose true to display a banner when connecting via SSH to the bastion. |
Banner text
( |
|
Banner text to display upon login. |
TCP forwarding
( |
|
To enable TCP forwarding, choose true. |
X11 forwarding
( |
|
To enable X11 forwarding, choose true. |
Parameter label (name) | Default value | Description |
---|---|---|
Traffic mirror target type
( |
|
Choose NLB to deploy a Network Load Balancer and a target group with Suricata instances. For limited scale deployments, choose ENI and set NumTargetEC2Instances as 1. This deploys Suricata on a single EC2 instance as your Traffic Mirroring target. |
Number of target EC2 instances
( |
|
The number of targets to create. The maximum number is four. |
Target EC2 instance type
( |
|
Amazon EC2 instance type for the target instances associated with NLB. |
Target EC2 instance disk size
( |
|
Target instance disk size in GB. Default is set to 8 GB. |
Parameter label (name) | Default value | Description |
---|---|---|
Quick Start S3 bucket name
( |
|
Name of the S3 bucket for your copy of the Quick Start assets. Keep the default name unless you are customizing the template. Changing the name updates code references to point to a new Quick Start location. This name can include numbers, lowercase letters, uppercase letters, and hyphens, but do not start or end with a hyphen (-). See https://aws-quickstart.github.io/option1.html. |
Quick Start S3 key prefix
( |
|
S3 key prefix that is used to simulate a directory for your copy of the Quick Start assets. Keep the default prefix unless you are customizing the template. Changing this prefix updates code references to point to a new Quick Start location. This prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slashes (/). End with a forward slash. See https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html and https://aws-quickstart.github.io/option1.html. |
Quick Start S3 bucket Region
( |
|
AWS Region where the Quick Start S3 bucket (QSS3BucketName) is hosted. Keep the default Region unless you are customizing the template. Changing this Region updates code references to point to a new Quick Start location. When using your own bucket, specify the Region. See https://aws-quickstart.github.io/option1.html. |
Parameters for deploying into an existing VPC
Parameter label (name) | Default value | Description |
---|---|---|
VPC ID
( |
|
ID of the VPC (for example, vpc-0343606e). |
VPC CIDR block
( |
|
CIDR block for the VPC. |
Subnet 1 ID
( |
|
ID of Subnet 1 to be associated (for example, subnet-11223344, subnet-55667788). |
Subnet 2 ID
( |
|
ID of Subnet 2 to be associated (for example, subnet-11223344, subnet-55667788). |
The number of target instances to create. The maximum number is four.
( |
|
The number of targets to create. The maximum number is four. |
Target EC2 instance type
( |
|
Select EC2 instance type for Suricata target EC2 instance. Default is set to c5n.large. |
Target EC2 instance size in GB
( |
|
Target instance disk size in GB. Default is set to 8 GB. |
Key pair required for accessing target EC2 instance
( |
|
EC2 key pair required for accessing EC2 instance. |
Bastion security group ID
( |
|
ID of bastion security group to allow access to targets. |
Traffic mirror target type
( |
|
Choose NLB to deploy a Network Load Balancer and a target group with Suricata instances. For limited scale deployments, choose ENI and set NumTargetEC2Instances as 1. This deploys Suricata on a single EC2 instance as your Traffic Mirroring target. |
Amazon Linux 2 AMI ID
( |
|
Latest Amazon Linux 2 AMI ID. |
Send us feedback
To post feedback, submit feature ideas, or report bugs, use the Issues section of the GitHub repository for this Quick Start. To submit code, see the Quick Start Contributor’s Guide.
Quick Start reference deployments
See the AWS Quick Start home page.
GitHub repository
Visit our GitHub repository to download the templates and scripts for this Quick Start, to post your comments, and to share your customizations with others.
Notices
This document is provided for informational purposes only. It represents AWS’s current product offerings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS’s products or services, each of which is provided “as is” without warranty of any kind, whether expressed or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.
The software included with this paper is licensed under the Apache License, version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the accompanying "license" file. This code is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied. See the License for specific language governing permissions and limitations.