Customize Amazon CloudWatch alerts for AWS Network Firewall
Created by Jason Owens (AWS)
Summary
The pattern helps you customize the Amazon CloudWatch alerts that are generated by Amazon Web Services (AWS) Network Firewall. You can use predefined rules or create custom rules that determine the message, metadata, and severity of the alerts. You can then act upon these alerts or automate responses by other Amazon services, such as Amazon EventBridge.
In this pattern, you generate Suricata-compatible firewall rules. Suricata
Prerequisites and limitations
Prerequisites
An active AWS account.
AWS Command Line Interface (AWS CLI) installed and configured on your Linux, macOS, or Windows workstation. For more information, see Installing or updating the latest version of the AWS CLI.
AWS Network Firewall installed and configured to use CloudWatch Logs. For more information, see Logging network traffic from AWS Network Firewall.
An Amazon Elastic Compute Cloud (Amazon EC2) instance in a private subnet of a virtual private cloud (VPC) that is protected by Network Firewall.
Product versions
For version 1 of AWS CLI, use 1.18.180 or later. For version 2 of AWS CLI, use 2.1.2 or later.
The classification.config file from Suricata version 5.0.2. For a copy of this configuration file, see the Additional information section.
Architecture
Target technology stack
Network Firewall
Amazon CloudWatch Logs
Target architecture

The architecture diagram shows the following workflow:
Tools
AWS services
Amazon CloudWatch helps you monitor the metrics of your AWS resources and the applications you run on AWS in real time.
Amazon CloudWatch Logs helps you centralize the logs from all your systems, applications, and AWS services so you can monitor them and archive them securely.
AWS Command Line Interface (AWS CLI) is an open-source tool that helps you interact with AWS services through commands in your command-line shell.
AWS Network Firewall is a stateful, managed, network firewall and intrusion detection and prevention service for virtual private clouds (VPCs) in the AWS Cloud.
Other tools and services
Epics
Task | Description | Skills required |
---|---|---|
Create rules. |
| AWS systems administrator, Network administrator |
Create the rule group. | In the AWS CLI, enter the following command. This creates the rule group.
The following is an example output. Make note of the
| AWS systems administrator |
Task | Description | Skills required |
---|---|---|
Get the ARN of the firewall policy. | In the AWS CLI, enter the following command. This returns the Amazon Resource Name (ARN) of the firewall policy. Record the ARN for use later in this pattern.
The following is an example ARN that is returned by this command.
| AWS systems administrator |
Update the firewall policy. | In a text editor, copy the paste the following code. Replace
Enter the following command in the AWS CLI. This command requires an update token to add the new rules. The token is used to confirm that the policy hasn't changed since you last retrieved it.
| AWS systems administrator |
Confirm the policy updates. | (Optional) If you would like to confirm the rules were added and view the policy format, enter the following command in the AWS CLI.
The following is an example output.
| AWS systems administrator |
Task | Description | Skills required |
---|---|---|
Generate alerts for testing. |
| AWS systems administrator |
Validate that the alerts are logged. |
| AWS systems administrator |
Task | Description | Skills required |
---|---|---|
Update the firewall rules. |
| AWS systems administrator |
Update the rule group. | In the AWS CLI, run the following commands. Use the ARN of your firewall policy. These commands get an update token and update the rule group with the rule changes.
The following is an example output.
| AWS systems administrator |
Task | Description | Skills required |
---|---|---|
Generate an alert for testing. |
| AWS systems administrator |
Validate the alert changed. |
| AWS systems administrator |
Related resources
References
Send alerts from AWS Network Firewall to a Slack channel (AWS Prescriptive Guidance)
Scaling threat prevention on AWS with Suricata
(AWS blog post) Deployment models for AWS Network Firewall
(AWS blog post) Suricata meta keyworks
(Suricata documentation)
Tutorials and videos
Additional information
The following is the classification configuration file from Suricata 5.0.2. These classifications are used when creating the firewall rules.
# config classification:shortname,short description,priority config classification: not-suspicious,Not Suspicious Traffic,3 config classification: unknown,Unknown Traffic,3 config classification: bad-unknown,Potentially Bad Traffic, 2 config classification: attempted-recon,Attempted Information Leak,2 config classification: successful-recon-limited,Information Leak,2 config classification: successful-recon-largescale,Large Scale Information Leak,2 config classification: attempted-dos,Attempted Denial of Service,2 config classification: successful-dos,Denial of Service,2 config classification: attempted-user,Attempted User Privilege Gain,1 config classification: unsuccessful-user,Unsuccessful User Privilege Gain,1 config classification: successful-user,Successful User Privilege Gain,1 config classification: attempted-admin,Attempted Administrator Privilege Gain,1 config classification: successful-admin,Successful Administrator Privilege Gain,1 # NEW CLASSIFICATIONS config classification: rpc-portmap-decode,Decode of an RPC Query,2 config classification: shellcode-detect,Executable code was detected,1 config classification: string-detect,A suspicious string was detected,3 config classification: suspicious-filename-detect,A suspicious filename was detected,2 config classification: suspicious-login,An attempted login using a suspicious username was detected,2 config classification: system-call-detect,A system call was detected,2 config classification: tcp-connection,A TCP connection was detected,4 config classification: trojan-activity,A Network Trojan was detected, 1 config classification: unusual-client-port-connection,A client was using an unusual port,2 config classification: network-scan,Detection of a Network Scan,3 config classification: denial-of-service,Detection of a Denial of Service Attack,2 config classification: non-standard-protocol,Detection of a non-standard protocol or event,2 config classification: protocol-command-decode,Generic Protocol Command Decode,3 config classification: web-application-activity,access to a potentially vulnerable web application,2 config classification: web-application-attack,Web Application Attack,1 config classification: misc-activity,Misc activity,3 config classification: misc-attack,Misc Attack,2 config classification: icmp-event,Generic ICMP event,3 config classification: inappropriate-content,Inappropriate Content was Detected,1 config classification: policy-violation,Potential Corporate Privacy Violation,1 config classification: default-login-attempt,Attempt to login by a default username and password,2 # Update config classification: targeted-activity,Targeted Malicious Activity was Detected,1 config classification: exploit-kit,Exploit Kit Activity Detected,1 config classification: external-ip-check,Device Retrieving External IP Address Detected,2 config classification: domain-c2,Domain Observed Used for C2 Detected,1 config classification: pup-activity,Possibly Unwanted Program Detected,2 config classification: credential-theft,Successful Credential Theft Detected,1 config classification: social-engineering,Possible Social Engineering Attempted,2 config classification: coin-mining,Crypto Currency Mining Activity Detected,2 config classification: command-and-control,Malware Command and Control Activity Detected,1