Open In App

AWS NACL (Network Access Control List)

Amazon web services provide a wide list of services and makes sure that these services do not have to compromise with security. AWS takes security with highest priority and provides a comprehensive set of tools and features to help the users protect their data and applications in the cloud.

Section 1: What Are Network Access Control Lists (NACLs)?

One such feature of security provided by AWS(Amazon Web Services) is the Network Access Control List(NACL). This NACL is defined by default for every Virtual Private Network(VPC). However, you can create custom NACL according to your requirements. These NACL define inbound and outbound rule for subnets present in VPC. These have almost the same function as Security Groups the only difference is NACL works in subnet levels and Security groups are defined for instances and other resources.



Section 2: Why Use NACLs?

Example 1:

Let’s take a scenario where you have two VPC(VPC One and VPC Two) and a VPC peering is established between both the VPCs. Now when a request comes from VPC two for particular subnet of VPC one, how will the VPC one distinguish it? For this we use NACL. In NACL we define which traffic is destined to enter and leave subnet One.



Example2:

Suppose you have a VPC and you have two subnets subnet1 and subnet two. Now you want to give someone permission to work only with subnet two resources. This can be done using NACL. Only permitted user will be given access to the subnet after verifying their by IP address. Let’s understand with a diagram:

Section 3: Key Concepts and Terminologies

Section 4: Creating and Managing NACLs

Step 1: In AWS first create a VPC

Step 2: Create subnet and Associate it with a route table

Step 3: Go to NACL, you will find a default NACL

So create one:

Step 4: Click On the NACL created go to subnet association there click on Edit subnet association

Step 5: Click the desired subnet and Save changes

Go to inbound rules of the NACL. Click on edit inbound rule

Step 6: In edit rule give rule number-90 for SSH type traffic and give your pc’s IP address and “Deny” the permission.Save Changes

Section 5: Testing NACL

Now create a instance under the same subnet with default security group(in order to understand how NACL works however the best practice is to use own Security Group)

Now try to ssh into the server through your cmd. You won’t be able to SSH into the server due to restriction by NACL

FAQs On NACL

1. How Does An NACL Differ From A Security Group?

NACLs operate at the subnet level and are stateless, whereas Security Groups operate at the instance level and are stateful.

2. What are the default rules in an NACL?

By default, AWS NACL has rule number 100 to allow all inbound and outbound traffic.

3. Can NACLs Be Associated With Multiple Subnets?

Yes, you can associate an NACL with one or more subnets within a VPC. This allows you to apply the same set of rules to multiple subnets.

Article Tags :