LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-12-2008, 12:09 AM   #1
Ruthiness
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
iptables help - securing mail server


Hi all,

I am relatively new to the iptables thing and need to secure a mail server with only these ports open to the outside world:

25, 3535, 389, 636, 5729, 443, 993, 22

We use imaps, smtp, https, an Outlook connector thingy and ssh as well as we want to test ldap secure and non-secure - ultimately going only with 636.

OS is RHEL 4

this is the current iptables - we are also behind a firewall that blocks all ports except the above. There are things in there that I added to try to get some things running and I know I need to clean it up.. but since I'm a noob at iptables, I'm afraid it's a mess. I don't want to experiment since the mail server is "in use" by a company I consult to.

Can anyone help me clean this up without breaking our current access???
I would be forever in your debt for the help..

Just bold the lines I should remove and perhaps I have extra chains that are not needed as well... Feel free to post an example of a correctly configured iptables that essentially allows the same ports and I'll adapt mine.

Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere
ACCEPT tcp -- mail.ourdomain.com mail.ourdomain.com tcp dpt:8009
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
LOG icmp -- anywhere anywhere LOG level debug prefix `IPTABLES ICMP-IN '
DROP icmp -- anywhere anywhere
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT tcp -- anywhere anywhere tcp dpt:5767 flags:SYN,RST,ACK/SYN
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:imaps
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
 
Old 02-13-2008, 09:18 AM   #2
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Rep: Reputation: 32
I highly recommend using this site to help build an iptables script and then modifying it to fit your needs. It was VERY helpful to me.

Easy Firewall Generator: http://easyfwgen.morizot.net/gen/

It has a lot of options and every time you change some stuff and hit generate it will ask you for more info if needed.
(this may require some kernel modules - but if your kernel is > 2.6 I bet it'd be fine) (verification anyone)
 
Old 02-14-2008, 07:28 AM   #3
Ruthiness
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you Checkmate.. I will check it out!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Securing My Cacti Server With Iptables debloxie Linux - Networking 2 11-06-2006 01:09 AM
Iptables and mail server ciberrust Linux - Security 5 04-20-2006 10:45 AM
Securing server - SELinux or iptables or both? pingu Linux - Networking 2 11-10-2005 04:07 AM
Iptables problem with Mail server ~=gr3p=~ Linux - Security 3 10-25-2005 10:28 PM
Securing Mail and Web hosting server Tigger Linux - Security 1 05-31-2003 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration