Cisco Email Security Deep Dive & Best Practices

Nicole Wajer, Consulting System Engineer Usman Din, Product Manager Email Security TECSEC-2345 Introductions Usman Din

• Joined Cisco through IronPort acquisition in 2007. • Global Lead for the Email Security Advisory Group • Cisco Live Speaker in US, LATAM and EU, Distinguished Speaker, Cisco Live Berlin (2016) • Now part of the Product Management team for Email Security • Based out of Toronto, Canada Nicole Wajer • Consulting Systems Engineer • EMEAR (North) • Joined Cisco Dec 2007 • Now Content Security & IPv6 • Distinguished Speaker

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 3 Agenda

• Terminology and understanding the Email Pipeline

• Configuration and Best Practices for Anti-Spam Tuning

• Configuration and Best Practices for Spoofing and detection

• Attachment Control and Defense • Summary The Email Pipeline The Email Pipeline

SMTP SERVER WORKQUEUE SMTP CLIENT

Host Access Table (HAT) LDAP RCPT Accept (WQ) Encryption

Received Header Masquerading (Table / LDAP) Virtual Gateways

Default Domain LDAP Routing Delivery Limits

Domain Map Message Filters Received: Header

Recipient Access Table (RAT) Anti-Spam Domain-Based Limits

Alias Table Anti-Virus Domain-Based Routing

LDAP RCPT Accept Advanced Malware (AMP) Global Unsubscribe

SMTP Call-Ahead Graymail, Safe Unsubscribe S/MIME Encryption Policy Scanning Scanning Policy

DKIM / SPF Verification - Content Filtering DKIM Signing Per DMARC Verification Outbreak Filtering Bounce Profiles

S/MIME Verification DLP Filtering (Outbound) Message Delivery

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 6 Anti-Spam Tuning : HAT, Mail Flow Policies and Workqueue settings A note about Best Practices…

• Throughout the material we will present options for tuning your environment • These are meant to be general guidelines, and as each environment is unique, it is recommended that settings be set in monitor mode first • After a determined time, perform analysis and tuning of rules and settings to achieve the desired result

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 8 Host Access Table Structure

• HATs are associated per listener, defined as being Public or Private. Once a listener is defined they cannot be changed.

• IPs and Hosts are evaluated in the HAT Top Down, First Match

• SenderGroups are containers that define the policy based on match

• Inclusion into a SenderGroup is defined by Reputation Score, DNS, or explicit match

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 9 SenderGroup Options

• SenderBase score can be attached to the SenderGroups, ensure that the neutral and no score ranges are addressed

• Within the settings you define the Name, Mail Flow Policy

• Nomenclature is important as it will be displayed in logs and reports

• SBRS scores can be assigned to the group

• RBLs can be leveraged if required.

Thu Jun 9 13:40:34 2016 Info: New SMTP ICID 8 interface Management (10.10.10.90) address 94.46.249.12 Thu Jun 9 13:40:34 2016 Info: ICID 8 ACCEPT SG SUSPECTLIST match sbrs[-3.0:-1.0] SBRS -2.1 Thu Jun 9 13:40:34 2016 Info: Start MID 410 ICID 8

Note that SBRS uses multiple sources including honeypots and DNSBLs

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 10 SenderGroup Options

• Connecting host PTR record does not exist in DNS.

• Connecting host PTR record lookup fails due to temporary DNS failure.

• Connecting host reverse DNS lookup (PTR) does not match the forward DNS lookup (A).

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 11 Understanding Email Reputation

Complaint IP Blacklists Geo-Location Spam Traps • Breadth and quality of Reports and Whitelists data data makes the difference

Message Website Compromised • Real-time insight into Composition Composition Host Data Host Lists this data that allows us Data Data to see threats before anyone else in the Domain industry to protect our Global Volume Blacklist and Other Data DNS Data customers Data Safelists

IP Reputation Score

-10 0 +10

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 12 Why is Telemetry important

• Provides Talos insight on targeted attacks

• Hidden CLI command to give more details to Talos - "fullsenderbaseconfig"

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public What is sent to Talos?

Item Sample Data Message count at various stages within the appliance Seen by Anti-Virus engine: 100 • When enabled, the Context Seen by Anti-Spam engine: 80 Sum of Anti-Spam and Anti-Virus scores and verdicts 2,000 (sum of anti-spam scores for all messages seen) Adaptive Scanning Engine Number of messages hitting different Anti-Spam and Anti-Virus rule 100 messages hit rules A and B combinations 50 messages hit rule A only (CASE) is used to collect and Number of Connections 20 SMTP Connections Number of Total and Invalid Recipients 50 total recipients 10 invalid recipients report the data (regardless of Hashed Filename(s): (a) A file .pif was found inside an archive attachment called .zip. whether or not Cisco anti-spam Obfuscated Filename(s): (b) A file aaaaaaa0.aaa.pif was found inside a file aaaaaaa.zip. URL Hostname (c) There was a link found inside a message to www.domain.com scanning is enabled) Obfuscated URL Path (d) There was a link found inside a message to hostname www.domain.com, and had path aaa000aa/aa00aaa. Number of Messages by Spam and Virus Scanning Results 10 Spam Positive 10 Spam Negative 5 Spam Suspect • The data is summarized 4 Virus Positive 16 Virus Negative 5 Virus Unscannable information on message attributes Number of messages by different Anti-Spam and Anti-Virus verdicts 500 spam, 300 ham and information on how different Count of Messages in Size Ranges 125 in 30K-35K range Count of different extension types 300 “.exe” attachments Correlation of attachment types, true file type, and container type 100 attachments that have a “.doc” extension but are actually “.exe” types of messages were handled 50 attachments are “.exe” extensions within a zip Correlation of extension and true file type with attachment size 30 attachments were “.exe” within the 50-55K range by Cisco appliances. We do not Number of attached files uploaded to the file reputation service (AMP 1110 files were uploaded to the file reputation service cloud) Verdicts on files uploaded to the file reputation service (AMP cloud) 10 files were found to be malicious collect the full body of the 100 files were found to be clean 1000 files were unknown to the reputation service Reputation score of files uploaded to the file reputation service (AMP 50 files had a reputation score of 37 message cloud) 50 files had a reputation score of 57 1 file had a reputation score of 61 9 files had a reputation score of 99 Names of files uploaded to the file reputation service (AMP cloud) example.pdf testfile.doc Names of malware threats detected by the file reputation service (AMP Trojan-Test cloud)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 14 Customizing Reputation on the ESA

Default Settings: Moderate Blocking

• Reputation Score determined when connection initiated Custom Settings: Aggressive Throttling • Sender Groups and actions are defined by the administrator • Reputation can block 80-90% connections on the ESA

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 15 OK, that's nice. How do I figure out what to set?

• Before tuning, it is recommended to use the default (moderate) settings to understand the mail flow for your environment.

• Objective of tuning is to block or throttle more messages at the connection level, saving resources for processing legitimate mail.

• The first step is to create content filters to flag messages that are being passed through the default reputation filters with the SBRS and any scanning verdict info

• Evaluate reporting of Content Filters and adjust HAT settings are required

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 16 Reputation: DNS and caching

• DNS is the most critical external service for the ESA

• By default there are 4 DNS lookups per connection: Reverse DNS, 2 SBRS lookups and ASN Number (informational)

• With SPF, DKIM and DMARC – 3 or more DNS TXT record lookups

• At least 7 possible DNS lookups per connection (excluding any caching)

• Now factor in outbound destination DNS resolution, LDAP, internal hosts, etc.

• More resolvers in high connection environments

• Look into logs for “SBRS Not Available” to identify possible issues with DNS timeouts

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 17 Reputation: Delayed HAT Rejection

• Delayed HAT Rejection allows for additional logs for Reputation based blocks

• 2 additional log lines are added to each connection with details of from and to addresses

esa.teamnorthwind.com> listenerconfig

Currently configured listeners:

1. SMTP-AGRESSIVE (on Management, 10.10.10.20) SMTP TCP Port 25 Public

[]> setup

By default connections with a HAT REJECT policy will be closed with a banner message at the start of the SMTP conversation. Would you like to do the rejection at the

message recipient level instead for more detailed logging of rejected mail? [Y]>

http://www.cisco.com/c/en/us/support/docs/security/email-security-appliance/117960-qa-esa-00.html

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 18 Understanding Connections

• Global limits: Total IPv4 and IPv6 entire appliance, maximum should not exceed 400 concurrent connections (default is 300)

• Per listener limits: Each listener on the appliance should be configured to match your maximum global limit

• Mail Flow Policy limits: Per policy limits are used to rate limit senders, use concurrent connections in conjunction with host and sender rate limits

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 19 Understanding Connections

• Limit guidance per model – Model type makes no difference in the number of connections per appliance. Connection limits are based on OS, throughputs between appliances do vary

• In environments that require high number of concurrent connections, recommendation is to increase the number of appliances

Enter the global limit for concurrent connections to be allowed across all listeners.

[300]>

Listener SMTP-POV Policy $RELAYED max concurrency value of 600 will be limited to 300 by this concurrency setting.

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 20 MailFlow policies: Host vs Sender Throttling

• By default the only MFP that has any Host limiting is the throttle policy

• By default, there are no Envelope Sender Limits set on the ESA

• It is recommended to use Sender Limits in suspect ranges

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 21 MailFlow policies: Security Settings

• DHAP is set high on the ESA, recommend to tune it to be lower on suspect ranges

• LDAP enhances DHAP by performing rejection in conservation

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 22 MailFlow policies: Security Settings

• TLS Settings are not by default for incoming or outgoing mail

• Three levels of checking, preferred can be set on the default mail flow policy

• Mandatory can be setup as a list or as it’s own SenderGroup

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 23 Per Policy Scanning

• Per domain policies take place after message filtering and LDAP rewrites

• Triggering Inbound and Outbound policies via Mail Flow policies

• A message is determined to be outbound because of relay mail flow policies (think of the HAT)

• SMTP authentication also triggers outbound regardless of accept policy set.

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 24 Policy Engine And Splintering

• If a single message matches multiple policies, it will be splintered

• Splintering only occurs if multiple policies are matched

MAIL FROM: [email protected] MAIL FROM: [email protected] RCPT TO: [email protected] RCPT TO: [email protected] WORKQUEUE SMTP CLIENT Anti-Spam MAIL FROM: [email protected] Encryption RCPT TO: [email protected] Anti-Virus Virtual Gateways MAIL FROM: [email protected] RCPT TO: [email protected] Advanced Malware (AMP) Delivery Limits RCPT TO: [email protected] RCPT TO: [email protected] Graymail, Safe Unsubscribe Received: Header Domain-Based Limits Content Filtering Scanning Policy

WORKQUEUE -

Per Domain-Based Routing SMTP SERVER Outbreak Filtering … LDAP RCPT Accept (WQ) DLP Filtering (Outbound) Host Access Table (HAT) Masquerading (Table / LDAP) MAIL FROM: [email protected] MAIL FROM: [email protected] Recipient Access Table (RAT) RCPT TO: [email protected] RCPT TO: [email protected] WORKQUEUE LDAP Routing SMTP CLIENT … Anti-Spam Encryption Message Filters Anti-Virus Virtual Gateways Advanced Malware (AMP) Delivery Limits

Graymail, Safe Unsubscribe Received: Header Domain-Based Limits

Content Filtering Scanning Policy -

Per Domain-Based Routing Outbreak Filtering … DLP Filtering (Outbound)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 25 Per Policy Scanning

• Use policies to leverage message splintering to apply rule and scanning as required

• Top down / first match wins, order is very important

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 26 Policy Match Conditions

• Complex conditions inside a policy using AND/OR/NOT

• Multiple conditions can be used inside the same policy

• Move your logic from the filter into the policy and reduce resource consumption

• After upgrading to 10.0 , when you match a message to a mail policy, the envelope sender and the envelope recipient have a higher priority over the sender header.

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 27 Using Policies vs Dictionaries

• Customer often use Dictionaries to match senders / recipients for Blacklists / Whitelists

• By applying a block via content filter + dictionary causes all messages to be scanned, thus using more resources

• Using Policies to splinter and apply actions quickly

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 28 Understanding CASE

• CASE stands for Context Adaptive Scanning Engine

• CASE is the combination of the Anti-Spam, Graymail and Outbreak engines

• Each engine can provide a verdict and depending on the action of the engine will either pass or drop the message

• A non-final action (i.e Quarantine) will allow a message to continue to process down the workqueue. A final action such as drop will cause an “early exit” condition

• Other scanning blades may take precedence if another engine determines a positive condition

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 29 Adjusting Thresholds

• You can adjust the thresholds for Suspect / Positive spam to increase or decrease sensitivity

• Don’t do it, unless you really have to

• As we tune spam rules, we use the default thresholds as a baseline, so this may result in undesired results

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 30 Enable Graymail Scanning

• Graymail has 2 components: Detection and Unsubscribe

• Detection is . It comes as part of the base email subscription license

• The graymail engine will provide verdicts to IPAS (final decision), which leads to a better overall email efficacy

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 31 Enabling Outbreak Filters

• By default, only Virus Outbreak is enabled • Enabling Threat Outbreak (Message Modification) you get additional intelligence being fed into CASE • In order to use URL functionality (covered later) Outbreak Filters must be turned on and configured

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 32 Upgrade, Enable, and Tune!

Enable Antispam – and if possible (based on hardware) increase scanning 1 thresholds to 1M for always scan, 2M for never to scan more

Enable Graymail – it’s a free engine 2 which helps with Anti-Spam efficacy. Introduced in 9.5 so upgrade!

Enable Outbreak Filters – and if possible (based on hardware) increase scan size 3 to 1M

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 33 Anti-Spam Tuning Checklist

 Assess your Host Access Table – still  Use the new granular policies to create using the defaults? Time to adjust the better Incoming Mail Policies scores  Move the logic from the filter to the policy  Create more SenderGroups and get to create more efficient settings gradually more aggressive in your settings  Turn on Graymail, Threat Outbreak Filtering to get more insight and better  Check you WhiteLists - entries could be efficacy years old, ip changed, etc. Use the comments to keep track and prune  Check your file size limits: Defaults are regularly low and could potentially allow threat messages through  Check you Mail Flow Policies and turn on Sender limits, Sender Verification,  Upgrade, Upgrade, Upgrade! etc.

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 34 Anti-Phishing : Content Filters and Outbreak Filtering Understanding where URLs are evaluated

• As of version 8.5.6 the ESA can evaluate URLs inside a WORKQUEUE

message – both for Reputation and Categorization LDAP RCPT Accept (WQ)

• URL filtering is not enabled by default, you must enable the Masquerading (Table / LDAP)

service and have a valid Outbreak Filter license to perform URL LDAP Routing inspection Message Filters • Once enabled, URLs are evaluated in three scanning blades: Anti-Spam 1. During IPAS Scan, a URL is used to factor into SPAM scores 2. Inside a Content Filter for Reputation Score and Category Anti-Virus

3. As part of the Threat Outbreak Filter URL Rewrite function Advanced Malware (AMP)

Graymail, Safe Unsubscribe

• 9.7 introduced Web Interaction Tracking for Clicked URLs, Policy Scanning Scanning Policy

which must be enabled after upgrade - Content Filtering Per Outbreak Filtering

DLP Filtering (Outbound)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 36 URL Evaluation and options

• Enable URL Filtering globally under security settings:

• The Web Reputation Score (WBRS) uses the same -10 to +10 score, however it means something very different than SBRS -10 -6 0 +6 +10

Malicious Neutral Good • Based on you organizations security posture you can determine how aggressive you wish to be with URL entering your organization

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 37 URL Evaluation and options

