本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
自訂 AWS Network Firewall 的 Amazon CloudWatch 提醒
由 Jason Owens 建立 (AWS)
Summary
此模式可協助您自訂 Amazon Web Services (AWS) 網路防火牆產生的 Amazon CloudWatch 警示。您可以使用預先定義的規則,或建立自訂規則來判斷警示的訊息、中繼資料和嚴重性。然後,您可以對這些提醒採取行動,或自動回應其他 Amazon 服務,例如 Amazon EventBridge。
在此模式中,您會產生 Suricata 相容防火牆規則。Suricata
先決條件和限制
先決條件
作用中的 AWS 帳戶。
AWS 命令列界面 (AWSCLI) 已安裝並設定於您的 Linux、macOS 或 Windows 工作站。如需詳細資訊,請參閱安裝或更新最新版本的 AWS CLI。
AWS 已安裝並設定為使用 CloudWatch Logs 的網路防火牆。如需詳細資訊,請參閱從網路防火牆記錄AWS網路流量。
受 Network Firewall 保護之虛擬私有雲端 (EC2) 私有子網路中的 Amazon Elastic Compute Cloud (Amazon VPC) 執行個體。
產品版本
對於 第 1 AWS 版CLI,請使用 1.18.180 或更新版本。對於 第 2 AWS 版CLI,請使用 2.1.2 或更新版本。
來自 Suricata 5.0.2 版的 classification.config 檔案。如需此組態檔案的副本,請參閱其他資訊一節。
架構
目標技術堆疊
Network Firewall
Amazon CloudWatch Logs
目標架構

架構圖顯示下列工作流程:
工具
AWS 服務
Amazon CloudWatch 可協助您AWS即時監控 AWS 資源的指標,以及您在 上執行的應用程式。
Amazon CloudWatch Logs 可協助您集中所有系統、應用程式AWS和服務中的日誌,以便您可以監控日誌並將其安全地封存。
AWS Command Line Interface (AWS CLI) 是一種開放原始碼工具,可協助您透過命令列 shell 中的命令與 AWS服務互動。
AWS Network Firewall 是AWS雲端中虛擬私有雲端 (VPCs) 具狀態、受管、網路防火牆和入侵偵測和預防服務。
其他工具和服務
史詩
任務 | 描述 | 所需的技能 |
---|---|---|
建立規則。 |
| AWS 系統管理員、網路管理員 |
建立規則群組。 | 在 AWS 中CLI,輸入下列命令。這會建立規則群組。
以下為範例輸出。請記下
| AWS 系統管理員 |
任務 | 描述 | 所需的技能 |
---|---|---|
取得防火牆政策ARN的 。 | 在 AWS 中CLI,輸入下列命令。這會傳回防火牆政策的 Amazon Resource Name (ARN)。記錄 ARN 以供稍後在此模式中使用。
以下是此命令ARN傳回的範例。
| AWS 系統管理員 |
更新防火牆政策。 | 在文字編輯器中,複製貼上下列程式碼。
在 AWS 中輸入下列命令CLI。此命令需要更新字符才能新增新規則。字符用於確認自您上次擷取以來,政策尚未變更。
| AWS 系統管理員 |
確認政策更新。 | (選用) 如果您想要確認已新增規則並檢視政策格式,請在 AWS 中輸入下列命令CLI。
以下為範例輸出。
| AWS 系統管理員 |
任務 | 描述 | 所需的技能 |
---|---|---|
產生測試提醒。 |
| AWS 系統管理員 |
驗證是否已記錄提醒。 |
| AWS 系統管理員 |
任務 | 描述 | 所需的技能 |
---|---|---|
更新防火牆規則。 |
| AWS 系統管理員 |
更新規則群組。 | 在 AWS 中CLI,執行下列命令。使用防火牆政策ARN的 。這些命令會取得更新權杖,並使用規則變更來更新規則群組。
以下為範例輸出。
| AWS 系統管理員 |
任務 | 描述 | 所需的技能 |
---|---|---|
產生測試提醒。 |
| AWS 系統管理員 |
驗證警示已變更。 |
| AWS 系統管理員 |
相關資源
參考
從AWS網路防火牆傳送提醒到 Slack 頻道 (AWS 規範性指導)
AWS 使用 Suricata 在 上擴展威脅預防
(AWS 部落格文章) AWS Network Firewall 的部署模型
(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