Buscar

Linux: Gateway AntiSpam BitDefender

Una de las recomendaciones a implementar en nuestro sistema de correo corporativo es una solución antispam independiente que comunique por SMTP con nuestro servidor de correo.

Escenario:


Diagrama conceptual:

Escenario gatewaySMTP

Para la entrada de correo desde el exterior: La "bola roja", corresponde a la solución Antivirus y AntiSpam, después de su limpieza, los correos son entregados al servidor de correo corporativo "bola azul" vía SMTP.

Podemos cambiar la "bola azul", por el servidor de correo corporativo que queramos: Exchange, Zimbra, MDaemon, IMail, etc...

También podemos implementar la "bola roja" que queramos, de pago o gratuita, sobre Windows o sobre Linux, un appliance o una VM, puede estar dentro de la infraestructura o fuera.

En este post veremos un ejemplo de solución de "bola roja" basado en Linux y Bitdefender, en su versión gratuita.

Instalación SO Linux:


Instalamos el sistema operativo Linux.

En el libro: LinuXe - Linux para empresas, encontraremos una serie de recomendaciones a seguir para elegir la distribución adecuada y realizar la configuración post instalación que utilice de mejor forma los recursos.

En este ejemplo, utilizaremos: CentOS7 x64, sin instalar entorno gráfico e instalando solo Postfix, el MTA por defecto que integra la distribución.

Algunas configuraciones post-instalación:

#Prerequisitos VMWare Tools:

[root@Linux1 ~]# yum install net-tools perl

#FirewallD1 DISABLE


[root@Linux1 ~]# systemctl disable firewalld

#IPv6 DISABLE


[root@Linux1 ~]# vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1


#SELINUX DISABLE


[root@Linux1 ~]# vi /etc/sysconfig/selinux
SELINUX=disabled



Solución AntiSpam sobre Linux:


En este ejemplo, utilizaremos la solución de BitDefender gratuita para servidores Linux.

Esta solución gratuita, proporciona servicio de AntiSpam, pero no de AntiVirus.

Veamos el detalle de su instalación:

#Descargamos fichero:

[root@localhost bitdefender]# wget http://download.bitdefender.com/SMB/Mail_Server_Security/BitDefender_Free_Antispam_for_Mail_Servers/Linux/Current/EN/64bit/BitDefender-Free-Antispam-for-Mail-Servers-linux-amd64.rpm.run
    total 215M
    -rw-r--r--. 1 root root 215M May 29  2014 BitDefender-Free-Antispam-for-Mail-Servers-linux-amd64.rpm.run


#Aplicamos permisos de ejecución al script de instalación:

 [root@localhost bitdefender]# chmod 700 BitDefender-Free-Antispam-for-Mail-Servers-linux-amd64.rpm.run
[root@localhost bitdefender]# ls -l
    total 220140
    -rwx------. 1 root root 225421342 May 29  2014 BitDefender-Free-Antispam-for-Mail-Servers-linux-amd64.rpm.run


#Ejecutamos script:

[root@localhost bitdefender]# ./BitDefender-Free-Antispam-for-Mail-Servers-linux-amd64.rpm.run
Verifying archive integrity... All good.
Uncompressing BitDefender Free Antispam for Mail Servers.........

Please choose from the list below how the install process shall proceed:

1. Install 'BitDefender Free Antispam for Mail Servers'
2. Abort

Enter an option or a list of space separated options: 1

---
accept
---



#Indicamos la configuración de las notificaciones:

BitDefender Security now has support for e-mail notifications for new versions and patches. For more information about E-mail Notifications, please consult the BitDefender Documentation.

Do you want to enable E-Mail Notifications on new versions and patches? (Y/n)
 

Please enter the address of the SMTP server (default: 127.0.0.1)
Please enter the port where the SMTP server listens (default: 25)
Address which receives the notifications (default: postmaster@localhost) xavi@D1.com

---


#Indicamos la integración del MTA a utilizar. Utilizaremos el propio MTA del equipo (Postfix), sin embargo, indicaremos la opción SMTP Proxy que funcionará con cualquier MTA.
 
Please select from the list below which MTA you are running in order to integrate BitDefender with it:

    1. Communigate Pro
    2. Courier
    3. Postfix-SMTP Proxy
    4. Postfix-milter
    5. qmail
    6. Sendmail-milter
    7. SMTP Proxy - works with any Mail Transfer Agent

    Enter your option (Detected: 4): 7
 

    Your option: smtp

#Configuramos la verificación en listas negras (RBL). Activamos la verificación y configuramos spamhaus y barracuda:

Automated integration with an unknown MTA is not possible.
Please read the documentation and perform the integration manually,
then restart the BitDefender services and your MTA.

    Do you want to enable RBL ? (Y/n)
    o you want to enable RBL ? (Y/n)

