LAB 9 - Antivirus
LAB 9 - Antivirus
LAB 9 - Antivirus
© FORTINET
Lab 9: Antivirus
In this lab, you will configure, use, and monitor antivirus scanning on Local-FortiGate in both flow-based and
proxy-based inspection modes.
Objectives
l Configure antivirus scanning in both flow-based and proxy inspection modes.
l Understand FortiGate antivirus scanning behavior.
l Scan multiple protocols.
l Read and understand antivirus logs.
Time to Complete
Estimated: 20 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file to Local-FortiGate.
l Quick scan uses a compact antivirus database and performs faster scanning because it doesn’t buffer the file in
memory.
l Full scan uses the full antivirus database. It buffers the file locally, but transmits it simultaneously to the end client.
Everything is transmitted except the last packet. The last packet is delayed, and the whole file is sent to the
antivirus engine for scanning.
In this exercise, you will use antivirus in flow-based inspection mode to understand how FortiGate performs
antivirus scanning. You will use full-scan mode with and without deep inspection. You will observe the behavior of
antivirus scanning, with and without deep inspection, to understand the importance of performing full-content
inspection.
By default, the FortiGate inspection mode is set to flow-based, so all the security profiles will also be set to flow-
based inspection mode. In this procedure, you will verify the antivirus profile settings, and apply the antivirus
profile to a firewall policy.
© FORTINET
Review the Flow-Based Antivirus Profile
Now that you've verified that the inspection mode is set to flow-based, you will review the antivirus profile to view
the settings.
Because the inspection mode is set to flow-based, by default, all the security profiles
will be set to flow-based as well.
Now that you have reviewed the antivirus profile, you must enable the antivirus profile on your firewall policy.
After you enable the antivirus profile on a firewall policy, it can scan for viruses and generate logs (based on
configured log settings).
l Edit the Full_Access firewall policy and enable the default antivirus profile.
l Use certificate-inspection profile for SSL inspection.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Test the Antivirus Configuration on page 152.
5. Keep the default values for the remaining settings, and then click OK to save the changes.
© FORTINET
Test the Antivirus Configuration
In this procedure, you will download the EICAR test file to your Local-Windows VM. The EICAR test file is an
industry-standard virus used to test antivirus detection without causing damage. The file contains the following
characters:
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
http://eicar.org
2. In the upper-right corner of the EICAR webpage, click DOWNLOAD ANTI MALWARE TESTFILE.
3. Click the Download link on the left.
4. In the Download area using the standard protocol http section, download any EICAR sample file.
FortiGate should block the download attempt and insert a replacement message similar to the following
example:
FortiGate shows the HTTP virus message when it blocks or quarantines infected files.
In this section, you will test the flow-based antivirus configuration using the Save Link As method to download
the EICAR text file.
© FORTINET
To test the antivirus configuration
1. Continuing on the Local-Windows VM, open a new web browser tab and go to the following website:
http://eicar.org
2. On the EICAR website, in the upper-right corner of the page, click DOWNLOAD ANTI MALWARE TESTFILE.
3. Click the Download link on the left.
4. In the Download area using the standard protocol http section, right-click eicar.com.txt and select Save
Link As.
6. On your desktop, right-click the eicar.com downloaded file, and click Edit with Notepad++ to open the file
you downloaded.
Is the content of the file what it's supposed to be?
When the last packet arrives, FortiGate buffers it and puts it on hold. Then, it sends the whole buffered file
to the IPS engine where rule match is checked and passed to the antivirus engine for scanning. If the
antivirus scan does not detect any viruses, and the result comes back clean, the last buffered packet is
regenerated and delivered to the client.
However, if a virus is found, the last packet is dropped. Even if the client has received most of the file, the
file will be truncated and the client will be not able to open a truncated file. FortiGate injects the block
message into the partially download file. The client can use Notepad to open and view the file.
© FORTINET
View the Antivirus Logs
The purpose of logs is to help you monitor your network traffic, locate problems, establish baselines, and make
adjustments to network security, if necessary.
3. Select theSecurity tab to view security logs, which provide information more specific to security events, such as
file name, virus or botnet, and reference.
4. To view antivirus security logs, click Log & Report > AntiVirus.
The AntiVirus section won't display if there are no antivirus logs. FortiGate displays
the AntiVirus section after creating logs. If the AntiVirus menu item does not
display in the GUI, refresh your browser or log out of the FortiGate GUI and log back in
again.
8. Click Close.
© FORTINET
The Advanced Threat Protection Statistics widget provides statistics about the number of files submitted
and the results of those scans.
So far, you have tested unencrypted traffic for antivirus scanning. In order for FortiGate to inspect the encrypted
traffic, you must enable deep inspection on the firewall policy. After you enable this feature, FortiGate will filter
for traffic that is using the SSL encrypted protocol, which is very similar to a man-in-the-middle (MITM) attack.
To test antivirus scanning without SSL Inspection enabled on the firewall policy
1. Continuing on the Local-Windows VM, open a web browser and go to the following website:
http://eicar.org
© FORTINET
FortiGate should not block the file, because you have not enabled full SSL inspection.
FortiGate should block the download and replace it with a message. If it doesn't, you may need to clear your
cache. In Firefox, click History > Clear Recent History > Everything.
In proxy-based inspection mode, each protocol's proxy buffers the entire file (or waits for oversize limit) and scans
it. The client must wait for the scan to finish.
In this exercise, you will configure antivirus scanning in proxy-based inspection mode, including associated
security features, such as proxy options with deep-inspection. Then, you will apply antivirus scanning to the
firewall policy. Finally, you will view the logs and summary information for the antivirus activity.
By default, flow-based inspection mode is enabled on FortiGate. You will change the inspection mode from flow-
based to proxy-based.
Changing from one inspection mode to another will result in the conversion of profiles
and removal or addition of security features, based on the selected mode.
Now that you've changed the inspection mode to proxy-based, you will view the antivirus profile to see the
changes.
© FORTINET
If you do not see the mode set to NAT (Proxy-based) in the system information
widget, please refresh your browser.
2. Click Security Profiles > AntiVirus, and select the default antivirus profile.
3. Verify that Detect Viruses is set to Block and, in the Inspected Protocols section, make sure the FTP switch is
turned on.
This profile defines the behavior for virus scanning on the traffic that matches policies using that profile.
Now that the antivirus profile is configured, you must enable the antivirus profile on the firewall policy. After you
enable the antivirus profile on a firewall policy, it can scan for viruses and generate logs (based on configured log
settings).
© FORTINET
When selecting an antivirus profile, Proxy Options and SSL/SSH Inspection are
automatically enabled. You can't disable Proxy Options or SSL/SSH Inspection,
but you can select any preconfigured profiles in the Proxy Options and SSL/SSH
Inspection drop-down menus.
4. Beside the Proxy Options profile, click the pencil icon to view the profile on the firewall policy tab.
Alternatively, click Security Profiles > Proxy Options to see the default proxy options profile selected in
the firewall policy.
This profile specifies how FortiGate’s proxies pick up protocols. For example, The FTP listening port is set to
port 21.
Now, you will test the proxy-based antivirus profile using FTP file transfer.
3. On the Remote site side of the application (right), right-click the eicar.com file, and then select Download.
© FORTINET
The client should display an error message that the server aborted the connection. FortiGate sends the
replacement message as a server response.
In proxy-based inspection mode, FortiGate buffers the file to scan the content before
sending the file or a replacement message to the client.
Now, you will check and confirm the logs for the test you just performed.
© FORTINET
The Details tab shows forward traffic log information along with the action taken.