• URL Reputation is assessed inside of the CASE engine and used as part of the decision for Anti-Spam

• If not stopped as Spam the URL can be evaluated inside a content filter for both Category and Reputation

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 38 URL Evaluation and options

Recommendations:

• Block URL: -10 to -6

• URL Remove: -5.9 to -5.8

• Leave the rest for Outbreak Filters

• Use in condition when you want to take an action on the whole message

• Use in action to act on URL only

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 39 URL Categorization

• URL Categorization on the ESA leverages the same data as the Web Security Appliance (WSA) and Cloud Web Security (CWS)

• Use this to compliment Acceptable Use Policies to prevent inappropriate URLs in email

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 40 URL Logging & Tracking

• Logging of URLs can be seen in the mail logs and only if the outbreakconfig command is run

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 41 URL Evaluation and options

• With the 10.0 release, URL information can be shown in message tracking if enabled by role

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 42 Graymail Unsubscribe

• Graymail Unsubscribe is an additional license

• It provides protection against malicious threats masquerading as unsubscribe links

• A uniform interface for all subscription management to end-users

• Better visibility to the email administrators and end-users into such emails

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 43 Graymail Unsubscribe

Click-time check of the End-user clicks on the Cisco executes un- rewritten link. If found safe rewritten un-subscription subscription on behalf of the redirect to Un-Subscribe link in the banner end-user service

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 44 Web Interaction Tracking & Reporting

• On box reporting (batch) can provide valuable insight into who clicked on certain URLs

• More valuable as a training tool and understanding who is being targeted inside your environment

• Reporting and Tracking pages will show the URLs (Tracking in 10.0 for URL details)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 45 Phishing is not just URLs

• Other scams such as Banking, Money Mules, Dating, 419, etc are also used to get information from targets

• Blended threats combine spoofing and phishing in an attempt to look more legitimate to the target

• Threat Outbreak Filters must be enabled in order to help detect and stop these threats

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 46 Threat Outbreak Filters

• Enable Threat Outbreak Filters (not enabled by default) by enabling Message Modification

• URL Rewriting allows for suspicious urls to be analyzed by Cisco Cloud Web Security (Reputation, AV/AM, AMP)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 47 Anti-Spoofing: HAT, Filters and Forged Email Detection Anti-Spoofing Overview

Simple Spoof Simple spoof is where the attacker attempts to change or manipulate the envelope from in the headers of an email. This spoof is relatively easy to detect using SPF or DMARC as well as other header validation checks

Reply-To Spoof Reply-To spoof is where the sending address does not match the reply-to address. This is a low spoof indicator and can lead to high false positives.

Cousin Domain / Typo Squatting Attacks become more sophisticated by relaying on minor changes to the suffix and / or prefix of the email addresses to trick users. High probability of success and hard to detect due to large number of variations

Display Name Modification Also called Business Email Compromise (BEC) is the most complex attack involves the use of legitimate domains (either hijacked or created) with the manipulating message headers to show an accurate Display Name and a Cousin domain/typo in the email address to trick targets into releasing information. This is the most common attack today with a high success rate.

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 49 Impact of Social Engineering

• Social Engineering has added to the success rate for spoofing attacks. Attackers will follow targets for months, on social media, news, etc.

• Will craft messages with “history” to add legitimacy to the request being made

• They will look for an event – i.e travel abroad, large deals, vendor agreements and use it to express urgency

• Along with technical controls, user education is key to prevent financial lost, brand damage, or legal ramifications.

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 50 MailFlow policies: DKIM/SPF/DMARC

• During connection, the HAT can be configured to validate SPF, DKIM and DMARC records

• No checks are enabled by default in the Mail Flow Policies

• DMARC has the ability to stop / block mail via policy settings, SPF and DKIM mark headers for further action via Content Filters or Message Filters

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 51 SPF,DKIM and DMARC Header Logging

Thu Jan 26 06:08:34 2017 Info: New SMTP ICID 21779 interface Data 1 (216.71.132.15) address 50.58.115.68 reverse dns host mail.palmbeachletter.com verified yes Thu Jan 26 06:08:34 2017 Info: ICID 21779 ACCEPT SG UNKNOWNLIST match sbrs[-1.0:10.0] SBRS 4.1 Thu Jan 26 06:08:34 2017 Info: ICID 21779 TLS success protocol TLSv1 cipher DHE-RSA-AES256-SHA Thu Jan 26 06:08:34 2017 Info: Start MID 2744 ICID 21779 Thu Jan 26 06:08:34 2017 Info: MID 2744 ICID 21779 From: bounces-mcpaid-6-8d6-238c-9f4-9b501- [email protected] Thu Jan 26 06:08:34 2017 Info: MID 2744 ICID 21779 SMTP Call-Ahead bypass applied to [email protected] Thu Jan 26 06:08:34 2017 Info: MID 2744 ICID 21779 RID 0 To: [email protected] Thu Jan 26 06:08:34 2017 Info: MID 2744 SPF: helo identity [email protected] Pass (v=spf1) Thu Jan 26 06:08:34 2017 Info: MID 2744 SPF: mailfrom identity bounces-mcpaid-6-8d6-238c-9f4-9b501- [email protected] Pass (v=spf1) Thu Jan 26 06:08:34 2017 Info: MID 2744 SPF: pra identity [email protected] None headers from Thu Jan 26 06:08:34 2017 Info: MID 2744 DKIM: pass signature verified (d=palmbeachgroup.com s=mgsys- 201410-1024-9art43rd [email protected]) Thu Jan 26 06:08:35 2017 Info: MID 2744 DMARC: Message from domain palmbeachgroup.com, DMARC pass (SPF aligned True, DKIM aligned False) Thu Jan 26 06:08:35 2017 Info: MID 2744 DMARC: Verification passed

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 52 How it works: SPF