Please enter a RBL server to use (or ENTER to finish): zen.spamhaus.org
 

Please enter a trust level [default: 50] :

Please enter a RBL server to use (or ENTER to finish):

b.barracudacentral.org
 

Please enter a trust level [default: 50] :

Please enter a RBL server to use (or ENTER to finish):


#Configuramos la licencia: Introducimos el s/n free:
 Please enter a 'BitDefender Free Antispam for Mail Servers' registration key or press in order to continue using the trial version
 

XXXXXXXXXX

Checking the key for BitDefender Security for Mail Servers
License key           :
XXXXXXXXXX
License status        : valid (free)
License covers        : 1 user
License days remaining: 365


#Configuramos IP y puerto de administración:
 
Setting up the Remote Admin HTTP server

Bind address (127.0.0.1:8139) : 10.126.1.3:8139
Creating the bdradmind SSL certificate ...OK:
-r--------. 1 root root 1352 Nov  2 15:55 /opt/BitDefender//etc/certs/bdradmin.pem

Detected FQDN: bitdefender.D1.com. If you'll access the radmin server using another name, please regenerate the certificate:
/opt/BitDefender/bin/bdcertgen.sh --fqdn --force
Dont't forget to restart the radmin service afterwards.


#Configuramos password de administrador:
 
Setting up the 'administrator' account

Password: XXXXXXXX
Re-enter password:
XXXXXXXX    
Stopping . done
BitDefender radmin package was successfully set up.



Starting BitDefender Registry:                             [  OK  ]
Starting BitDefender Logger:                               [  OK  ]
Starting BitDefender Scanning Engine:
Starting BitDefender Mail Daemon:                          [  OK  ]
Starting BitDefender SNMP Daemon:                          [  OK  ]
Starting BitDefender Monitor:                              [  OK  ]
Starting BitDefender Live! Update:                         [  OK  ]
Starting radmin ...
Starting BitDefender Remote Admin:                         [  OK  ]
install completed
----


Configuración MTA - Postfix:


En este apartado configuraremos Postfix para reenviar los mails según el dominio al servidor de correo corporativo.

En el ejemplo, configuramos los dominios: D1.com, D2.com y D3.com hacia el SMTP del servidor de correo corporativo ("bola azul"): 192.168.1.5

---

Fichero:

/etc/postfix/main.cf

Valor:
 
inet_interfaces = all

---

Fichero:

/etc/postfix/main.cf
 

Valor:

transport_maps = hash:/etc/postfix/transport 

---

Fichero:

/etc/postfix/main.cf
 

Valor:

relay_domains = D1.com, D2.com, D3.com

--- 

Fichero: 

/etc/postfix/transport

Valor: 

D1.com    smtp:192.168.1.5
D2.com    smtp:
192.168.1.5 
D3.com    smtp:192.168.1.5

--- 

Aplicamos configuración:
 
[root@localhost log]# postmap /etc/postfix/transport



Reiniciamos servicio:

[root@localhost log]# systemctl restart postfix.service

---

Vista panel de administración:


Panel administración Bitdefender




8 comentarios:

  1. Me gusta mucho este post, tendré que echar un vistazo a la solución de bitdefender. Por mi parte he probado Scrollout en entornos que reciben carios cientos de miles de correos al día y funciona muy, pero que muy bien, tiene autenticación con AD, OpenLDAP, y muchas más cosas para configurar como DLP y más:
    https://www.jorgedelacruz.es/2014/12/09/construyendo-un-sistema-de-correo-y-colaboracion-seguro-zimbra-collaboration-y-scrollout-f1/

    Un saludo

    ResponderEliminar
    Respuestas
    1. ¡Gracias Jorge! Tiene muy buena pinta. ¡Lo probaremos!

      Eliminar
    2. Como les fue, cual es el "catch"!?

      Eliminar
    3. La pregunta es: ¿Cual es el bueno? :-))

      Yo creo que deberás probarlos para descubrirlo. Todos tienen sus ventajas y desventajas.

      Otra alternativa a probar es http://www.xeams.com/

      Solución también gratuita sobre Linux.

      Eliminar
  2. Hola Xavi

    Muy interesante el post. Yo personalmente, he probado la soluciónde TrendMicro y un día que tengas tiempo te aconsejo que le eches un vistazo ( http://www.trendmicro.com/us/enterprise/network-security/interscan-message-security/ ). La verdad es que es muy potente.

    Un saludo

    ResponderEliminar
    Respuestas
    1. Hola Oscar,

      La solución de TrendMicro ya la he probado, es de pago pero muy buena, efectivamente efectividad y administración muy potentes.

      Un saludo!

      Xavi.

      Eliminar