Wednesday, April 8, 2009

Eight Basic Commands to Configure a Cisco ASA Security Appliance


Eight Basic Commands to Configure a Cisco ASA Security Appliance


There are literally thousands of commands and sub-commands available to configure a Cisco security appliance. As you gain knowledge of the appliance, you will use more and more of the commands. Initially, however, there are just a few commands required to configure basic functionality on the appliance. Basic functionality is defined as allowing inside hosts to access outside hosts, but not allowing outside hosts to access the inside hosts. Additionally, management must be allowed from at least one inside host. Here are eight basic commands:

**interface**

The interface command identifies either the hardware interface or the VLAN interface that will be configured. Once in interface configuration mode, you can assign physical interfaces to switchports and enable them (turn them on) or you can assign names and security levels to VLAN interfaces.

**nameif**

The nameif command gives the interface a name and assigns a security level. Typical names are outside, inside, or DMZ.

**security-level**

Security levels are used by the appliance to control traffic flow. Traffic is permitted to flow from interfaces with higher security levels to interfaces with lower security levels, but not the other way. Access-lists must be used to permit traffic to flow from lower security levels to higher security levels. Security levels range from 0 to 100. The default security level for an outside interface is 0. For an inside interface, the default security level is 100.In the following sample configuration, the interface command is first used to name the inside and outside VLAN/Physical  interfaces, then the DMZ interface is named and a security level of 50 is assigned to it.

ciscoasa(config)# interface vlan1
ciscoasa(config-if)# nameif inside
INFO: Security level for "inside" set to 100 by default.
ciscoasa(config-if)# interface vlan2
ciscoasa(config-if)# nameif outside
INFO: Security level for "outside" set to 0 by default.
ciscoasa(config-if)#interface vlan3
ciscoasa(config-if)# nameif dmz
ciscoasa(config-if)# security-level 50
            OR

ciscoasa(config)# interface ethernet 0/0
ciscoasa(config-if)# nameif inside
INFO: Security level for "inside" set to 100 by default.
ciscoasa(config-if)# interface ethernet 0/1
ciscoasa(config-if)# nameif outside
INFO: Security level for "outside" set to 0 by default.
ciscoasa(config-if)#interface ethernet 0/3
ciscoasa(config-if)# nameif dmz
ciscoasa(config-if)# security-level 50

**ip address**

The ip address command assigns an IP address to a VLAN/Physical interface either statically or by making it a DHCP client. With modern versions of security appliance software, it is not necessary to explicitly configure default subnet masks. If you are using non-standard masks, you must explicitly configure the mask, but otherwise, it's not necessary.In the following sample configuration, an IP address is assigned to VLAN 1/ethernet 0/0, the inside interface.

ciscoasa(config-if)# interface vlan 1
ciscoasa(config-if)# ip address 192.168.1.1

                   OR

ciscoasa(config-if)# interface ethernet 0/0
ciscoasa(config-if)# ip address 192.168.1.1

**switchport access**   ( If your are using vlan interface for you configuration )

The switchport access command on the ASA 5505 security appliance assigns a physical interface to a logical (VLAN) interface. In the next example, the interface command is used to identify physical interfaces, assign them to switchports on the appliance, and enable them (turn them on) through the use of the "no shutdown" statement.

ciscoasa(config-if)# interface ethernet 0/0
ciscoasa(config-if)# switchport access vlan 2
ciscoasa(config-if)# no shutdown
ciscoasa(config-if)# interface ethernet 0/1
ciscoasa(config-if)# switchport access vlan 1
ciscoasa(config-if)# no shutdown


**nat**

The nat command enables network address translation on the specified interface for the specified subnet.In this sample, configuration, NAT is enabled on the inside interface for hosts on the 192.168.1.0/24 subnet. The number "1" is the NAT I.D. which will be used by the global command to associate a global address or pool with the inside addresses. (Note: NAT 0 is used to prevent the specified group of addresses from being translated.)

ciscoasa(config)# nat (inside) 1 192.168.1.0 255.255.255.0

**global**

The global command works in tandem with the nat command. It identifies the interface (usually outside) through which traffic from nat'ed hosts (usually inside hosts) must flow. It also identifies the global address which nat'ed hosts will use to connect to the outside world.In the following sample, the hosts associated with NAT I.D. 1 will use the global address 12.3.4.5 on the outside interface.

ciscoasa(config)# global (outside) 1 12.3.4.5

In this additional example of the use of the "global" command, the interface statement tells the firewall that hosts associated with NAT I.D. 1 will use the DHCP-assigned global address on the outside interface.

ciscoasa(config)# global (outside) 1 interface

**route**

The route command, in its most basic form, assigns a default route for traffic, typically to an ISP's router. It can also be used in conjunction with access-lists to send specific types of traffic to specific hosts on specific subnets.In this sample configuration, the route command is used to configure a default route to the ISP's router at 4.2.2.2. The two zeroes before the ISP's router address are shorthand for an IP address of 0.0.0.0 and a mask of 0.0.0.0. The statement outside identifies the interface through which traffic will flow to reach the default route.

ciscoasa(config-if)# route outside 0 0 4.2.2.2

