简体   繁体   English

AWS 云中的安全组

[英]Security Group in AWS Cloud

As we know security groups are statefull in AWS Cloud.正如我们所知,安全组在 AWS 云中是有状态的。 while launching ec2 instances when we allow inbound rules for specific port it must allow that specific traffic at outbound instead it will allowing all tarffic why is this so?当我们允许特定端口的入站规则时启动 ec2 实例时,它必须允许出站的特定流量,而不是允许所有 tarffic 为什么会这样?

launched ec2 instance in inbound I allowed ssh at port 22 and http at port 80 https at port 443 in outbound it automatically allowed all traffic instead of these three protocol在入站中启动 ec2 实例我允许 ssh 在端口 22 和 http 在端口 80 https 在端口 443 在出站它自动允许所有流量而不是这三个协议

A security group controls the traffic that is allowed to reach and leave your EC2 instance.安全组控制允许到达和离开您的 EC2 实例的流量。 Did you use default SG?您是否使用默认 SG? By default, SG Allows all outbound IPv4 and IPv6 traffic.默认情况下,SG 允许所有出站 IPv4 和 IPv6 流量。

So if you need, you could manually deny all outbound traffic and allow only 80 443 and 22 ports.因此,如果需要,您可以手动拒绝所有出站流量并仅允许 80 443 和 22 端口。

在此处输入图像描述

A few points:几点:

  • As you said, security groups are stateful.正如您所说,安全组是有状态的。 If a SG rule allows a request to reach an instance, then the response can go out.如果 SG 规则允许请求到达实例,则响应可以 go 出。
  • Outbound rules are for traffic originating from your instance.出站规则适用于源自您的实例的流量。 It controls what IPs the instances within the SG can talk to.它控制 SG 中的实例可以与之通信的 IP。 They don't apply to responses for incoming requests.它们不适用于传入请求的响应。
  • The predefined rules in the web console are just there for your convenience, using the commonly used ports for HTTP/HTTPS/SSH and so on. web 控制台中的预定义规则只是为了您的方便,使用 HTTP/HTTPS/SSH 等常用端口。 The actual rules that apply are for TCP traffic on these specific ports.适用的实际规则适用于这些特定端口上的 TCP 流量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将包含自身和安全组 ID 的 aws_security_group_rule 添加到安全组 - Add an aws_security_group_rule that contains self and a security group id to a security group terraform aws:创建安全组时的协议不正确 - terraform aws: Incorrect protocol in creating a security group 在 AWS 安全组中创建多个规则 - Create multiple rules in AWS security Group 为什么 AWS 中的 NLB 不需要安全组? - Why is it that an NLB in AWS does not require a Security Group? AWS Workspace 安全组出口要求 - AWS Workspace Security Group Egress Requirments aws_security_group_rule 属性 cidr_blocks 和 source_security_group_id 的冲突问题 - conflicting issue for aws_security_group_rule attributes cidr_blocks and source_security_group_id 从列表中删除 AWS EC2 安全组 - Delete AWS EC2 security group from a list 使用 aws-sdk 的云监视日志组的过滤模式 - Filter pattern for cloud watch log group using aws-sdk AWS CloudFormation:无法创建 RDS 数据库,因为数据库安全组无法引用 web 服务器的安全组 - AWS CloudFormation: unable to create RDS database because database security group cannot reference the web server's security group AWS 安全组 - AWS security groups
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM