This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help configuring DMZ Mail Server with Web mail

My Network configuration is as follows

The firewall (ASL 4.0) has three NIC's
The first NIC is connected to a Router which connects to the Internet
The second NIC connects to a DMZ
The third NIC connects to the Internal network

I have two public IP's of which one is used as the Mail Server IP. I have a registered sub domain that is used for checking mails. This sub domain has one MX record so that the mails are delivered to my Mail Server.

The Public IP's  are named as External_Mail_Interface and External_Interface

The DMZ consists of a postfix mail server and a machine that runs Symantec Anti Virus for Gateways (AV Server)

My requirements are :
a. The mail server which runs web mail needs to be accessed from the internet as well as from the internal network. Web mail should be accessed from the internet only through the mail IP.
b. All SMTP mails that come in should route through the AV Server. The AV server then delivers all mail to the mail Server after virus scanning. 
c. The AV server should be able to pick up live updates from the internet.
d. The internal network when sending mails should go through the AV Server. The internal network should be allowed POP3 and IMAP to the mail server.

Currently I have pulled the plug on the AV Server. 

My NAT rules are 
a. Source is Internal Network - > Any Destination - > Change Source to External_Int
b. Any Source - > destination is External mail Int - > Change Source to Ext Mail Int - > Change Destination to Mail Server
c. Source is Mail Server -> Any Destination - > Change Source to Ext Mail Int

The packet filter rules in given order are
a. Internal_Network__ - > any - > any -> Allow
b. Any -> Mail_Group -> Mail Server -> Allow
c. Mail Server -> Mail_Group -> Any -> Allow

where Mail_group is HTTP + HTTPS + DNS + SMTP + IMAP + POP3

The above configuration works fine as long as the AV server does not come into the network.

I have tried a lot of things for the last two weeks to route mails through the AV server. At one point I was able to send mails from the Internet through the AV server. But then I was told that the web mail was not working. Hence I rolled back the entire thing.

I need help on setting up the configuration so that the AV server comes up. My questions are

1. What should the NAT rules be changed to, so that the above mentioned requirements are met ? 
2. What should the packet filter rules be ?

Any help is greatfully accepted.

  


