E-mail Content Scanning with Exim 4



Similar documents
Exim4U. Server Solution For Unix And Linux Systems

Collateral Damage. Consequences of Spam and Virus Filtering for the System. Peter Eisentraut 22C3. credativ GmbH.

FortiMail Filtering Course 221-v2.2 Course Overview

Analysis of Spam Filter Methods on SMTP Servers Category: Trends in Anti-Spam Development

one million mails a day: open source software to deal with it Charly Kühnast Municipal Datacenter for the Lower Rhine Area Moers, Germany

ETH Zürich - Mail Filtering Service

Antispam Security Best Practices

FortiMail Filtering Course 221-v2.0. Course Overview. Course Objectives

The Open Source Stack: One approach to spam filtering

Eiteasy s Enterprise Filter

Anti Spam Best Practices

Hosted CanIt. Roaring Penguin Software Inc. 26 April 2011

Spam and Virus Scanning with Exim 4. using Exiscan and/or SA-Exim. Mini-HOWTO

Fighting Spam with open source software

A Modular Architecture Using Open Source Components

Math SMTP Server Configuration

TRU - SPAM FILTERING GATEWAY CASE STUDY

eprism Security Appliance 6.0 Intercept Anti-Spam Quick Start Guide

MDaemon configuration recommendations for dealing with spam related issues

Effective Open-Source Spam Filtering

SPAM FILTER Service Data Sheet

A D M I N I S T R A T O R V 1. 0

An Overview of Spam Blocking Techniques

Configuring MDaemon for Centralized Spam Blocking and Filtering

Objective This howto demonstrates and explains the different mechanisms for fending off unwanted spam .

Do you need to... Do you need to...

Technical Note. ISP Protection against BlackListing. FORTIMAIL Deployment for Outbound Spam Filtering. Rev 2.2

Fighting Spam: Tools, Tips, and Techniques

Government of Canada Managed Security Service (GCMSS) Annex A-5: Statement of Work - Antispam

Avira Managed Security AMES FAQ.

FortiMail Filtering. Course 221 (for FortiMail v5.0) Course Overview

ContentCatcher. Voyant Strategies. Best Practice for Gateway Security and Enterprise-class Spam Filtering

English Translation of SecurityGateway for Exchange/SMTP Servers

ECE Mail System Overview. Pablo J. Rebollo ECE Network Operations Center

Enhanced Spam Defence

FortiMail Filtering. Course 221 (for FortiMail v4.2) Course Overview

Visendo Suite a reliable solution for SMBs

How To Block Ndr Spam

Security. Help Documentation

The Leading Security Suites

Funkwerk UTM Release Notes (english)

Guardian Digital Secure Mail Suite Quick Start Guide

EFFECTIVE SPAM FILTERING WITH MDAEMON

Introduction of the S25R anti-spam system

Implementing MDaemon as an Security Gateway to Exchange Server

Intercept Anti-Spam Quick Start Guide

FortiMail Filtering. Course for FortiMail v4.0. Course Overview

Mail Service Reference

How To Configure Forefront Threat Management Gateway (Forefront) For An Server

Solution Brief FortiMail for Service Providers. Nathalie Rivat

CleanMail Server Version 5 Manual

XGENPLUS SECURITY FEATURES...

Technical Note. FORTIMAIL Configuration For Enterprise Deployment. Rev 2.1

Certified Spam Assassin Professional VS-1114

Anti Spamming Techniques

Spam Testing Methodology Opus One, Inc. March, 2007

Administrator Manual v3.0

Libra Esva. Whitepaper. Glossary. How Really Works. Security Virtual Appliance. May, It's So Simple...or Is It?

Fighting Spam in an ISP Environment:

EMB. Basics. Goals of this lab: Prerequisites: LXB, NET, DNS

AntiVirus and AntiSpam scanning The Axigen-Kaspersky solution

Marketing Do s and Don ts A Sprint Mail Whitepaper

How To Set Up Comendo.Comendo.Org For A Spammer To Send To Your Domain Name From Your Domain From Yourdomain.Com Or Yourdomain From Yourmail.Com To Yourdomain (For A Domain Name)

Mailwall Remote Features Tour Datasheet

Copyright 2011 Sophos Ltd. Copyright strictly reserved. These materials are not to be reproduced, either in whole or in part, without permissions.

