Solved

Cisco PIX Hardening Port Forward

Posted on 2010-09-14
7
629 Views
Last Modified: 2012-06-27
I am trying to set up this PIX 5.0 to only allow SMTP to come from a specific range of addresses. I have defined a group "ISPSMTP" covering this range and have also set up the port forwarding. Everything works great, but I can't figure out how to block all SMTP connection except those from the defined group.

I tried setting up a rule to only allow ISPSMTP to the the Exchange server. It appears to work, but when I apply the settings, it change the rule from the Exchange server to the IP of their old email server.

I checked all the definitions and there is nothing left that associates port 25 with the old server. So I don't know why the PIX tries to change it. I have tried defining the rule by name and also IP of the new server, but it always changes back.

This is all in the GUI as I am not a Cisco person. If anyone has heard of this issue or has an idea how to solve it, that would be great.
0
Comment
Question by:Brian B
7 Comments
 
LVL 3

Expert Comment

by:Mystique_87
Comment Utility
Please attach your config
0
 
LVL 23

Author Comment

by:Brian B
Comment Utility
As I said I am not a cisco person, however I think this is what you are looking for. I have starred out identifying information.
Again, I am trying to allow only the ranges Netaccess1 and Netaccess2 to send SMTP to my server Exchange. I tried to do this by allowing the two ranges and blocking everything else.

PIX Version 6.3(5)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password ******** encrypted
passwd ******* encrypted
hostname firewall
domain-name domain.com
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
no fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
name 10.3.1.20 Exchange
name 10.3.1.4 Streamline
name 10.3.1.2 Notes
name 216.145.96.15 Netaccess1
name 64.18.0.0 Netaccess2
object-group network NetaccessGroup
  network-object Netaccess2 255.255.240.0
  network-object Netaccess1 255.255.255.255
access-list vpngroup_splitTunnelAcl permit ip any any
access-list inside_outbound_nat0_acl permit ip any 172.16.1.0 255.255.255.240
access-list outside_cryptomap_dyn_20 permit ip any 172.16.1.0 255.255.255.240
access-list inbound permit tcp host Netaccess1 eq smtp host 216.145.98.72 eq smtp
access-list inbound remark Allow netaccess email
access-list inbound permit tcp Netaccess2 255.255.240.0 eq smtp host 216.145.98.72 eq smtp
access-list inbound remark Block all other SMTP
access-list inbound deny tcp any eq smtp any eq smtp
access-list inbound permit icmp any any
access-list inbound permit tcp any any
pager lines 24
icmp permit any outside
mtu outside 1500
mtu inside 1500
ip address outside pppoe setroute
ip address inside 10.3.1.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
ip local pool vpnpool 172.16.1.1-172.16.1.10
pdm location Notes 255.255.255.255 inside
pdm location Streamline 255.255.255.255 inside
pdm location 24.215.4.204 255.255.255.255 outside
pdm location 66.195.71.182 255.255.255.255 outside
pdm location 10.3.1.6 255.255.255.255 inside
pdm location Exchange 255.255.255.255 inside
pdm location Netaccess2 255.255.240.0 outside
pdm location Netaccess1 255.255.255.255 outside
pdm group NetaccessGroup outside
pdm logging informational 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list inside_outbound_nat0_acl
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp interface 3389 Streamline 3389 netmask 255.255.255.255 0 0
static (inside,outside) tcp interface pcanywhere-data Streamline pcanywhere-data netmask 255.255.255.255 0 0
static (inside,outside) tcp interface 5632 Streamline 5632 netmask 255.255.255.255 0 0
static (inside,outside) tcp 216.145.98.72 https Exchange https netmask 255.255.255.255 0 0
static (inside,outside) tcp 216.145.98.72 smtp Exchange smtp netmask 255.255.255.255 0 0
static (inside,outside) tcp 216.145.98.72 3101 Exchange 3101 netmask 255.255.255.255 0 0
static (inside,outside) tcp 216.145.98.72 pop3 Notes pop3 netmask 255.255.255.255 0 0
static (inside,outside) tcp 216.145.98.72 www Notes www netmask 255.255.255.255 0 0
static (inside,outside) tcp 216.145.98.72 lotusnotes Notes lotusnotes netmask 255.255.255.255 0 0
access-group inbound in interface outside
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-disconnect 0:02:00 sip-invite 0:03:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http 10.3.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto dynamic-map outside_dyn_map 20 match address outside_cryptomap_dyn_20
crypto dynamic-map outside_dyn_map 20 set transform-set ESP-3DES-MD5
crypto map outside_map 65535 ipsec-isakmp dynamic outside_dyn_map
crypto map outside_map client authentication LOCAL
crypto map outside_map interface outside
isakmp enable outside
isakmp policy 20 authentication pre-share
isakmp policy 20 encryption 3des
isakmp policy 20 hash md5
isakmp policy 20 group 2
isakmp policy 20 lifetime 86400
vpngroup vpngroup address-pool vpnpool
vpngroup vpngroup dns-server 10.3.1.3
vpngroup vpngroup default-domain domain.com
vpngroup vpngroup split-tunnel vpngroup_splitTunnelAcl
vpngroup vpngroup idle-time 1800
vpngroup vpngroup password ********
telnet timeout 5
ssh 10.3.1.0 255.255.255.0 inside
ssh timeout 5
console timeout 0
vpdn group pppoe_group request dialout pppoe
vpdn group pppoe_group localname **********
vpdn group pppoe_group ppp authentication pap
vpdn username ********** password ********* store-local
username terran password ********* encrypted privilege 15
username barbc password ********* encrypted privilege 3
username admin password ********** encrypted privilege 15
terminal width 80
: end
0
 
