2 Cisco ASA 5510's, an Exchange Edge Server, a DMZ, and a minefield.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grojom
    New Member
    • May 2010
    • 15

    #1

    2 Cisco ASA 5510's, an Exchange Edge Server, a DMZ, and a minefield.


    Disclaimer
    Before you ask why I don't just put everything on the 192.168.1.0/24 network, let me just say I do this on another person's will.

    Info:
    For purposes of this question I will refer to "Internal Network" as the 192.168.0.0/24 located on the inside interface of the internal ASA
    Domain names and public Ip's changed for protection of the client.
    Domain names changed to domain, public IP's represented by xxx.xxx.xxx.###


    Objective:
    To Setup Edge/Web Services that can communicate through 2 ASA 5510's to the Internal network. Allowing me to use the Edge server on the perimeter
    To be able to hit the internet from all network points.
    To be able to ping internally from any location to any location but not outside_in
    To be able to maintain remote access to the internal servers
    To not be laughed at for not putting the servers on the inside of the external ASA (hehe)

    From the DMZ to the "Internal Network" (the main challenge, not working)
    DNS
    ICMP
    tcp/50389
    upd/50636
    SMTP (to the internal exchange server)

    From the Internal Network to the DMZ (everything currently is working, but as other changes might cause this to close I will need the following)
    ICMP
    tcp/50389
    udp/50636
    HTTP
    HTTPS
    SMTP (from the internal exchange server)

    All networks should have outbound access "outside" to the world

    From the Outside in to the "internal network"
    3389 (Working but if you have me change something elsewhere to break it, please fix it :))

    From the outside to the DMZ
    SMTP
    http
    https
    (perhaps more later but for now this is it)

    Current Status:
    Currently I can ping into the DMZ from the Internal Network
    From the DMZ I can ping to 192.168.1.2
    I can see http from the internal network on the DMZ
    All networks currently can browse the internet.
    RDP all the way in to the Internal network, works.

    I would like to point out that I will make it a point to post working configs once this is finished.
    I also appreciate any help offered.


    The External ASA
    Code:
    ASA Version 8.0(2) 
    !
    hostname external
    domain-name domain.local
    enable password sg5gh5uh45g6 encrypted
    names
    dns-guard
    !
    interface Ethernet0/0
     nameif outside
     security-level 0
     ip address xxx.xxx.xxx.82 255.255.255.248 
    !
    interface Ethernet0/1
     nameif inside
     security-level 49
     ip address 192.168.1.1 255.255.255.0 
    !
    interface Ethernet0/2
     shutdown
     no nameif
     no security-level
     no ip address
    !
    interface Ethernet0/3
     nameif dmz
     security-level 40
     ip address 10.10.10.1 255.255.255.0 
    !
    interface Management0/0
     shutdown
     no nameif
     no security-level
     no ip address
     management-only
    !
    passwd iG0FMG.8O3nPFSqf encrypted
    boot system disk0:/asa802-k8.bin
    boot config disk0:/flash
    ftp mode passive
    clock timezone CST -5
    dns domain-lookup outside
    dns domain-lookup inside
    dns domain-lookup dmz
    dns server-group Internal
     name-server 192.168.0.11
     name-server 192.168.0.13
     domain-name domain.local
    dns-group Internal
    same-security-traffic permit inter-interface
    object-group protocol TCPUDP
     protocol-object udp
     protocol-object tcp
    object-group service rdp tcp
     port-object eq 3389
    object-group service DM_INLINE_TCP_1 tcp
     port-object eq 50000
     port-object eq 50001
    object-group service DM_INLINE_TCP_2 tcp
     port-object eq 50000
     port-object eq 50001
    access-list dmz-in extended permit tcp any host 10.10.10.10 eq smtp 
    access-list dmz-in extended permit tcp any host 10.10.10.10 eq www 
    access-list dmz-in extended permit tcp any host 10.10.10.10 eq https 
    access-list dmz-in extended permit icmp any any 
    access-list dmz-in extended permit ip 10.10.10.0 255.255.255.0 any 
    access-list dmz_access_in extended permit ip 10.10.10.0 255.255.255.0 any 
    access-list outside_access_in extended permit tcp any any eq 3389 
    access-list inside_access_in extended permit icmp any any 
    access-list inside_access_in extended permit ip any any 
    pager lines 24
    logging enable
    logging asdm informational
    mtu outside 1500
    mtu inside 1500
    mtu dmz 1500
    no failover
    icmp unreachable rate-limit 1 burst-size 1
    icmp permit any inside
    icmp permit any dmz
    asdm image disk0:/asdm-602.bin
    no asdm history enable
    arp timeout 14400
    global (outside) 1 interface
    global (inside) 2 interface
    global (dmz) 3 interface
    nat (inside) 1 0.0.0.0 0.0.0.0
    nat (dmz) 1 0.0.0.0 0.0.0.0
    static (dmz,outside) tcp interface smtp 10.10.10.10 smtp netmask 255.255.255.255 
    static (inside,outside) tcp interface 3389 192.168.1.2 3389 netmask 255.255.255.255 
    static (inside,dmz) 192.168.1.0 192.168.1.0 netmask 255.255.255.0 
    access-group outside_access_in in interface outside
    access-group inside_access_in in interface inside
    access-group dmz-in in interface dmz
    route outside 0.0.0.0 0.0.0.0 74.117.105.81 1
    timeout xlate 3:00:00
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout uauth 0:05:00 absolute
    dynamic-access-policy-record DfltAccessPolicy
    aaa authorization command LOCAL 
    aaa authorization exec authentication-server
    http server enable
    http 192.168.0.0 255.255.255.0 inside
    http 10.10.10.0 255.255.255.0 dmz
    http 192.168.1.0 255.255.255.0 inside
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart
    no crypto isakmp nat-traversal
    telnet xxx.xxx.xxx.0 255.255.255.0 outside
    telnet 0.0.0.0 0.0.0.0 inside
    telnet timeout 5
    ssh 0.0.0.0 0.0.0.0 outside
    ssh 192.168.1.0 255.255.255.0 inside
    ssh timeout 5
    console timeout 0
    threat-detection basic-threat
    threat-detection statistics access-list
    !
    class-map inspection_default
     match default-inspection-traffic
    !
    !
    policy-map type inspect dns migrated_dns_map_1
     parameters
      message-length maximum 512
    policy-map global_policy
     class inspection_default
      inspect dns migrated_dns_map_1 
      inspect ftp 
      inspect h323 h225 
      inspect h323 ras 
      inspect rsh 
      inspect rtsp 
      inspect esmtp 
      inspect sqlnet 
      inspect skinny  
      inspect sunrpc 
      inspect xdmcp 
      inspect sip  
      inspect netbios 
      inspect tftp 
      inspect http 
    !
    service-policy global_policy global
    ntp server 192.43.244.18 source outside prefer
    username admin password sfdgfgs45g5gh45h== nt-encrypted privilege 15
    prompt hostname context

    The Internal ASA
    Code:
    ASA Version 8.0(2) 
    !
    hostname internal
    domain-name domain.local
    enable password f443fg5sg45g encrypted
    names
    name 10.10.10.10 nlf-srv-004 description Front End Server
    name 192.168.0.11 nlf-srv-001 description DC1
    name 192.168.0.12 nlf-srv-002 description Exchange
    dns-guard
    !
    interface Ethernet0/0
     nameif outside
     security-level 50
     ip address 192.168.1.2 255.255.255.0 
    !
    interface Ethernet0/1
     nameif inside
     security-level 100
     ip address 192.168.0.1 255.255.255.0 
    !
    interface Ethernet0/2
     shutdown
     no nameif
     no security-level
     no ip address
    !
    interface Ethernet0/3
     shutdown
     no nameif
     no security-level
     no ip address
    !
    interface Management0/0
     shutdown
     no nameif
     no security-level
     no ip address
    !
    passwd sg45g5g45g45 encrypted
    boot system disk0:/asa802-k8.bin
    ftp mode passive
    clock timezone CST -6
    clock summer-time CDT recurring
    dns domain-lookup outside
    dns domain-lookup inside
    dns server-group DefaultDNS
     domain-name domain.local
    dns server-group Internal
     name-server nlf-srv-001
     name-server 192.168.0.13
     domain-name domain.local
    dns-group Internal
    same-security-traffic permit inter-interface
    object-group protocol TCPUDP
     protocol-object udp
     protocol-object tcp
    access-list out-in extended permit icmp any any 
    access-list out-in extended permit tcp any any eq smtp 
    access-list out-in extended permit tcp any any eq 3389 
    access-list out-in extended permit ip any any 
    access-list inside extended permit tcp any host nlf-srv-002 eq smtp 
    access-list inside extended permit ip xxx.xxx.xxx.80 255.255.255.248 192.168.0.0 255.255.255.0 
    access-list inside extended permit ip any any 
    access-list inside extended permit icmp any any 
    pager lines 24
    logging enable
    logging console debugging
    logging asdm informational
    mtu outside 1500
    mtu inside 1500
    no failover
    icmp unreachable rate-limit 1 burst-size 1
    icmp permit any outside
    icmp permit any inside
    asdm image disk0:/asdm-602.bin
    no asdm history enable
    arp timeout 14400
    global (outside) 1 interface
    global (inside) 2 interface
    nat (inside) 1 0.0.0.0 0.0.0.0
    static (inside,outside) tcp interface 3389 nlf-srv-001 3389 netmask 255.255.255.255 
    access-group out-in in interface outside
    access-group inside in interface inside
    route outside 0.0.0.0 0.0.0.0 192.168.1.1 1
    timeout xlate 3:00:00
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout uauth 0:05:00 absolute
    dynamic-access-policy-record DfltAccessPolicy
    http server enable
    http 192.168.0.0 255.255.255.0 inside
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart
    no crypto isakmp nat-traversal
    telnet 0.0.0.0 0.0.0.0 outside
    telnet 192.168.0.0 255.255.255.0 inside
    telnet timeout 5
    ssh 0.0.0.0 0.0.0.0 outside
    ssh 192.168.0.0 255.255.255.0 inside
    ssh timeout 5
    console timeout 0
    management-access inside
    dhcpd address 192.168.0.50-192.168.0.150 inside
    dhcpd dns nlf-srv-001 192.168.0.13 interface inside
    dhcpd enable inside
    !
    threat-detection basic-threat
    threat-detection statistics access-list
    !
    class-map inspection_default
     match default-inspection-traffic
    !
    !
    policy-map type inspect dns migrated_dns_map_1
     parameters
      message-length maximum 512
    policy-map global_policy
     class inspection_default
      inspect dns migrated_dns_map_1 
      inspect ftp 
      inspect h323 h225 
      inspect h323 ras 
      inspect rsh 
      inspect rtsp 
      inspect esmtp 
      inspect sqlnet 
      inspect skinny  
      inspect sunrpc 
      inspect xdmcp 
      inspect sip  
      inspect netbios 
      inspect tftp 
      inspect http 
    policy-map gloabl_policy
     class inspection_default
    !
    service-policy global_policy global
    ntp server 192.43.244.18 source outside prefer
    prompt hostname context
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Just out of curiosity, why do you want to allow ICMP inbound? That's a security issue that you'll probably want to avoid... it's generally not a good idea unless there's something specific you're doing that for

    Comment

    • grojom
      New Member
      • May 2010
      • 15

      #3
      I don't, its only internal. Not from the outside in.

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Hmm, maybe I'm not reading this right - what do you still need help with? What's not working?

        Comment

        • grojom
          New Member
          • May 2010
          • 15

          #5
          Mainly this
          Code:
          From the DMZ to the "Internal Network" (the main challenge, not working)
          DNS
          ICMP
          tcp/50389
          upd/50636
          SMTP (to the internal exchange server)
          
          From the Internal Network to the DMZ (everything currently is working, but as other changes might cause this to close I will need the following)
          ICMP
          tcp/50389
          udp/50636
          HTTP
          HTTPS
          SMTP (from the internal exchange server)

          Comment

          • sicarie
            Recognized Expert Specialist
            • Nov 2006
            • 4677

            #6
            Hmmm, well ping uses ICMP, so allowing ICMP both ways will allow ping which is probably not the best idea - what are you trying to do with ICMP? Is there another way (such as reporting purposes, what about syslog, or AD reporting?)

            The first two will be easiest - this link might help build the rules - what have you tried so far?

            (Please also take a look at page 7 section 3 concerning the ICMP issue)

            Comment

            • grojom
              New Member
              • May 2010
              • 15

              #7
              There is no ICMP going to the outside world, only from the inside of the internal ASA to the DMZ behind the external ASA.

              The ultimate problem is communication from the DMZ to the inside of the internal ASA.

              Comment

              • sicarie
                Recognized Expert Specialist
                • Nov 2006
                • 4677

                #8
                Did that link make sense? Were you able to create the two tcp/udp rules?

                Comment

                • grojom
                  New Member
                  • May 2010
                  • 15

                  #9
                  Rules were never a problem, I finally resolved the issue.

                  I was missing a static route from the DMZ to the Gateway of the "Internal" network.
                  I will post a final "cleaned up" config of both routers next week highlighting examples of key elements.

                  Comment

                  • sicarie
                    Recognized Expert Specialist
                    • Nov 2006
                    • 4677

                    #10
                    Glad you were able to figure that out - sorry I wasn't able to understand your question!

                    Comment

                    • grojom
                      New Member
                      • May 2010
                      • 15

                      #11
                      No worries sicarie, as promised here is what was ultimately missing and how one can do it themselves.

                      We must follow basic routing rules for internal networks. So if you had multiple routes and paths they must be defined, but if we are restricting traffic on any of those interfaces we must make exceptions.

                      This is the external config (modified for usable data)
                      Code:
                      ASA Version 8.0(2) 
                      !
                      hostname external
                      names
                      dns-guard
                      !
                      interface Ethernet0/0
                       nameif outside
                       security-level 0
                       ip address xxx.xxx.xxx.82 255.255.255.248 
                      !
                      interface Ethernet0/1
                       nameif inside
                       security-level 49
                       ip address 192.168.1.1 255.255.255.0 
                      !
                      interface Ethernet0/2
                       shutdown
                       no nameif
                       no security-level
                       no ip address
                      !
                      interface Ethernet0/3
                       nameif dmz
                       security-level 40
                       ip address 10.10.10.1 255.255.255.0 
                      !
                      
                      dns domain-lookup outside
                      dns domain-lookup inside
                      dns domain-lookup dmz
                      dns server-group DefaultDNS
                       name-server 192.168.0.11
                       name-server 192.168.0.13
                       domain-name domain.local
                      dns-group Internal
                      same-security-traffic permit inter-interface
                      
                      access-list dmz-in extended permit tcp host 10.10.10.10 host 192.168.0.12 eq 135 
                      access-list dmz-in extended permit tcp host 10.10.10.10 host 192.168.0.12 eq smtp 
                      access-list dmz-in extended permit tcp host 10.10.10.10 host 192.168.0.12 eq 50389 
                      access-list dmz-in extended permit udp host 10.10.10.10 host 192.168.0.12 eq 50636 
                      access-list dmz-in extended permit object-group TCPUDP host 10.10.10.10 host 192.168.0.11 eq domain 
                      access-list dmz-in extended permit object-group TCPUDP host 10.10.10.10 host 192.168.0.13 eq domain 
                      access-list dmz-in extended permit ip host 10.10.10.10 host 192.168.0.12 
                      access-list dmz-in extended deny ip any 192.168.0.0 255.255.255.0 
                      access-list dmz-in extended permit ip 10.10.10.0 255.255.255.0 any 
                      
                      access-list outside_access_in extended permit tcp any any eq 3389 
                      access-list outside_access_in extended permit tcp any any eq www 
                      access-list outside_access_in extended permit tcp any any eq smtp 
                      access-list outside_access_in extended permit tcp any any eq https 
                      
                      access-list inside_access_in extended permit tcp host 10.10.10.10 host 192.168.1.2 eq smtp 
                      access-list inside_access_in extended permit tcp 192.168.0.0 255.255.255.0 host 10.10.10.10 eq smtp 
                      access-list inside_access_in extended deny tcp any any eq smtp 
                      access-list inside_access_in extended permit ip any any 
                      
                      access-list nat0 extended permit ip host 192.168.0.11 host 10.10.10.10 
                      access-list nat0 extended permit ip host 192.168.0.12 host 10.10.10.10 
                      access-list nat0 extended permit ip host 192.168.0.13 host 10.10.10.10 
                      
                      global (outside) 1 interface
                      global (inside) 2 interface
                      global (dmz) 3 interface
                      
                      nat (inside) 0 access-list nat0
                      nat (inside) 1 0.0.0.0 0.0.0.0
                      nat (dmz) 1 0.0.0.0 0.0.0.0
                      
                      static (dmz,outside) tcp interface smtp 10.10.10.10 smtp netmask 255.255.255.255 
                      static (inside,outside) tcp interface 3389 192.168.1.2 3389 netmask 255.255.255.255 
                      static (dmz,outside) tcp interface www 10.10.10.10 www netmask 255.255.255.255 
                      static (inside,outside) tcp interface https 192.168.1.2 https netmask 255.255.255.255 
                      static (dmz,inside) 10.10.10.0 10.10.10.0 netmask 255.255.255.0 
                      static (inside,dmz) 192.168.1.0 192.168.1.0 netmask 255.255.255.0 
                      
                      access-group outside_access_in in interface outside
                      access-group inside_access_in in interface inside
                      access-group dmz-in in interface dmz
                      
                      route outside 0.0.0.0 0.0.0.0 74.117.105.81 1
                      route inside 192.168.0.0 255.255.255.0 192.168.1.2 1
                      And this is the internal config (also modified for usage)
                      Code:
                      ASA Version 8.0(2) 
                      !
                      hostname internal
                      names
                      name 10.10.10.10 srv-4 description Front End Server
                      name 192.168.0.11 srv-1 description DC1
                      name 192.168.0.12 srv-2 description Exchange
                      name 192.168.0.13 srv-3 description DC2
                      
                      dns-guard
                      !
                      interface Ethernet0/0
                       nameif outside
                       security-level 50
                       ip address 192.168.1.2 255.255.255.0 
                      !
                      interface Ethernet0/1
                       nameif inside
                       security-level 100
                       ip address 192.168.0.1 255.255.255.0 
                      !
                      
                      dns domain-lookup outside
                      dns domain-lookup inside
                      dns server-group DefaultDNS
                       domain-name domain.local
                      dns server-group External
                       name-server xxx.xxx.xxx.xxx
                       name-server xxx.xxx.xxx.xxx
                      dns server-group Internal
                       name-server srv-1
                       name-server srv-3
                       domain-name domain.local
                      dns-group Internal
                      same-security-traffic permit inter-interface
                      
                      access-list out-in extended permit tcp any any eq 3389 
                      access-list out-in extended permit tcp any any eq smtp 
                      access-list out-in extended permit ip any any 
                      
                      access-list inside extended permit tcp host srv-2 host srv-4 eq smtp 
                      access-list inside extended deny tcp any any eq smtp 
                      access-list inside extended permit ip any any 
                      
                      access-list nat0 extended permit ip host srv-1 host srv-4 
                      access-list nat0 extended permit ip host srv-2 host srv-4 
                      access-list nat0 extended permit ip host srv-3 host srv-4 
                      
                      global (outside) 1 interface
                      global (inside) 2 interface
                      
                      nat (inside) 0 access-list nat0
                      nat (inside) 1 0.0.0.0 0.0.0.0
                      
                      static (inside,outside) tcp interface 3389 srv-1 3389 netmask 255.255.255.255 
                      static (inside,outside) tcp interface https srv-2 https netmask 255.255.255.255 
                      static (inside,outside) tcp 192.168.1.0 domain 192.168.0.0 domain netmask 255.255.255.0 
                      static (outside,inside) 192.168.1.0 192.168.1.0 netmask 255.255.255.0 
                      
                      access-group out-in in interface outside
                      access-group inside in interface inside
                      
                      route outside 0.0.0.0 0.0.0.0 192.168.1.1 1
                      You will notice a couple of major points.
                      First,
                      Code:
                      route inside 192.168.0.0 255.255.255.0 192.168.1.2 1
                      A route to the network through another security appliance must be established, otherwise our traffic won't know where to go.

                      Next we need to create some exceptions so it will allow that traffic to pass correctly.
                      Code:
                      access-list nat0 extended permit ip host 192.168.0.11 host 10.10.10.10 
                      access-list nat0 extended permit ip host 192.168.0.12 host 10.10.10.10 
                      access-list nat0 extended permit ip host 192.168.0.13 host 10.10.10.10
                      This allows traffic to come from these 3 servers and talk to our DMZ server

                      Next we need to assign that access list to an interface.
                      Code:
                      nat (inside) 0 access-list nat0
                      This is where are servers are in relation to THIS ASA.

                      We repeat the exceptions on the internal ASA but it does not require a route, as we have already established one by ending at the "inside interface" of the "external ASA"

                      Code:
                      access-list nat0 extended permit ip host srv-1 host srv-4 
                      access-list nat0 extended permit ip host srv-2 host srv-4 
                      access-list nat0 extended permit ip host srv-3 host srv-4
                      And as before, we must associate that with an interface
                      Code:
                      nat (inside) 0 access-list nat0
                      Allowing our traffic to reach the servers.

                      This is secure as we have limited that connection to only occur between hosts and not entire networks.

                      Remember that order of precedence on access-lists determines flow.

                      For example
                      Code:
                      access-list inside extended permit tcp host srv-2 host srv-4 eq smtp 
                      access-list inside extended deny tcp any any eq smtp 
                      access-list inside extended permit ip any any
                      Starting at the top, the first line says that SMTP traffic can go from srv-2 to srv-4. The 2nd line says to deny all smtp traffic. Since the first line takes place first that is allowed.

                      Lastly, you can reach the "Internal" network from all the way outside by defining static paths and restricting them by access-lists.

                      So now, I can RDP to my internal servers. My servers can communicate via restricted paths to the DMZ/Edge Server, and vice versa all of the mail flow that is required.

                      All networks can hit the internet.
                      This is a recommended setup by the way to prevent against infected machines from sending out email from inside your network.

                      I removed the ICMP as I was finished with its uses, but simply adding in the correct access-lists enables imcp traffic from location to location again.

                      Hopefully this will help someone.

                      Comment

                      Working...