Configuring Your Gateman Server

Anti-spam filtering techniques

The Network Box Anti-Spam Solution

Precis Overview - The Threat

The Exim Mail Transfer Agent. Input Control and Access Control Lists. Philip Hazel. University of Cambridge Computing Service.

IceWarp Unified Communications. AntiVirus Reference. Version 10.4

Handling Unsolicited Commercial (UCE) or spam using Microsoft Outlook at Staffordshire University

Spam, Spam and More Spam. Spammers: Cost to send

COMBATING SPAM. Best Practices OVERVIEW. White Paper. March 2007

security

AntiSpam QuickStart Guide

Symantec Hosted Mail Security. Console and Spam Quarantine User Guide

What is a Mail Gateway?... 1 Mail Gateway Setup Peering... 3 Domain Forwarding... 4 External Address Verification... 4

CipherMail Gateway Quick Setup Guide

Quick Start Policy Patrol Mail Security 9

MailFoundry User Manual. Page 1 of 86. Revision: MF Copyright 2007, Solinus Inc. All Rights Reserved. Page 1 of 86

Greylisting has been around since 2003 when Evan Harris wrote the original whitepaper on it as a spam filtering mechanism.

Mail Avenger. David Mazières New York University

Anti-SPAM Solutions as a Component of Digital Communications Management

Why Content Filters Can t Eradicate spam

Transcription:

E-mail Content Scanning with Exim 4 Tim Jackson (tim@timj.co.uk) Overview Introduction to content scanning Content scanning at the MTA issues Methods of implementing content scanning Accept-and-scan SMTP-time Software required Brief overview of common software A look at Exiscan Other considerations Conclusions Introduction Basic Rationale & Considerations Defend against viruses, spam or other unwanted messages A final check for messages that have made it through other checks Not a substitute for DNSBLs and other non-content checks! False positives based on content typically occur more frequently than with checks not based on content (e.g. DNSBL lookups) Need to consider a variety of policy and good practice issues, not just technical ones Inbuilt methods for content scanning SMTP time: Rules making decisions based on content (e.g. $message_body) in the DATA ACL Post-SMTP: Exim/Sieve filters (per-user or system filters) Some common external content scanning software SpamAssassin Free software spam checker Clam Antivirus Free software virus scanner Sophos/sophie commercial virus scanner/free software daemon Content scanning at the MTA Centralised easy to apply consistently across large user populations Transparent no need for end users to install or configure software, or to learn about content scanning Easy to maintain all in one place Confuses the role of an MTA, which normally only transports mail rather than taking action based on its content Can be a blunt instrument, takes control away from users (although this cuts both ways can be a good thing) Centralises burden on mail servers resource usage needs to be considered.

Two primary ways to implement content scanning Accept-and-scan SMTP-time scanning Method: Accept-and-scan Accept the message as normal, and process content later Internal filters make decisions on message content External software - routers used to pass the message to external software - typically either fails the message and generates a bounce, or re-injects into Exim Easy, does not require any extensions to Exim Easy to allow complete per-user configuration Having accepted the message, what to do if it's detected as virus/spam? Drop it silently makes for an unreliable mail system. Not recommended. Tag and/or deliver to a separate destination OK, but means that the recipient still ultimately gets the spam/virus Create a bounce bad practice in the current climate where most senders are faked You will end up collateral spamming innocent third parties adding to the problem! Even if the (faked) sender doesn't exist, you will add load to some innocent party's systems, and your queues will fill up with frozen bounces Typically involves scanning a message multiple times for multiple recipients Method: SMTP-time scanning Scan during the SMTP DATA phase Elegant: if you're not going to accept a message, better to reject outright Reduces collateral spam (major consideration best practice) No more queues filled with bounces Requires enough resources to scan quickly & return back to SMTP session risk of duplicates Stretches strict RFC compliance slightly though shouldn't cause interoperability problems Per-user configuration options limited content scanning only takes place once per message, not per recipient. We focus on SMTP-time scanning.