LVL 4

Expert Comment

by:ullas_unni
Comment Utility
whats the private ip of your new exchange server and your old exchange server?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 23

Author Comment

by:Brian B
Comment Utility
Exchange is 10.3.1.20
The old Notes server is 10.3.1.4

Its not changing any more. I was able to set up the rule, but it didn't work. That is the above config.
0
 
LVL 5

Accepted Solution

by:
shirkan earned 500 total points
Comment Utility
change this

access-list inbound deny tcp any eq smtp any eq smtp
(this only blocks traffic from source port 25 and that will in most cases always be a different one)
to
access-list inbound deny tcp any any eq smtp
(so you block any source with destination port 25)

also these (avoid source ports in destination access-lists)

access-list inbound permit tcp host Netaccess1 eq smtp host 216.145.98.72 eq smtp
to access-list inbound permit tcp host Netaccess1  host 216.145.98.72 eq smtp
access-list inbound permit tcp Netaccess2 255.255.240.0 eq smtp host 216.145.98.72 eq smtp
to access-list inbound permit tcp Netaccess2 255.255.240.0 host 216.145.98.72 eq smtp

and after you are done u need to do a "write mem"
to save your config, otherwise the next boot it will be gone again

and since there is so little you have configured i would get rid of these too

name 10.3.1.20 Exchange
name 10.3.1.4 Streamline
name 10.3.1.2 Notes
name 216.145.96.15 Netaccess1
name 64.18.0.0 Netaccess2
object-group network NetaccessGroup
  network-object Netaccess2 255.255.240.0
  network-object Netaccess1 255.255.255.255

and just use the IP addresses in your access-l, it is easier to read and the above makes it more complicated than it could be
0
 
LVL 23

Author Comment

by:Brian B
Comment Utility
Will try that, thanks!
0
 
LVL 23

Author Closing Comment

by:Brian B
Comment Utility
In the end, it was decided to replace the PIX. So question is kind of moot. However, thanks for the effort and time trying to help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I recently updated from an old PIX platform to the new ASA platform.  While upgrading, I was tremendously confused about how the VPN and AnyConnect licensing works.  It turns out that the ASA has 3 different VPN licensing schemes. "site-to-site" …
This article will cover setting up redundant ISPs for outbound connectivity on an ASA 5510 (although the same should work on the 5520s and up as well).  It’s important to note that this covers outbound connectivity only.  The ASA does not have built…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now