amazon-web-services - 为什么我不能使用 VPC NACL 来加强安全性?
问题描述
我在 AWS 研究中遇到了以下场景问题:
您有一个在由应用程序负载均衡器 (ALB)、应用程序服务器和数据库组成的 VPC 中运行的企业对企业 Web 应用程序。您的 Web 应用程序应该只接受来自预定义客户 IP 地址的流量。哪两个选项满足此安全要求?选择 2 个答案
选项:
A. Configure web server VPC security groups to allow traffic from your customers’ IPs
B. Configure your web servers to filter traffic based on the ALB’s "X-forwarded-for" header
C. Configure your web servers to filter traffic based on the ALB’s "Proxy Protocol" header
D. Configure ELB security groups to allow traffic from your customers’ IPs and deny all outbound traffic
E. Configure a VPC NACL to allow web traffic from your customers’ IPs and deny all outbound traffic
正确答案
B. Configure your web servers to filter traffic based on the ALB’s "X-forwarded-for" header
D. Configure ELB security groups to allow traffic from your customers’ IPs and deny all outbound traffic
我的问题是为什么 E 在这里不是一个公认的答案?
非常感谢,感谢任何启发。
解决方案
我相信 E 是无效的,因为答案的第二部分“并拒绝所有出站流量”。NACL 本质上是无状态的,这意味着在 NACL 中打开的入站流量默认情况下不允许请求的出站流量。因此,如果您的 Web 服务器在端口 80 上收到请求,它需要使用临时端口(范围在 1024-65535 范围内)进行响应。因此,您的 NACL 必须具有出站 ALLOW 规则才能在这些端口上发送响应。
这与本质上是有状态的安全组不同,并且不需要为临时端口明确允许。
如需进一步阅读,请在以下文档中搜索 stateless 以获得更好的理解,如果我无法在这里解释:
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html
推荐阅读
- javascript - 不明白为什么不能用正则括号代替方括号
- java - 为什么我的索引对于我列表中的值返回为 -1?
- ios - SwiftUI/Combine 无法用 ObservedObject 初始化类
- javascript - 如何使用 JQuery UI 在提交表单时显示确认对话框
- reactjs - 我可以从远程服务器或通过从互联网加载的脚本标签提供 js 包(webpack)吗?
- mule-studio - MUnit Coverage 未显示异常块覆盖率
- android - Dexguarded Android 库缺少 SO 文件
- c# - c#逆变和协变:不能从实现转换为接口
- python-3.x - 创建猜数字游戏
- python - python 解析日志文件:在不同的行中找到两个特定的字符串并连接到一个并写入另一个文件!避免空行