Deploying NACLs using Ansible
AWS Network Access Control Lists (NACLs) are stateless ACLs that regulate IP traffic at the subnet level, allowing or denying access based on Layer 3 and Layer 4 IP details. Applied to subnets, NACLs protect all resources within the subnet by controlling both ingress (incoming) and egress (outgoing) traffic. Rules in an NACL are processed by rule number, with the first matching rule determining the traffic’s fate. Complementing NACLs, but not covered here, AWS security groups provide an additional layer of protection at the instance level, using stateful filtering to control inbound and outbound traffic per resource, which adds granularity to security within the VPC.
Let’s reproduce the same workflow, from the data to the deployment:
- We start adding the NACLs’ data, with a data structure that represents a traditional ACL, also matching the expected data format by AWS. You can define ingress and egress rules according...