More ASA Objects and Object-groups

A few years ago, I developed a Perl-based application that take a template file and pukes out standardized access rules for new hosts as they’re added to the network.  This works great for making sure that each host is able to be managed properly.  This solution, however, is not very flexible.  If I need to remove a host’s access, I may have to take out 20 rules individually.  That’s not really cool, so, at the suggestion of a coworker, I’m working on a solution that uses objects, object-groups, and nested object-groups.  This should minimize the configured rules and allow new host rules to be added and removed by simply adding hosts to object-groups.

Example time.  Let’s say you have a bunch of RFC1918 addresses behind your firewall that all need HTTP access to one network on the InterTubes.  First thing to do is to create the objects that will be involved; in this case, that’s all the networks and/or ranges.  To be more specific, 192.0.2.0/24 is the public IP to which the hosts need access.   The internal hosts are 192.168.0.0/24 and the IP range 10.0.0.1-25.  Yes, I know the names are terrible.

Now, we can use some Snort-like configuration to create object-groups that include the objects we just created.  In this case, we’re creating an InterWebs-based object-group and another for local addresses.

Now we can use these object-groups to create ACLs.   You’ve done this before, right?

To be sure it worked as expected, let’s take a look at the ACLs.  The format sucks because the lines are so long; sorry about that.

Cool.  Everything looks great, and everyone should have the access they need.  If a new host with the IP of 172.16.0.28 comes online inside the network, you add a new nested object-group that includes that host.  Access is automagically updated, so there’s no need for more ACL lines.  Another method is to add the new host directly to the LOCAL-NETS object-group, but that’s going to limit the ways to address that box and related hosts in an ACL.  I suggest you just add the new object to the object-group.

As a bonus, you can also nest object-groups into each other.  For example, we can create an object-group that includes our the LOCAL-NETS and REMOTE-NETS object-groups.

I don’t know where you’d ever use that specific object-group, but you could use this technique in other ways.  I’m looking to create object-groups for each interface of the firewall and creating a super-object (my term) to allow the standard access stuff.  You could do the same for office networks; each office has it’s own object-group for access that is also nested in an object that provides basic access to the TubeWebs or something.  Use your imagination.  🙂

Send any questions my way.

This article is based on an ASA 5505 running 8.3.1.  Most of the config above should be portable to any 8.x except for declaring the objects. In other versions of 8.x, you may have to add host directly to the object-group.  Running on 7.x and below may be a different story.

Other reading:  http://aconaway.com/2009/10/01/object-groups-in-the-asafwsmpix/

Director’s Commentary:
[audio:http://aconaway.com/wp-content/uploads/2010/04/More-ASA-Objects-and-Object-groups.mp3|titles=More ASA Objects and Object-groups]

Aaron Conaway

I shake my head around sometimes and see what falls out. That's what lands on these pages. If you have any questions, the best way to contact me is through Twitter at @aconaway.

More Posts

Follow Me:
Twitter

7 comments for “More ASA Objects and Object-groups

Leave a Reply

Your email address will not be published.