Software Required Need: Exim :-) Content-scanning patch to Exim glue to pass the mail from Exim to the external software and return a result Scanning software (virus/spam scanners etc.) Should be daemonised if possible for performance Before diving in, consider the policies to be implemented as well as the tools to do it. Content-scanning patches Exiscan Swiss army knife - support for lots of external anti-spam/anti-virus tools including SpamAssassin, Sophos/sophie, Kaspersky, ClamAV, Brightmail, generic command line etc. Also has useful in-built MIME-based tools. Operates in the ACL system. http://duncanthrax.net/exiscan-acl/ SA-Exim single-purpose spam-scanning patch for SpamAssassin. Extensive & detailed functionality though increasingly most can be done with Exiscan. Includes 'greylisting', 'tarpitting' and more. Operates using the local_scan system and separate configuration file. http://marc.merlins.org/linux/exim/sa.html FFPA current status unknown, extension to Exiscan which allows detection of attachments based on their actual file type, not just their file extensions. [No known website at present contact Tony Sheen <tony.sheen@uk.mci.com>] Scanning Software Anti-virus ClamAV Free software; in practice very good. Regular signature updates. Daemonised; includes separate daemon to monitor for signature updates. Some people have reported scalability and stability issues, though many use it successfully. Variation called 'nclamd', supposedly more stable, will probably be merged eventually Sophos Commercial software, with support. Doesn't include a daemon, but free software 'sophie' daemon stable and works well Others Kaspersky, ScannerDaemon etc. Anti-spam SpamAssassin Written in Perl Primarily pattern-matching, but includes some other checks such as DNSBL lookups, Razor etc. Works on a points system each pattern (or rule) matched scores points (positive or negative) The points scores allocated are normally used to flag or reject mails which exceed certain threshold scores (e.g flag at score=5, reject at score=10)

Can be used to modify message content for detected spam, marking it as such and making the original mail an attachment. Works with SA-Exim, not with Exiscan. Includes Bayesian learning and analysis system Now widely used, so good spammers tailor their messages to avoid SA hits => maintaining your own custom rulesets and/or using add ons (many at http://www.rulesemporium.com/ ) is a good idea to maintain effectiveness. Others Spamprobe, bogofilter, CRM114 etc. Not currently supported directly by any Exim patches mentioned Exiscan Source code patch to Exim, maintained by Tom Kistner, normally released together with or shortly after Exim releases. Due to popularity, many Exim binary distributions/packages are pre-patched with Exiscan Elegant integration. Hooks into the Exim ACL system Provides several additions: New options in DATA ACL to call external scanning software Inbuilt MIME decoder MIME checking to detect serious MIME errors (often indicative of malware) File extension matching (e.g. to block all.pif files) Regular expression matching of decoded or raw MIME parts New ACL: acl_smtp_mime called once per MIME part Some brief Exiscan examples Too many possibilities to cover everything Comprehensive documentation & examples on Exiscan site Reject spam deny message = This message was classed as spam condition = ${if <{$message_size}{80k}{1}{0}} spam = nobody Reject viruses deny message = Message contains a virus ($malware_name) malware = * MIME checking deny message = Serious MIME defect detected ($demime_reason) demime = * condition = ${if >{$demime_errorlevel}{2}{1}{0}}

Other considerations The MX problem Consider whether you really need multiple MXes If you have more than one server, all need identical protection, to: Avoid spam 'backdoors' Avoid collateral spam The multiple-recipient problem Affects scenarios where not all users have the same scanning preferences No easy way round it due to limitations of SMTP, but reasonable workarounds available If you have to offer options, try to keep the choices simple. Even if one size doesn't fit all, maybe two sizes do? Consider SMTP defers (multiple-scan-profile method) http://www.exim.org/pipermail/exim-users/week-of-mon-20031006/061151.html A common usage scenario: Exim as a transparent front end Drop in front of existing mail system Route messages to the real MX using a manualroute router Conclusions Content scanning is a useful tool as part of a wider policy framework Needs responsible planning and implementation to avoid amplifying the problem or moving the burden to someone else The Exiscan patch is widely used, stable and powerful, allows scanning at SMTP time for: Anti-virus Anti-spam File extension blocking Regular expression blocking With so many easy, powerful and free solutions, at the very least some basic content scanning (e.g. file extension blocking) is highly recommended and can be achieved with modest resources. This summary, detailed notes from this talk, and Content Scanning HOWTO available at: http://www.timj.co.uk/computing/software/exim/