Amazon VPC provides following features to increase and monitor the security for your VPC:
-
Security groups - Act as a firewall for associated Amazon EC2 instances, controlling both inbound and outbound traffic at the instance level.
-
Network access control lists (ACLs) - Act as a firewall for associated subnets, controlling both inbound and outbound traffic at the subnet level.
-
Flow logs - Capture information about the IP traffic going to and from network interfaces in your VPC.
Security Groups vs. Network Access Control Lists (ACLs)
-
Layer of defense
-
Security group operates at the instance level (first layer of defense)
-
Network ACLs operates at the subnet level (second layer of defense)
-
-
Allow and Deny
-
Security group supports allow rules only.
-
By default everything is denied.
-
-
Network ACLs supports allow and deny rules.
-
E.g. Can deny a specific IP.
-
-
-
Stateful vs. Stateless
-
Security group is stateful: Return traffic is automatically allowed, regardless of any rules
-
When you add a rule, it apples for not in and out traffic.
-
-
Network ACLs is stateless: Return traffic must be explicitly allowed by rules
-
-
Rule evaluation
-
Security group evaluate all rules before deciding whether to allow traffic.
-
Network ACLs process rules in number order when deciding whether to allow traffic.
-
-
Scope
-
Security group applies to an instance only if someone specifies the security group when launching the instance, or associates the security group with the instance later on
-
Network ACLs automatically applies to all instances in the subnets it's associated with (backup layer of defense, so you don't have to rely on someone specifying the security group)
-
Important Notes (Exam Tips)
-
Default Network ACL with VPC allows all inbound and outbound traffic. With custom Network ACL all inbound and outbound traffic is denied by default.
-
One subnet can only be associated with one Network ACL.
-
We can block IP addresses explicitly (Deny) with Network ACLs but not with Security groups. With Security groups everything is denied by default and you need to explicitly allow everything.
References (Deprecated):
- heartin's blog
- Log in or register to post comments
Recent comments