ASA Access Lists with Terraform

As part of the ASA API Terraform Project, in this post I will be demonstrating the creation of ACLs using objects, object groups and standard IP addressing.

Lab

I’m going to set up a simple ASA lab using the previous post from the project.

Creating Objects with Terraform

I have created a network object and an object group that references the object. The object is just for a single host that will act as my server in the DMZ.

The next example is to create a service object and service object group for HTTP/S ports.

Creating ACLs with Terraform

Now the objects and groups have been created, the ACLs can be created. When creating the ACL, the ASA terraform provider will also create the binding of the ACL name to the interface.

The ACL will permit all traffic to the object-group ALL_DMZ_SERVERS using the service group WEB_PORTS.

The ASA config will look like below…

Testing with Packet Tracer

The ACL on the ASA is working as confirmed with the packet-tracer command. I have omitted some of the output, as it’s not really necessary.

INSIDE to DMZ ACL

I’ll quickly create one more ACL that will permit traffic from the INSIDE to the DMZ segment. For this, I will use object-groups only, but with hard set ports and addresses in them. The ACL itself will also contain a hard set ACL.

This ACL permits port 22 from the INSIDE host 192.168.1.5 to the DMZ group ALL_DMZ_SERVERS, which currently contains a single host of 192.168.2.5.
Terraform created the access-group and the object group for SSH_PORT

Leave a Comment

Your email address will not be published. Required fields are marked *