This thread was automatically locked due to age.
Parents
  • Sounds like you want your incoming mail messages going to the AV box, but your web mail access going to the mail server. So rather than having a single DNAT rule for all services, there should be one DNAT rule that routes SMTP to the AV, and another that routes HTTPS to the mail server...
       
  • That is perfectly right. So should I have a NAT rule that says any SMTP on the mail interface, send to the AV box. And another rule to send all other services (DNS, HTTP and HTTPS)to the DMZ network ? One thing that I am confused about is, will both the AV and Mail Server boxes need access to facilities like DNS? How to NAT the DNS or HTTP to both boxes? Also what should the packet filter rules be ? Default deny SMTP to Mail Server? And the next rule of accept SMTP to the AV Server? Will I also need packet filter rules to send packets out of the DMZ to the Internet and also from the AV server to the mail Server?  
  • All other services: Not to the DMZ (too liberal for me); just to the Mail Server's address.

    As for the AV and Mail Server needing DNS: it depends on how they are configured. Some mail relays are configured to forward all mail to a host; most usually forward the mail directly, and thus need DNS. Further, some mail relays do DNS reverse-lookup checks to cut down on funny business (such as Astaro's mail proxy).

    So as to what really needs DNS, you have to ask the people who make, maintain, or support the box. If the box's job is to deliver SMTP mail directly to another domain, it will definitely need DNS...

    As for the rules, Astaro denies by default; so you should add what needs permitting. You will need to permit inbound SMTP to the AV box (Any SMTP AV Allow), an inbound web access rule (Any HTTPS Mail Server Allow); and you will need an outbound rule to permit SMTP out (but just for that device!!). So what sends the SMTP out in your case? The AV box or the Mail Server??

    If you can split out the web serving functions to a seperate box from the mail store, just put the web component of the mail system on the DMZ. Why? That's what will be open to the world and is a tricky component to secure. It wouldn't hurt to put your AV box on the DMZ then too. Shops that do strong security put each server box which is accessiblle from the Internet on a separate DMZ...
          
  • The Mail Server is the only server that should send mail out. It is like that currently. The AV server should only forward mails to the Mail Server. So if I have got you right, the AV server will not need DNS for mail delivery. But how about the live update fetching? Will that require DNS. The DNS is not maintained by us. We use the ISP's DNS.  
Reply
  • The Mail Server is the only server that should send mail out. It is like that currently. The AV server should only forward mails to the Mail Server. So if I have got you right, the AV server will not need DNS for mail delivery. But how about the live update fetching? Will that require DNS. The DNS is not maintained by us. We use the ISP's DNS.  
Children
  • You talking Astaro or another software manufacturer? Astaro does it transparently. For other machines behind a firewall that need to get updates, you can use the DNS proxy or set up a rule for outbound DNS access...
      
  • I have summarised the rules as below. Can you please let me know if I need to change any of this. I intend to implement this on Saturday.

    External To DMZ

    Any Ext Mail Int SMTP Ext Mail Int SeE AV Server
    Any Ext Mail Int HTTP NC SeE Mail Server
    Any Ext Mail Int HTTPS NC SeE Mail Server
    Any Ext Mail Int DNS NC SeE Mail Server

    DMZ to External

    SeE Mail Server Any Any Ext Mail Int NC

    Internal to DMZ

    Internal Network Any SMTP NC SeE AV Server

    Internal to External

    Internal Network Any Any Ext Int NC


    Packet filter
    Any SeE AV Server SMTP Allow
    Any SeE Mail Server HTTP Allow
    Any SeE Mail Server HTTPS Allow
    Any SeE Mail Server DNS Allow
    SeE AV Server SeE Mail Server SMTP Allow
    Any SeE Mail Server POP3 Allow
    SeE Mail Server Any HTTP Allow
    SeE Mail Server Any HTTPS Allow
    SeE Mail Server Any DNS Allow
    SeE Mail Server Any SMTP Allow
    SeE Mail Server Any Any Allow
    SeE AV Server Any Any Allow
    Internal N/W Any Any Allow


    Do I need to change any or will this allow my config to work?  
  • I find these a bit hard to read.
    Please use Astaro's GUI convention in the ordering:

    from service to [Allow|Deny][/b]

    If the from or to is comprised of more than one word,
    use embedded underscores or mixed case (examples: MailServer or Mail_Server).

    If some of the rules above are NATs, label them as DNAT or SNAT.

    Tanx...
        
  • Sorry about the spaces. I have now put in the underscores. I have also mentioned the NAT type in round brackets at the end of the line.

    Words like (External To DMZ etc) mean the route taken. These are there only for separtion of the segments.

     All NAT rules are written as : 
    Source – Destination – Service – Change Source To – Change Dest To

     NC means No Change 

     External To DMZ  
     Any Ext_Mail_Int  SMTP Ext_Mail_Int  SeE_AV_Server    (DNAT)
    Any Ext_Mail_Int  HTTP NC SeE_Mail_Server    (DNAT)
    Any Ext_Mail_Int  HTTPS NC SeE_Mail_Server    (DNAT)
    Any Ext_Mail_Int  DNS NC SeE_Mail_Server    (DNAT)

     DMZ to External 
    SeE_Mail_Server Any Any Ext_Mail_Int  NC     (SNAT)

     Internal to DMZ 
    Internal_Network  Any SMTP NC SeE AV Server     (DNAT)


     Internal to External 
    Internal_Network  Any Any Ext_Int NC     (SNAT)


     Packet filter  (Source - Dest - Service - Action) 
    Any SeE_AV_Server SMTP Allow
    Any SeE_Mail_Server HTTP Allow
    Any SeE_Mail_Server HTTPS Allow
    Any SeE_Mail_Server DNS Allow
    SeE_AV_Server SeE_Mail_Server SMTP Allow
    Any SeE_Mail_Server POP3 Allow
    SeE_Mail_Server Any HTTP Allow
    SeE_Mail_Server Any HTTPS Allow
    SeE_Mail_Server Any DNS Allow
    SeE_Mail_Server Any SMTP Allow
    SeE_Mail_Server Any Any Allow
    SeE_AV_Server Any Any Allow
    Internal_Network Any Any Allow
       
  • Let's go through the PF rules on the first post (revisions of these may subsequently dictate different NATting...).

    The ones where the froms are Any look good (except maybe the POP; you want people outside the company LANs to use POP? -just checking...)

    But

    SeE_Mail_Server Any HTTP Allow
    SeE_Mail_Server Any HTTPS Allow

    looks suspect. You want to browse from the mail server?? Again, just checking.

    These rules are much too liberal for my tastes:

    SeE_Mail_Server Any Any Allow
    SeE_AV_Server Any Any Allow
    Internal_Network Any Any Allow

    For the mail server you've said SMTP and DNS queries are allowed out; so what else do you need??
    The AV server might need updates; but you want to open all ports for it?? You do something like that on a temporary basis when you want to get it up and running.
    As for the Internal network, won't HTTP, DNS, HTTPS... ("the usual suspects") suffice?? Maybe it's just you and you know what you're doing. Again -just checking...

    P.S. When they come in HTTP, they get redirected to an HTTPS page, right?

         
  • You are absolutely right regarding the liberal rules of any. But that is only to get things up and running. All the Any rules will then be changed. 

    POP from outside the LAN is not to be allowed. I shall change that rule.

    HTTP does become HTTPS once inside. So I will need to change the DNAT rule to change the service.

    So I guess I should be up and running by tomorrow. Please let me know if anything else needs to be corrected.  
  • No, don't change the DNAT rule!
    HTTP will stay HTTP, and HTTPS will remain HTTPS.

    I was asking about a forced redirection to HTTPS since using web mail would not be advisable in HTTP for security reasons (but people are technically challenged or lazy and they don't want to have to initially enter an HTTPS address...)
      
  • Thanks for all the help you gave me. I have now set up the ASL with the rules I mentioned. Everything is working as expected. Now I guess I need to tighten up all the rules. I have implemented the rules as mentioned in my previous post. I still have the Any Allow rule. 

    What would you suggest so that, the rules are as tight as they possibly can be.  
  • That's all a function of the culture at your shop.

    If you have the backing of management to make things as secure as possible, start by allowing outbound DNS, HTTP, HTTPS (unless you're using the respective proxies, in which case you can even dispense with those rules). Do an inventory of your apps and see if they need special port connectivity to the Internet (after hours, run each app, see if it fails, look at the log to see what it needs). Warn the users that tighter controls are being put in effect (at the slowest time of the day/week!), and be on call to quickly add rules as needed.

    The biggest bain of firewall administrators now is being strong-armed to permit chat and P2P software. I read on another post recently that the HTTP proxy in version 5 can block connects; it's unclear to me as of yet if it will control everything.

    There are chat proxy servers you can use (Akonix is one) to allow the chatting but stop hazardous content transfers (and chat software exploits too). If they force you to support chat, I would strongly recommend that you get one of these.

    As for P2P, I would discourage it. You could make your company liable for IP theft, and since the latest specs are generally kept secret, it is next to impossible to get software that regulates it to be 'safe' (e.g., to block trojans, worms, etc.).

    Hot security tip: If you're an IE shop, look at IEAK.
    I am looking forward to if/when Opera has centralized and granular controls like it too...
  • I have a strange problem now. The packet filter that was working on Friday is now giving me a very difficult problem. My mails are now not getting delivered. 

    The AV server log says it has received the mail (any mail that has been sent from the internet or from the local LAN) and forwarded the same to the mail server. However this mail is not to be seen anywhere. Basically mail is not going out or coming in. The worst part is that mail is not delivering even to local mail boxes. I restored my oldest Firewall backup(My first post) and mails are now delivering in and out.  What could be the problem? 

    I have configured the AV server to use the mail server as the nameserver. I noticed a lot of errors in the Windows Application log of the AV server, saying "Malformed DNS". What does this mean.

    Also I had a backup of the ASL just before I put in these rules. When I try to restore that, the system asks for a passPhrase. What is this supposed to be ?