I have multiple EC2 instances in my AWS console which I wanted to make secured by adding firewall rules/policies. I read that AWS provides Network ACLs
and Security Groups
to achieve the same.
From what I read, I got the basic idea about both.
Security Groups are EC2 firewalls(1st level defense), tied to the instances, stateful in nature i.e any changes in the incoming rule impacts the outgoing rule as well. An instance can have multiple SG's.
Network ACL's are subnet firewalls(2nd level defense), tied to the subnet, stateless in nature. A subnet can have only one NACL.
My questions are :
- Why do we need SG's when we have NACL's ?
- Why do we need NACL'S when we have SG's ?
- Should we use SG's and NACLs together to make our AWS application, more secured ?
- When to choose NACLs over SG's or SG's over NACLs ?
I was wondering, given that I have multiple instances, should I add them all to a VPC and create a Network ACL
or should I assign a Security Group
to each of them.
Need suggestions and references with best practices one should follow for similar scenarios.
Thanks a lot!