The above commands create a very basic firewall, but frankly, using a sophisticated device such as a Cisco PIX or ASA security appliance to perform such basic firewall functions is overkill. Other commands to use include hostname to identify the firewall, telnet or SSH to allow remote administration, DHCPD commands to allow the firewall to assign IP addresses to inside hosts, and static route and access-list commands to allow internal hosts such as DMZ Web servers or DMZ mail servers to be accessible to Internet hosts. Obviously, if you're using a device such as an ASA or a PIX, you'll probably be doing a lot more with it than simply setting up a basic firewall, but the above commands will provide a foundation for the more complex configurations.

Active desktop recovery, desktop.htt problem in windows terminal server 2003

I've suddenly started having a problem with Active Desktop Recovery being shown every time I start my (Win XP Pro) machine. When I click "Restore my Active Desktop" I get the following error:

"An error has occured in a script on this page:
Line 65

Char 1
file:///C:/Documents%20and%20Settings/My%20Name/Application%20Data/Microsoft/Internet%20Explorer/Desktop.htt"

I thought it might be a problem with my recent installation of IE7, but I've reinstalled this and it still doesn't make a difference.


Solution :

I have now sorted a fix for this problem

run regedit

find this entry - HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components

change the key value - DeskHtmlVersion REG_DWORD 0x00000110(272) to decimal zero

Close regedit log off and log back on.

This has worked for all our XP clients

Tuesday, April 7, 2009

BGP updates through your ASA/PIX with 7.0/8.0

If you are attempting to pass BGP updates through your ASA/PIX with 7.0/8.0 code you need to be aware that BGP uses TCP option 19, which is not permitted to pass through a PIX/ASA running 7.0 or higher.  To permit traffic with these TCP options you must create a TCP map and apply it using the service policy command. Here is an example:

tcp-map MD5-BGP
  tcp-options range 19 19 allow   

class-map CLASS-MD5-BGP
  match port tcp eq 179

policy-map global_policy
 class CLASS-MD5-BGP
  set connection advanced-options MD5-BGP
  set connection random-sequence-number disable  

Also note that randomization of TCP sequence numbers must be disabled.  This used to be done at the end of the static command, but the preferred option in 7.x and above is to use MPF and apply it via the policy-map.  Also the addresses of the devices running BGP cannot be NATed.  This is because the MD5 hash takes into account the IP header as well as the TCP header; so none of that information can be changed.

MSexchange edb database corrupted Dirty shutdown ( Not mounting )


Dirty Shutdown & eseutil


Run the eseutil /p frorm the BIN folder and repair edb files. 
Delete the log and chk files. 
Run a defrag on the stores . eseutil /d 
Run isinteg (isinteg -s servername -fix -test alltests) frorm the bin folder. 
Try to Mount the stores. 

I was weary about running the eseutil /p - since I've read horror stories about using /p - but it worked out fine for me. 

Hope someone can use this in the future. 

Understanding TCP Options with Cisco PIX and Steelheads riverbed

What are TCP options?
---------------------------------
TCP has provision for optional header fields identified by an option type
field. Options 0 and 1 are exactly one octet which is their type field. All
other options have their one octet type field, followed by a one octet length
field, followed by length-2 octets of option data.
The standard TCP options are Type 0 (End of Option List), 1 (No-Operation), 2
(Maximum Segment Size, len 4), 3 (WSOPT - Window Scale, len 3), 4 (SACK
Permitted, len 2), 5 (SACK, len N), and 8 (TSOPT - Time Stamp Option, len 10).
Type 6-7, and 9-255 have no widespread use and are usually blocked by firewall
policies. In fact, Cisco recommends blocking these TCP option types in PIX.
Riverbed uses Type 76 which falls in the Unassigned Type range 28-252.
Some firewall configurations will strip TCP options or else drop packets with
these options. (For example, Cisco PIX Firewall IOS 7.0 may block the
auto-discovery probe.)
How do you allow TCP option 76 in PIX?
--------------------------------------------------
Version 7.0(1) introduced the command "tcp-option" to allow or clear TCP
options.
Here is a sample configuration:
PIX(config)# access-list TCP extended permit tcp any any
PIX(config)# tcp-map tmap
PIX(config-tcp-map)# tcp-options range 76 76 allow
PIX(config)# class-map cmap
PIX(config-cmap)# match access-list TCP
PIX(config)# policy-map pmap
PIX(config-pmap)# class cmap

PIX(config-pmap)# set connection advanced-options tmap
PIX(config)# service-policy pmap global
Errors with Existing Service Policy
------------------------------------------
If you are already using a service policy or you get an error "ERROR: Policy
map global_policy is already configured as a service policy," you need to modify
the configuration.
(Examine the options from the running configuration to see if a service policy
exists.)
If a service policy is already defined, use this set of commands ? the last
three commands are different:
ciscoasa# config t
ciscoasa(config)# access-list TCP extended permit tcp any any
ciscoasa(config)# tcp-map tmap
ciscoasa(config-tcp-map)# tcp-options range 76 76 allow
ciscoasa(config-tcp-map)# class-map cmap
ciscoasa(config-cmap)# match access-list TCP
ciscoasa(config-cmap)# policy-map pmap
ciscoasa(config-pmap)# class cmap
ciscoasa(config-pmap-c)# set connection advanced-options tmap
ciscoasa(config)# policy-map global_policy
ciscoasa(config-global_policy)# class cmap
ciscoasa(config-global_policy-c)# set connection advanced-options tmap
These commands modify the service policy named "global_policy." So instead of
defining a policy map called pmap, we modify and use the existing policy map
which is called global_policy.
Now the Steelheads auto-discover each other and work as expected.

(You can delete the policy map you created earlier called pmap if you want.)