• Sender Policy Framework, specified in RFC4408

• Allows recipients to verify sender IP addresses by looking up DNS records listing authorized Mail Gateways for a particular domain

• Uses DNS TXT Resource Records

• Can verify HELO/EHLO and MAIL FROM identity (FQDN)

• Upon evaluation of SPF records, the following can these results: Result Explanation Intended action Pass The SPF record designates the host to be allowed to send accept Fail The SPF record has designated the host as NOT being allowed to send reject SoftFail The SPF record has designated the host as NOT being allowed to send but is in transition accept but mark Neutral The SPF record specifies explicitly that nothing can be said about validity accept None The domain does not have an SPF record or the SPF record does not evaluate to a result accept PermError A permanent error has occurred (eg. badly formatted SPF record) unspecified TempError A transient error has occurred accept or reject

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 53 Taking action on SPF

• When SPF is enabled, the ESA will stamp headers in the message

• Use the results inside message or content filters to determine the action

• PRA identities are evaluated in the message filters only

• SPF vs SIDF, an interesting read: http://www.openspf.org/SPF_vs_Sender_ID

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 56 How it works: DKIM

• Domain Keys Identified Mail, Specified in RFC5585 • Additional RFCRFC6376 (DKIM Signatures), RFC5863 (DKIM Development, Deployment and Operation), RFC5617 (Author Domain Signing Practices (ADSP))

• In a nutshell: Specifies methods for gateway-based cryptographic signing of outgoing messages, embedding verification data in an e-mail header, and ways for recipients to verify integrity of the messages

• Uses DNS TXT records to publish public keys

20120113._domainkey.gmail.com IN TXT “k=rsa\; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1Kd87/UeJjenpabg bFwh+eBCsSTrqmwIYYvywlbhbqoo2DymndFkbjOVIPIldNs/m40KF+yzMn1skyoxcTUGCQs8g3FgD2Ap3ZB5DekAo5wMmk4wimDO+U8QzI3SD 0""7y2+07wlNWwIt8svnxgdxGkVbbhzY8i+RQ9DpSVpPbF7ykQxtKXkv/ahW3KjViiAH+ghvvIhkx4xYSIc9oSwVmAl5OctMEeWUwg8Istjqz 8BZeTWbf41fbNhte7Y+YqZOwq1Sd0DbvYAD9NOZK9vlfuac0598HY+vtSBczUiKERHv1yRbcaQtZFh5wtiRrN04BLUTD21MycBX5jYchHjPY/ wIDAQAB”

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 57 DKIM on the ESA

• DKIM Settings in the HAT can be set to verify signatures • Use a content filter to enforce policy based on DKIM auth result • Use an action to Policy quarantine to be able to review spoofs

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 58 How it works: DMARC

• Both DKIM and SPF have shortcomings, not because of bad design, but because of different nature of each technology

• Thus, DMARC was born: • Leveraging great existing technologies, providing a glue to keep them in sync, and allowing senders to mandate rejection policies and have visibility of offending traffic

• Domain-based Message Authentication, Reporting And Conformance • Defined in RFC 7489 • Provides: • DKIM verification • SPF authentication • Synchronization between the two and all sender identities (Envelope From, Header From) • Reporting back to the spoofed entity

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 59 How it works: DMARC Record Structure

TXT Record for Domain amazon.com Version of DMARC Action on Auth Failure % of messages to apply policy

_dmarc.amazon.com IN TXT “v=DMARC1\; p=quarantine\; pct=100\; rua=mailto:[email protected]\; ruf=mailto:dmarc- [email protected]

Aggregate Feedback report URI Forensic Feedback report URI

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 61 How to enable DMARC (inbound)

• DMARC is configured via by creating a profile and then applying the profile to a Mail Flow Policy

• By default the profile is set to Monitor for DMARC violations, however it needs to be applied to a policy for it to evaluate DMARC records

• Monitor and Tune settings and SenderGroups and move to blocking when ready

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 62 DMARC Policy

• Policies requested by senders: • None • Quarantine • Reject

• Receivers MAY deviate from requested policies, but SHOULD inform the sender why (through Aggregate Report) • Sampling rate (“p” tag) instructs the receiver to only apply policy to a fraction of messages

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 63 Allowed Spoofing & Sender Verification Table

• Before you begin to block any messages, determine who is allowed to spoof; external marketing firms, vendors, SaaS tools and notifications

• Use a filter to mark and track addresses that match your domains or copy messages into a quarantine for review

• In your HAT create a SPOOF_ALLOW (or similar) to add the host addresses for vendors that are allowed. Use the SPOOF_ALLOW as part of the filter to ensure that those messages are not flagged or stopped

• The Sender Verification Table is enabled within the Mail Flow Policy and can be used to evaluate the mail from is exists and resolvable

• Use the SVT table to set your domains to block and apply to the policies

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 64 Filtering & Quarantine Spoofs

