သဘောတရား
Security in a VPC: security groups and network ACLs
Security groups guard each instance, network ACLs guard each subnet, and Amazon Inspector finds weak spots.
ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။
Works at
- Security group
- Instance level. It is attached to each resource, such as an EC2 instance.
- Network ACL
- Subnet level. It covers every resource in the subnet.
Rules
- Security group
- Allow rules only
- Network ACL
- Allow rules and deny rules
Return traffic
- Security group
- Allowed automatically (stateful)
- Network ACL
- Needs a rule of its own (stateless)
How rules are checked
- Security group
- All rules together
- Network ACL
- In number order. The first match decides.
At the start
- Security group
- A new group allows no inbound traffic and all outbound traffic.
- Network ACL
- The default network ACL allows all traffic. A new custom one denies all traffic.
Typical use
- Security group
- Open only the ports an application needs, such as HTTPS for a web server.
- Network ACL
- Block a range of IP addresses for a whole subnet.
| နှိုင်းယှဉ်ချက် | Security group | Network ACL |
|---|---|---|
| Works at | Instance level. It is attached to each resource, such as an EC2 instance. | Subnet level. It covers every resource in the subnet. |
| Rules | Allow rules only | Allow rules and deny rules |
| Return traffic | Allowed automatically (stateful) | Needs a rule of its own (stateless) |
| How rules are checked | All rules together | In number order. The first match decides. |
| At the start | A new group allows no inbound traffic and all outbound traffic. | The default network ACL allows all traffic. A new custom one denies all traffic. |
| Typical use | Open only the ports an application needs, such as HTTPS for a web server. | Block a range of IP addresses for a whole subnet. |
1 / 3
Works at
- Security group
- Instance level. It is attached to each resource, such as an EC2 instance.
- Network ACL
- Subnet level. It covers every resource in the subnet.
Rules
- Security group
- Allow rules only
- Network ACL
- Allow rules and deny rules
| နှိုင်းယှဉ်ချက် | Security group | Network ACL |
|---|---|---|
| Works at | Instance level. It is attached to each resource, such as an EC2 instance. | Subnet level. It covers every resource in the subnet. |
| Rules | Allow rules only | Allow rules and deny rules |
2 / 3
Return traffic
- Security group
- Allowed automatically (stateful)
- Network ACL
- Needs a rule of its own (stateless)
How rules are checked
- Security group
- All rules together
- Network ACL
- In number order. The first match decides.
| နှိုင်းယှဉ်ချက် | Security group | Network ACL |
|---|---|---|
| Return traffic | Allowed automatically (stateful) | Needs a rule of its own (stateless) |
| How rules are checked | All rules together | In number order. The first match decides. |
3 / 3
At the start
- Security group
- A new group allows no inbound traffic and all outbound traffic.
- Network ACL
- The default network ACL allows all traffic. A new custom one denies all traffic.
Typical use
- Security group
- Open only the ports an application needs, such as HTTPS for a web server.
- Network ACL
- Block a range of IP addresses for a whole subnet.
| နှိုင်းယှဉ်ချက် | Security group | Network ACL |
|---|---|---|
| At the start | A new group allows no inbound traffic and all outbound traffic. | The default network ACL allows all traffic. A new custom one denies all traffic. |
| Typical use | Open only the ports an application needs, such as HTTPS for a web server. | Block a range of IP addresses for a whole subnet. |
- 1Traffic reaches the subnet. Its network ACL checks the rules in number order and allows or denies it.
- 2Allowed traffic reaches the instance’s security group, which passes only traffic that one of its rules allows.
- 3The instance receives the request. Its reply goes back through the security group automatically, but the network ACL must also allow it out.
- 4Amazon Inspector scans the instance for software vulnerabilities and for network paths that expose it by mistake.
အဆင့်ဆင့်
- 1Traffic reaches the subnet. Its network ACL checks the rules in number order and allows or denies it.
- 2Allowed traffic reaches the instance’s security group, which passes only traffic that one of its rules allows.
- 3The instance receives the request. Its reply goes back through the security group automatically, but the network ACL must also allow it out.
- 4Amazon Inspector scans the instance for software vulnerabilities and for network paths that expose it by mistake.
Traffic passes the network ACL at the edge of the subnet, then the security group at the instance.
ဘာလဲ
A VPC has two built-in firewalls. A security group is attached to a resource, such as an Amazon EC2 instance, and allows only the traffic its rules name. A network access control list (network ACL) is attached to a subnet and checks all traffic that enters or leaves that subnet. Used together, they give two layers of defense.
ဘာလဲ
The main difference is memory. A security group is stateful: when a request is allowed in, the reply is allowed out automatically. A network ACL is stateless: it does not remember earlier traffic, so replies need a rule of their own. Security groups can only allow traffic. Network ACLs can also deny it, which makes them the tool for blocking a specific range of IP addresses.
ဘာလဲ
Firewall rules cannot tell you whether the software on an instance is safe. Amazon Inspector fills that gap. It continually scans EC2 instances, container images in Amazon Elastic Container Registry (Amazon ECR) and AWS Lambda functions for known software vulnerabilities. It also reports EC2 instances with ports that can be reached from outside the VPC, which often means a security group or network ACL is too open.
To see what the rules let through, turn on VPC Flow Logs. They record the IP traffic going to and from the network interfaces in a VPC, and whether it was accepted or rejected.
မှတ်ထားရန်
- Security group: instance level, stateful, allow rules only.
- Network ACL: subnet level, stateless, allow and deny rules, checked in number order.
- A new security group allows no inbound traffic until you add a rule.
- Each subnet is linked to one network ACL. The default network ACL allows all traffic.
မှတ်ထားရန်
- Security groups and network ACLs have no extra charge.
- Amazon Inspector reports problems. It does not block traffic.
စာမေးပွဲမှာ
- “Block a range of IP addresses from reaching a whole subnet” points to a network ACL, because security groups have no deny rules.
- “A virtual firewall for an instance that automatically allows return traffic” is a security group.
- “Continually scan EC2 instances for software vulnerabilities and unintended network exposure” points to Amazon Inspector.
ဒါတွေနဲ့ မရောပါနဲ့
AWS WAFA web application firewall: it filters web requests before they reach your application.
Amazon InspectorScans EC2 instances, container images and Lambda functions for known software vulnerabilities and network exposure.
AWS Firewall ManagerSets firewall rules once and applies them across the accounts in your organization, including new ones.