AWS Classroom notes 29/Oct/2023

Security Groups and Network ACLs

  • When we create a security group and attach it to network interface, the default rules are deny everything
  • In security group we write rules only to allow traffic
  • We have create a simple vpc with one public subnet
  • We have attached a security group with no rules (disable everything)
    Preview
  • Multiple security groups can be applied to network interface
  • Consider using multiple security groups for reusing rules
  • Network ACLs operate around subnets.
    Preview
  • Default NACL will allow everything
  • NACL will have ALLOW and Deny Rules and also priority
    Preview
  • When a new NACL is created everything is denied
  • Each NACL Rule has
    • rule number: Lower the number higher the priority
    • Protocol: TCP/UDP/ICMP
    • Port
    • Source/Destination
    • Allow/Deny
  • Never write consecutive numbers in rules
  • Always have a rule to allow internal traffic Refer Here
  • Security Group and NACL will work together

Scenario

  • We have to create a network with 2 public and 2 private subnets
  • for public subnets we need an NACL
    • which allows all internal comunication
    • 22,80,443 from anywhere
    • ICMP from anywhere
    • rest of stuff denied
  • for private subnets we need an NACL
    • which allows all internal comunication
    • rest of stuff denied
  • Now create an ec2 instance in public subnet with security group to allow
    • ssh
    • http
  • Now create an ec2 instance in private subnet with security group to allow
    • all internal ping
    • all internal communication

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner