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.

More Posts

Follow Me:
Twitter

7 comments for “More ASA Objects and Object-groups

  1. April 7, 2010 at 7:38 pm

    Have you seen http://code.google.com/p/capirca/ ?

    Thought of using it or extending it, instead? Are ASAs just that annoying to use? 😉

  2. April 8, 2010 at 12:13 pm

    Hey, Yeled. I’ve looked at Capirca, but I haven’t used it. I’ll put it back on my list of things to review, though. I’m curious what all can be done with it. It should be interesting.

  3. April 9, 2010 at 1:51 am

    just a quick note: Your config uses the new objects, that were introduced in v8.3. So the config won’t work on 8.0/8.1/8.2.

  4. April 9, 2010 at 10:09 am

    Good catch, Karsten. I’ll make appropriate notes for that.

  5. andrew
    March 28, 2014 at 11:25 am

    Your article I think implies objects are great but I am struggling with the down falls of all the nested objects. Any suggestion on locating all the associated objects to move the acls between firewalls?

    Thanks,

    Andrew

  6. TheGlaz
    June 19, 2014 at 2:35 pm

    I have a simple need to remove a host from a network object group on an ASA 5510 via CLI. It is the second of two hosts listed in the group, so it would not leave it empty if it were removed. I keep finding info on a “no host” command, but getting frustrated by the inability to find applicable syntax for it on my model. Is this doable? Not a lot of time to get cozy and deep with Cisco CLI.

  7. TheGlaz
    June 19, 2014 at 3:36 pm

    Well, all I had to do was throw out the question and then I had an epiphany: The first command line is just for context. The second is what I was looking for. (Again, this is how to remove a host from a network object group from the CLI on a Cisco ASA 5510.)

    hostname(config)# object-group network [groupname]
    hostname(config-network)# no network-object host xxx.xxx.xxx.xxx

    Not really sure how all this fits into your earlier discussion, but your discussion was the thing that broke this loose for me.

Leave a Reply

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