quarantine_spoof_copy: if sendergroup != "RELAYLIST" AND ( mail-from-dictionary-match("No_Spoof_Domains", 1) OR header-dictionary-match("No_Spoof_Domains","From", 1) OR header-dictionary-match("Execs","From", 1)) { duplicate-quarantine("All_Spoofs"); notify-copy (“[email protected]");}

• Above is an example of a message filter that will look to see if the IP is not in the RELAYLIST and is trying to send a message that matches a dictionary of names in the dictionary

• It will duplicate the message and place in quarantine for review

• Modify to include SPOOF_ALLOW list and domains in the From header http://www.cisco.com/c/en/us/products/collateral/security/email-security-appliance/whitepaper_C11-737596.html

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 69 Detecting Reply-To Mismatch

Reply-To Header

From Header

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 70 Forged Email Detection (New for 10.0)

• Forged Header Detection will look for permutations in the Display Name and the prefix of the email address in the From Header

• Use this rule to look for matches against a dictionary of names that are exact or some form of typo squatting

• i.e: Han S0lo, Han Slo, Han So1o

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 71 Forged Email Filters

• In this example, we took the from header and stripped it from the message if the match was 70 or above

• Combined with a warning disclaimer this would expose the bad sender while warning the end user

• Idea here is that for names that are low threshold matches, you can use the strip header to expose envelope sender – if it is legitimate, it won’t disrupt mail flow

• If all else fails, warn the user of a potential issue by using a disclaimer text on top of the message

Info: MID 2089 Forged Email Detection on the From: header with score of 100, against the dictionary entry Han Solo

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 72 Phish & Spoofing Checklist

 Enable URL Filtering on the ESA  Make a plan to enable SPF, DKIM and DMARC  Enable Web Interaction Tracking (if permitted by policy)  Know who your allowed external spoofs are by tracking them via filters and policies  Enable certain admin users URL visibility in Message Tracking if permitted by policy)  Build the list as the exception, trap all others

 Enable Threat Outbreak Filtering and message  With 10.0 use the Forged Email Detection modification – warn your users! Feature to look for matches on the display name, if too close to call, drop the From  Whitelist your partner URLS, use the scores to header create filter for others  Send a copy of suspected spoofs to a  Combine the reputation rules and leverage quarantine for review and then tune your language detection as part of the logic rules to start blocking messages

 Use the policies to define the level of aggression for rule sets

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 73 Attachment Handling Block the unwanted file types

• Within either a content or message filter an organization can define how to handle attachments on a per policy basis.

• Commonly customers will create a content filter to block unwanted file types

• Using the predefined libraries simplifies the process

• The system will detect changed extensions or attempts to hide files within multiple zip levels in order to evade file blocking

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 75 Blocking early in the pipeline

• If files are being outright dropped (i.e Executables) then doing WORKQUEUE

it earlier in the pipeline would save on AV, AMP and OF cycles LDAP RCPT Accept (WQ)

strip_all_exes: if (true) { Masquerading (Table / LDAP) drop-attachments-by-filetype ('Executable', “Removed attachment: $dropped_filename”);} LDAP Routing

Message Filters • A non-final action such as quarantine will allow the file to continue processing the file and any other verdict will apply Anti-Spam Anti-Virus

Advanced Malware (AMP)

Graymail, Safe Unsubscribe Policy Scanning Scanning Policy

- Content Filtering Per Outbreak Filtering

DLP Filtering (Outbound)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 76 Macro Detection (Version 10.0.1)

Macro enabled document detection allows the Email Administrator set Content Filter policies around email attachments containing macros and take the actions of:

• Quarantine the message

• Strip the attachment

• Strip the attachment and add notification text to the message body

• Modify the subject

• Add header

• Forward to another address

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 77 Block known viruses

• Sophos comes bundled with the licenses, enable and block known viruses

• Encrypted => Password Protected, Signed

• Unscannable => Too large to scan, malformed

• Do you still repair? Most customers today do not have the repair option enabled for virus infected messages.

• 10.0.1 introduces new Sophos CxMail engine

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 78 Enable Virus Outbreak Filters

• VOF is enabled by default

• Provides a significant catch rate for outbreaks over traditional scanning engines

• It’s the human element, after signature, heuristics and hash based scanning

http://www.senderbase.org/static/malware/#tab=0

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 79 How AMP works

File Reputation Query AMP Connector AMP Cloud Retrospective Heartbeat Local Cache SBRS Disposition Query CASE Update the Cache with AV Pre-Classification disposition value AMP feedback loop only for Malicious Files Sandbox connector Qualified File, upload for Sandboxing

Local AV Scanners

Cisco TG Sandboxing

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 80 Enabling AMP

• AMP is an additional license on the ESA and CES

• 4 components to AMP: • File Reputation • File Analysis • File Retrospection • Mailbox Auto Remediation (New)

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 81 AMP Configuration – Check your file types!

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 82 AMP Quarantine

• Use the quarantine to delay files and wait for analysis results • Typically file results are returned in under 10 minutes, default setting is to wait up to 1 hr before releasing

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 83 AMP Retrospection Alerts

2 styles of alerts now generated by AMP for retrospective events: Change in disposition, message not delivered Change in disposition and message delivered

The Info message is: The Info message is:

Retrospective verdict received. Retrospective verdict received for NEW SAMPLE ORDER 1.doc.

SHA256: 7c48eb3b1fea5705fc70539f2a0539a3be794d6b70408a31c9ea461855657cd0 SHA256: ce49d65659304dcb7ae63182e17aa4b6f09740caaf77f1565a682bd2bb4e2bf4 Timestamp: 2016-09-19T19:39:13Z Verdict: MALICIOUS Timestamp: 2016-09-19T19:39:12Z Reputation Score: 0 Verdict: MALICIOUS Spyname: W32.Auto:7c48eb3b1f.in05.Talos Reputation Score: 0 Spyname: RTF.CE49D65659.agent.tht.Talos

Total users affected: 1 ------Affected Messages ------Version: 10.0.0-124 Serial Number: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Timestamp: 19 Sep 2016 14:39:13 -0500 Message 1 MID : 20045 Subject : Sample Pictures and Letter of Intent as shown on attached files (3) Users affected section provides details as to From : [email protected] Bcc : [email protected] who the potentially infected users are as well File name : NEW SAMPLE ORDER 1.doc Parent SHA256 : , as message details making it easier to track Parent File name : , down Date : 2016-09-19T05:35:48Z ------

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 84 Mailbox Auto Remediation

• API integration with Office 365 / Azure for Malware Remediation

• When a retrospective alert is received, the ESA can remove the email from the mailbox automatically

TALOS 3 ! 1 CES Original message delivered with non-malicious verdict

2 2 Retrospective alert of file that is now deemed malicious received by CES

3 API call to O365 to remove message from the mailbox, or forward to 1 O365 specific mailbox

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 85 File Handling Checklist

 Create a filter to block, quarantine or  Evaluate AMP is you don’t have it strip attachment that are deemed risky already for the organization  AMP will hash all files and ask for file  Use AV to block the known viruses. reputation Cleaning / Repairing viruses from files may be something you want to turn off  Set the File Analysis Pending action to Quarantine to hold the message until a  Ensure Virus Outbreak is turned on all verdict is available your policies, it provides an average 10+ hr lead time on 0-day attacks  Macro inspection is performed by File Analysis on AMP along with other file  Upgrade to 10.0.1 and use the Macro types Filter to detect and take an action on unwanted files  Remediation is now available with Office 365 with the Azure API

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 86 In Summary

• The days of set it and forget it are long gone – continuous monitoring and tuning are required to keep up with todays threats

• Understand what your organizations security posture is and apply it to your appliances

• Keep your appliances updated – we are constantly introducing new features that require upgrades / updates

• Check out our Chalktalks on Youtube and Guides on Cisco.com to help with tuning and setup new features on Cisco Email Security

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 87 Summary of Recommendations Security Services CLI Level Changes  IronPort Anti-Spam  Web Security SDS URL Filtering  Always scan 1MB and Never scan 2MB  websecurityadvancedconfig >  URL Filtering  disable_dns=1 , max_urls_to_scan=20 , num_handles=5 , default_ttl=600  Enable URL Categorization and Reputation  URL Logging  Enable Web Interaction Tracking  outbreakconfig> Do you wish to enable logging of URL's? [N]> y  Graymail Detection  http://www.cisco.com/c/en/us/support/docs/security/email-security- appliance/118775-technote-esa-00.html  Enable and Maximum Messages size 1 MB  Clean URL Rewrites  Outbreak Filters  websecurityadvancedconfig > Do you want to rewrite all URLs with secure proxy  Enable Adaptive Rules, Max Scan size1 MB URLs? [Y]> n  Enable Web Interaction Tracking  Anti-Spoof Filter  Advanced Malware Protection  https://supportforums.cisco.com/sites/default/files/attachments/discussion/forged  Enable additional file types after enabling feature _email_detection_with_cisco_email_security.pdf  Message Tracking  Header Stamping Filter  Enable Rejected Connection Logging (if required) addHeaders: if (sendergroup != "RELAYLIST") { System Administration insert-header("X-IronPort-RemoteIP", "$RemoteIP"); insert-header("X-IronPort-MID", "$MID");  Users insert-header("X-IronPort-Reputation", "$Reputation");  Set password policies insert-header("X-IronPort-Listener", "$RecvListener");  If possible leverage LDAP for authentication insert-header("X-IronPort-SenderGroup", "$Group");  Log Subscriptions insert-header("X-IronPort-MailFlowPolicy", "$Policy"); }  Enable Configuration History Logs  Enable URL Filtering Logs  Log Additional Header ‘From’

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 88 Summary of Recommendations Host Access Table Incoming Mail Policies  Additional SenderGroups  Anti-Spam thresholds  SKIP_SBRS – Place higher for sources that skip reputation  Positive = 90, Suspect = 39  SPOOF_ALLOW – Part of Spoofing Filter  Anti-Virus  PARTNER – For TLS Forced connections  Don't repair, Disable Archive Message  In SUSPECTLIST  AMP  Include SBRS Scores on None  Add "AMP" to Subject Prepend for Unscannable, Disable Archive Message  Optionally, include failed PTR checks  Graymail  Aggressive HAT Sample  Scanning enabled for each Verdict, Prepend Subject and Deliver  BLACKLIST [-10 to -2] POLICY: BLOCKED  Add x-header for Bulk email header = X-BulkMail, value = True  SUSPECTLIST [-2 to -1] POLICY: HEAVYTHROTTLE  GRAYLIST[-1 to 2 and NONE] POLICY: LIGHTTHROTTLE  Outbreak Filters  ACCEPTLIST [2 to 10] POLICY: ACCEPTED  Enable message modification. Rewrite URL for unsigned message.  Change Subject prepend to: [Possible $threat_category Fraud] Mail Flow Policy (default) Outgoing Mail Policies  Security Settings  Set TLS to preferred  Anti-Virus  Enable SPF  Anti-Virus Virus Infected: Prepend Subject: Outbound Malware Detected:  Enable DKIM $Subject.  Enable DMARC and Send Aggregate Feedback Reports  Other Notification to Others: Order form admin contact  Anti-virus Unscannable don't Prepend the Subject  Uncheck Include an X-header with the AV scanning results in Message

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 89 Summary of Recommendations Policy Quarantines Content Filters  Pre-Create the following Quarantines  Inappropriate Content Filter  Inappropriate Inbound  Conditions Profanity OR Sexual dictionary match, send a copy to the  Inappropriate Outbound Inappropriate quarantine.  URL Malicious Inbound  URL Malicious Reputation Content Filter  URL Malicious Outbound  Send a copy to the URL Malicious (-10 to -6) to quarantine.  Suspect Spoof  URL Category Content Filter with these selected  Malware  Adult, Pornography, Child Abuse, Gambling. Other Settings  Send a copy to the Inappropriate quarantine.  Forged Email Detection  Dictionaries  Dictionary named "Executives_FED"  Enable / Review Profanity and Sexual Terms Dictionary  FED() threshold 90 Quarantine a copy.  Create Forged Email Dictionary with Executive Names  Macro Enabled Documents content filter  Create Dictionary for restricted or other keywords  if one or more attachments contain a Macro  Destination Controls  Optional condition -> From Untrusted SBRS range  Enable TLS for default destination  Send a copy to quarantine  Set lower thresholds for webmail domains http://www.cisco.com/c/en/us/support/docs/security/email-security-  appliance/118573-technote-esa-00.html Attachment Protection  if one or more attachments are protected  Optional condition -> From Untrusted SBRS range  Send a copy to quarantine

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 90 Resources

• ESA ChalkTalks: https://www.youtube.com/playlist?list=PLFT-9JpKjRTANXKBmLbQ611TPYLXbUL_0

• URL Best Practices: http://www.cisco.com/c/en/us/support/docs/security/email-security-appliance/118775-technote-esa- 00.html?referring_site=RE&pos=2&page=http://www.cisco.com/c/en/us/products/collateral/security/ema il-security-appliance/white_paper_c11-684611.html

• Anti-Spam Tuning Guide: http://www.cisco.com/c/en/us/products/collateral/security/email-security-appliance/white-paper-c11- 732910.html

• Other Guides: http://www.cisco.com/c/en/us/products/security/email-security-appliance/white-paper-listing.html

• Knowledge base: http://www.cisco.com/c/en/us/products/security/email-security-appliance/q-and-a-listing.html

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 91 Security Joins the Customer Connection Program Customer User Group Program 19,000+ Members Strong • Who can join: Cisco customers, service providers, solution partners and training partners

• Private online community to connect with peers & Join in World of Solutions Cisco’s Security product teams Security zone  Customer Connection stand • Monthly technical & roadmap briefings via WebEx  Learn about CCP and Join • Opportunities to influence product direction  New member thank-you gift*  Customer Connection Member badge ribbon • Local in-person meet ups starting Fall 2016

• New member thank you gift* & badge ribbon Join Online when you join in the Cisco Security booth www.cisco.com/go/ccp • Other CCP tracks: Collaboration & Enterprise Networks Come to Security zone to get your new member gift* and ribbon

* While supplies last TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 92 Complete Your Online Session Evaluation

• Please complete your Online Session Evaluations after each session • Complete 4 Session Evaluations & the Overall Conference Evaluation (available from Thursday) to receive your Cisco Live T-shirt • All surveys can be completed via the Cisco Live Mobile App or the Don’t forget: Cisco Live sessions will be available Communication Stations for viewing on-demand after the event at CiscoLive.com/Online

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 93 Continue Your Education • Demos in the World of Solutions – Security Area

• Meet the Expert 1:1 meetings • Meet Nicole Wajer / Usman Din • Tweet/Follow @vlinder_nl #CLEUR

• BRKSEC-235 - How to make spam your best friend on your e-mail appliance – Tuesday 11:15

• BRKSEC-3540 - I wonder where that Phish has gone – Tuesday at 16:45

• LTRSEC-2009 - Lab Email Security ESA 10.0

• LALSEC-2005 - Lunch and Learn - Cisco Email Security - Wednesday 22 February 13:00 - 14:30

• BRKSEC-2890 - AMP Threat Grid integrations with Web, Email and Endpoint Security - Thursday 11:30

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public Cisco Spark Ask Questions, Get Answers, Continue the Experience

Use Cisco Spark to communicate with the Speaker and fellow participants after the session

Download the Cisco Spark app from iTunes or Google Play

1. Go to the Cisco Live Berlin 2017 Mobile app 2. Find this session 3. Click the Spark button under Speakers in the session description 4. Enter the room, room name = TECSEC-2345 5. Join the conversation!

The Spark Room will be open for 2 weeks after Cisco Live

TECSEC-2345 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 95 Thank You