Content Security · Topic 3 of 3
Antivirus and Antispam
Learn SRX antivirus and antispam for JNCIA-SEC: Sophos and Avira engines, protocol profiles, fallback options, SBL spam lists and block or tag actions.
- 6 min
- Antivirus engines: Sophos (
sophos-engine, cloud-assisted) and Avira (avira-engine, on-device full scanning); both licensed. - Antivirus profiles are referenced per protocol:
http-profile,ftp upload-profileanddownload-profile,smtp-profile,pop3-profile,imap-profile. - Fallback options handle files that cannot be scanned:
blockorlog-and-permit.
What it is
Antivirus scans files carried in permitted sessions and blocks the ones that contain malware. Antispam checks incoming SMTP email and blocks or tags messages that come from known spam sources.
Both are Content Security features under security utm. Both need a license, both are referenced from a UTM policy, and both act only on traffic that a security policy permits with that UTM policy attached.
How it works
Antivirus engines
| Engine | Keyword | How it scans |
|---|---|---|
| Sophos antivirus | sophos-engine | Lightweight scanning on the SRX, with lookups to the Sophos cloud service for current threat data |
| Avira antivirus | avira-engine | Full file scanning on the SRX, using a signature database downloaded to the device |
The engine is selected under the default configuration.
user@srx# set security utm default-configuration anti-virus type sophos-engine
Both engines need an antivirus license. The cloud-assisted engine needs the SRX to reach the internet for its lookups; the on-device engine needs regular pattern updates.
Antivirus profiles
A profile holds the scanning options and the fallback options. It is then referenced per protocol in the UTM policy.
user@srx# set security utm feature-profile anti-virus profile AV-PROFILE fallback-options default block
user@srx# set security utm utm-policy UTM-OUT anti-virus http-profile AV-PROFILE
user@srx# set security utm utm-policy UTM-OUT anti-virus ftp download-profile AV-PROFILE
user@srx# set security utm utm-policy UTM-OUT anti-virus smtp-profile AV-PROFILE
| UTM policy option | Scans |
|---|---|
http-profile | Files downloaded and uploaded over HTTP |
ftp upload-profile, ftp download-profile | FTP transfers in each direction |
smtp-profile, pop3-profile, imap-profile | Email and attachments in each mail protocol |
A protocol with no profile in the UTM policy is not scanned.
Fallback options
Sometimes a file cannot be scanned: it is larger than the size limit, the engine is not ready, the scan times out, or the device runs out of resources. Fallback options decide what happens in each case.
| Fallback action | Effect |
|---|---|
block | The unscanned file is dropped |
log-and-permit | The unscanned file is passed and a log message is written |
fallback-options default sets the action for every case at once, and individual cases such as content-size or timeout can be set on their own.
Fallback decides what happens to files that were not scanned. With log-and-permit, an oversized infected file passes. With block, large legitimate downloads may fail.
Antispam
Antispam works on SMTP only. It checks the IP address of the server sending the email against a spam block list (SBL).
| Antispam source | Description |
|---|---|
| Server-based SBL | A list maintained in the cloud by Juniper's antispam partner; the SRX queries it for each sending server |
| Local lists | Your own allow and block lists of addresses or domains, checked on the SRX |
When a message is identified as spam, the spam action decides what happens.
| Spam action | Effect |
|---|---|
block | The message is refused |
tag-subject | A tag string is added to the subject line, and the message is delivered |
tag-header | A tag string is added to the message header, and the message is delivered |
Tagging leaves the final decision to the mail server or the mail client, which can sort tagged messages into a junk folder.
user@srx# set security utm feature-profile anti-spam sbl profile AS-PROFILE sbl-default-server
user@srx# set security utm feature-profile anti-spam sbl profile AS-PROFILE spam-action tag-subject
user@srx# set security utm feature-profile anti-spam sbl profile AS-PROFILE custom-tag-string "***SPAM***"
user@srx# set security utm utm-policy UTM-MAIL anti-spam smtp-profile AS-PROFILE
Antispam is applied where mail enters the network: on the security policy from untrust to the zone that holds the mail server, permitting junos-smtp.
One UTM policy, several features
A single UTM policy can carry antivirus, antispam, web filtering and content filtering together. The policy for inbound mail might combine antispam and antivirus with smtp-profile, while the policy for outbound browsing combines web filtering, content filtering and antivirus with http-profile.
security {
utm {
utm-policy UTM-MAIL {
anti-virus {
smtp-profile AV-PROFILE;
}
anti-spam {
smtp-profile AS-PROFILE;
}
}
}
}
Checking antivirus and antispam
| Command (operational mode) | Shows |
|---|---|
show security utm anti-virus status | Engine type, license and pattern or server status |
show security utm anti-virus statistics | Files scanned, clean, infected and handled by fallback |
show security utm anti-spam status | Whether SBL lookups are working |
show security utm anti-spam statistics | Messages checked, spam found and actions taken |
show system license | Installed licenses and their expiry |
When antivirus suddenly passes everything, check the license and show security utm anti-virus status. An engine that is not ready sends files to the fallback action.
Common mistakes
Expecting antispam on POP3 or IMAP. Antispam inspects SMTP only. Antivirus can scan POP3 and IMAP; antispam cannot.
Thinking tag actions drop mail. tag-subject and tag-header deliver the message with a marker.
Leaving out a protocol profile. Antivirus scans only the protocols that have a profile in the UTM policy.
Ignoring the license. Antivirus and antispam need licenses; without them the features do not scan.
Encrypted traffic. Files inside HTTPS or encrypted mail cannot be scanned unless the SRX decrypts them, for example with SSL proxy for HTTPS.
What to remember for the exam
- Antivirus engines: Sophos (
sophos-engine, cloud-assisted) and Avira (avira-engine, on-device full scanning); both licensed. - Antivirus profiles are referenced per protocol:
http-profile,ftp upload-profileanddownload-profile,smtp-profile,pop3-profile,imap-profile. - Fallback options handle files that cannot be scanned:
blockorlog-and-permit. - Antispam is SMTP only and checks the sending server against a spam block list.
- Spam actions:
block,tag-subject,tag-header. - Both features are configured under
security utmand attached through a UTM policy on a permit policy.
Check yourself
A 200 MB file exceeds the antivirus size limit and the fallback is
log-and-permit. What happens?The file is passed unscanned and a log message is written.
Antispam is set to
tag-subject. What happens to a message from a listed spam server?The message is delivered with the tag string added to its subject line.
Can SRX antispam check mail that users download with IMAP?
No. Antispam works on SMTP only; antivirus can scan IMAP and POP3.
Topic 3 of 3 in Content Security
Test yourself on Content Security
The full Juniper JNCIA-SEC JN0-232 question bank has 658 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.