本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
为 Network Fire AWS wall 自定义亚马逊 CloudWatch 提醒
由杰森·欧文斯创作 () AWS
摘要
该模式可帮助您自定义 Amazon Web Services (AWS) Network Firewall 生成的亚马逊 CloudWatch 警报。您可以使用预定义的规则或创建自定义规则来确定警报的消息、元数据和严重性。然后,您可以根据这些提醒采取行动,或者由其他亚马逊服务(例如亚马逊)自动回复 EventBridge。
在此模式中,您将生成与 Suricata 兼容的防火墙规则。Suricata
先决条件和限制
先决条件
一个活动的 AWS 账户。
AWS在 Linux、macOS 或 Windows 工作站上安装和配置命令行界面 (AWSCLI)。有关更多信息,请参阅安装或更新最新版本的AWSCLI。
AWSNetwork Firewall 已安装并配置为使用 CloudWatch 日志。有关更多信息,请参阅记录来自 Network Firewall 的AWS网络流量。
位于受网络防火墙保护的虚拟私有云 (EC2) 的私有子网中的亚马逊弹性计算云 (AmazonVPC) 实例。
产品版本
对于的版本 1 AWSCLI,请使用 1.18.180 或更高版本。对于的版本 2 AWSCLI,请使用 2.1.2 或更高版本。
Suricata 版本 5.0.2 中的 classification.config 文件。有关此配置文件的副本,请参阅其他信息部分。
架构
目标技术堆栈
Network Firewall
Amazon CloudWatch 日志
目标架构
架构图显示了以下工作流程:
工具
AWS 服务
Amazon CloudWatch 可帮助您实时监控您的AWS资源和运行的应用程序AWS的指标。
Amazon CloudWatch Lo gs 可帮助您集中管理所有系统、应用程序和AWS服务的日志,以便您可以对其进行监控并安全地存档。
AWSCommand Line Interface (AWSCLI) 是一个开源工具,可帮助您通过命令行外壳中的命令与AWS服务进行交互。
AWSNetwork Fire wall 是一项针对云AWS端虚拟私有云 (VPCs) 的状态托管网络防火墙以及入侵检测和防御服务。
其他工具和服务
操作说明
任务 | 描述 | 所需技能 |
---|---|---|
创建规则。 |
| AWS系统管理员、网络管理员 |
创建规则组。 | 在中 AWSCLI,输入以下命令。这将创建规则组。
下面是一个示例输出。记下
| AWS系统管理员 |
任务 | 描述 | 所需技能 |
---|---|---|
获取防火墙策略。ARN | 在中 AWSCLI,输入以下命令。这将返回防火墙策略的 Amazon 资源名称 (ARN)。记录下来ARN,以便稍后在此模式中使用。
以下是此命令返回ARN的示例。
| AWS系统管理员 |
更新防火墙策略。 | 在文本编辑器中,复制并粘贴以下代码。将
在中输入以下命令AWSCLI。此命令需要更新令牌才能添加新规则。该令牌用于确认自您上次检索策略以来该策略未发生更改。
| AWS系统管理员 |
确认策略更新。 | (可选)如果您想确认已添加规则并查看策略格式,请在中输入以下命令AWSCLI。
下面是一个示例输出。
| AWS系统管理员 |
任务 | 描述 | 所需技能 |
---|---|---|
生成用于测试的警报。 |
| AWS系统管理员 |
验证警报是否已记录。 |
| AWS系统管理员 |
任务 | 描述 | 所需技能 |
---|---|---|
更新防火墙规则。 |
| AWS系统管理员 |
更新规则组。 | 在中 AWSCLI,运行以下命令。使用您的防火墙策略。ARN这些命令获取更新令牌,并使用规则更改更新规则组。
下面是一个示例输出。
| AWS系统管理员 |
任务 | 描述 | 所需技能 |
---|---|---|
生成用于测试的警报。 |
| AWS系统管理员 |
验证警报是否已更改。 |
| AWS系统管理员 |
相关资源
参考
从 AWS Network Firewall 向 Slack 频道发送警报(AWS规范性指导)
AWS使用 Suricata 扩展威胁防御能力
(AWS博客文章) Network Fire AWS wall 的部署模型
(AWS博客文章) Suricata 元密钥
(Suricata 文档)
教程和视频
其他信息
以下是 Suricata 5.0.2 中的分类配置文件。创建防火墙规则时将使用这些分类。
# 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