A company's security engineer is designing an isolation procedure for Amazon EC2 instances as part of an incident response plan. The security engineer needs to isolate a target instance to block any traffic to and from the target instance, except for traffic from the company's forensics team. Each of the company's EC2 instances has its own dedicated security group. The EC2 instances are deployed in subnets of a VPC. A subnet can contain multiple instances. The security engineer is testing the procedure for EC2 isolation and opens an SSH session to the target instance. The procedure starts to simulate access to the target instance by an attacker. The security engineer removes the existing security group rules and adds security group rules to give the forensics team access to the target instance on port 22. After these changes, the security engineer notices that the SSH connection is still active and usable. When the security engineer runs a ping command to the public IP address of the target instance, the ping command is blocked.
What should the security engineer do to isolate the target instance?
A. Add an inbound rule to the security group to allow traffic from 0.0.0.0/0 for all ports. Add an outbound rule to the security group to allow traffic to 0.0.0.0/0 for all ports. Then immediately delete these rules.
B. Remove the port 22 security group rule. Attach an instance role policy that allows AWS Systems Manager Session Manager connections so that the forensics team can access the target instance.
C. Create a network ACL that is associated with the target instance's subnet. Add a rule at the top of the inbound rule set to deny all traffic from 0.0.0.0/0. Add a rule at the top of the outbound rule set to deny all traffic to 0.0.0.0/0.
D. Create an AWS Systems Manager document that adds a host-level firewall rule to block all inbound traffic and outbound traffic. Run the document on the target instance.
B
一家公司的安全工程師正在為 Amazon EC2 實例設計隔離程序,作為事件響應計劃的一部分。安全工程師需要隔離目標實例,以阻止除來自公司法證團隊(forensics team)的流量之外,與目標實例之間的任何流量。公司每個 EC2 實例都有其自己的專用安全組。EC2 實例部署在 VPC 的子網中。一個子網可以包含多個實例。安全工程師正在測試 EC2 隔離程序,并打開到目標實例的 SSH 會話。程序開始模擬攻擊者對目標實例的訪問。安全工程師刪除現有的安全組規則,并添加安全組規則以允許法證團隊通過端口 22 訪問目標實例。進行這些更改后,安全工程師注意到 SSH 連接仍然處于活動狀態且可用。當安全工程師向目標實例的公共 IP 地址運行 ping 命令時,ping 命令被阻止。安全工程師應該怎么做來隔離目標實例?
安全工程師在設計 EC2 實例隔離程序時,在僅允許法證團隊通過端口 22 訪問目標實例后,現有的 SSH 連接仍然可用,需要找到正確的方法來隔離目標實例。
安全組:是虛擬防火墻,用于控制進出 EC2 實例的流量。安全組規則是有狀態的,即允許返回流量自動,但如果規則被更改,現有的連接可能不會立即受到影響。
網絡 ACL:是無狀態的,作用于子網級別,可以用于更粗粒度的流量控制。
AWS Systems Manager Session Manager:允許在不打開入站端口的情況下安全地管理 EC2 實例。
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
A. 不正確。向安全組添加一條入站規則,允許來自 0.0.0.0/0 的所有端口的流量。向安全組添加一條出站規則,允許到 0.0.0.0/0 的所有端口的流量。然后立即刪除這些規則。該方案只是短暫地允許所有流量,然后刪除規則,并不能有效地隔離目標實例,現有的 SSH 連接可能仍然存在,不符合隔離要求。
B. 正確。刪除端口 22 的安全組規則。附加一個允許 AWS Systems Manager Session Manager 連接的實例角色策略,以便法證團隊可以訪問目標實例。該方案通過刪除端口 22 的安全組規則,阻止了通過該端口的常規訪問。使用 AWS Systems Manager Session Manager 可以在不依賴傳統 SSH 端口的情況下,為法證團隊提供安全的訪問方式,符合隔離目標實例同時允許法證團隊訪問的需求。
C. 不正確。創建一個與目標實例所在子網相關聯的網絡 ACL。在入站規則集的頂部添加一條規則,拒絕來自 0.0.0.0/0 的所有流量。在出站規則集的頂部添加一條規則,拒絕到 0.0.0.0/0 的所有流量。網絡 ACL 作用于子網級別,這樣做會阻止子網內所有實例的流量,而不僅僅是目標實例,可能會影響子網內其他正常實例的通信,不是針對目標實例的有效隔離方法。
D. 不正確。
創建一個 AWS Systems Manager 文檔,添加一個主機級防火墻規則以阻止所有入站和出站流量。在目標實例上運行該文檔。該方案雖然可以阻止所有流量,但使用 AWS Systems Manager 文檔添加主機級防火墻規則相對復雜,且可能不是最直接有效的方式來隔離 EC2 實例,同時可能對實例的運行狀態產生其他不可預見的影響。