LAB 07 Antivirus
LAB 07 Antivirus
Sumário
Lab 7: Antivirus.......................................................................................................................................... 3
Objectives.......................................................................................................................................... 3
Exercise 1: Configuring Flow-Based Antivirus Scanning ............................................................................. 4
Configure the Antivirus Profile Inspection Mode .................................................................................... 4
Enable the Antivirus Profile on a Firewall Policy ..................................................................................... 6
Test the Flow-Based Antivirus Profile .................................................................................................... 6
View the Antivirus Logs ....................................................................................................................... 7
To view the security logs ...................................................................................................................... 8
Exercise 2: Using Antivirus Scanning in Proxy-Based Inspection Mode ........................................................ 9
Change the Inspection Mode in an Antivirus Profile ............................................................................... 9
Change the Inspection Mode in a Firewall Policy ................................................................................. 10
Test the Antivirus Configuration ......................................................................................................... 11
Test an Alternate Download Method ................................................................................................... 12
View the Antivirus Logs ..................................................................................................................... 13
Enable SSL Inspection in a Firewall Policy ........................................................................................... 14
Review the Antivirus History .............................................................................................................. 15
To verify the antivirus definitions status .............................................................................................. 16
2
Lab 7: Antivirus
In this lab, you will examine how to configure, use, and monitor antivirus scanning on Local-FortiGate in both
flow-based and proxy-based inspection modes.
Objectives
• Configure antivirus scanning in both flow-based and proxy-based inspection modes
Time to Complete
Estimated: 30 minutes
3
Exercise 1: Configuring Flow-Based Antivirus Scanning
In this exercise, you will configure a firewall policy with an antivirus profile in flow-based inspection mode.
Next, you will perform a test to download a file located on an FTP server. Finally, you will view the logs and
summary information related to the antivirus scanning.
For low-end platforms, the feature is available on the GUI only after you enable
the gui-proxy-inspection CLI command.
5. Connect to the Local-FortiGate CLI, and then log in with the username admin and password password.
end
7. Continuing on the Local-FortiGate GUI, in the upper-right corner, click admin, and then click Logout.
4
8. Log in with the username admin and password password.
10. Right-click the default antivirus profile, and then click Edit.
5
Enable the Antivirus Profile on a Firewall Policy
By default, flow-based inspection mode is enabled on the FortiGate firewall policy. You will configure the
antivirus profile in the firewall policy.
4. In the Security Profiles section, enable AntiVirus, and then select default.
5. Keep the default values for the remaining settings, and then click OK to save the changes.
2. In the upper-left corner, click the Site Manager icon, and then select Linux.
3. In the Remote site section, right-click the eicar.com file, and then select Download.
The client should display an error message that the server terminated the connection. FortiGate sends the
replacement message as a server response.
In flow-based inspection mode, FortiGate does not buffer traffic flowing through
the policy. If FortiGate detects a violation in the traffic, it sends a reset packet to
the receiver, which terminates the connection, and prevents the payload from
being sent successfully.
2. Locate the antivirus log message from when you tried to access the file using FTP, and then double-click
the log entry to view the details.
The Details tab shows forward traffic log information, along with the action taken.
3. Click Security.
7
To view the security logs
1. Continuing on the Local-FortiGate GUI, click Log & Report > Security Events > AntiVirus.
To view the logs, you may need to clear the filters in the search bar and increase
the time frame to 1 hour.
2. Locate the antivirus log message from when you tried to access the file using FTP, and then double-click
the log entry to view the security details.
8
Exercise 2: Using Antivirus Scanning in Proxy-Based Inspection Mode
In this exercise, you will examine how to use antivirus in proxy-based inspection mode to understand how
FortiGate performs antivirus scanning. You will observe the behavior of antivirus scanning, with and without
deep inspection, to understand the importance of performing full-content inspection.
5. Click OK.
9
Change the Inspection Mode in a Firewall Policy
Inspection mode is configured on a per-policy basis on FortiGate. You will change the inspection mode from
flow-based to proxy-based.
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 1.
1. Continuing on the Local-FortiGate GUI, click Policy & Objects > Firewall Policy.
4. In the Protocol Options field, verify that the default profile is selected.
5. In the Security Profiles section, in the AntiVirus field, verify that the default profile is selected.
The Protocol Options profile provides the required settings to hold traffic in
proxy while the inspection process is carried out. The default profile is
preconfigured to follow the standardized parameters for the common protocols
used in networking.
7. Keep the default values for the remaining settings, and then click OK to save the changes.
10
Test the Antivirus Configuration
You will download the EICAR test file to your Local-Client 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://10.200.1.254/test_av.html
FortiGate should block the download attempt, and insert a replacement message similar to the following
example:
11
Test an Alternate Download Method
You will test the proxy-based antivirus configuration using the Save Link As method to download the EICAR text
file.
http://10.200.1.254/test_av.html
2. In the Download area section, right-click eicar.com.txt, and then select Save Link As.
You should see the file you downloaded on the desktop. Why was the download allowed?
4. On your desktop, right-click the eicar.com.txt downloaded file, click Open With Other Application,
click Notepad++, click Select to open the file you downloaded, and then scroll to read the bottom of
the text file.
Remember, you are using proxy-based inspection mode. When a firewall policy
inspection mode is set to proxy, traffic flowing through the policy is buffered by
FortiGate for inspection. This means that FortiGate holds the packets for a file,
email, or web page until the entire payload is inspected for violations (virus,
spam, or malicious web links). After FortiOS has finished the inspection,
FortiGate either releases the payload to the destination (if traffic is clean) or
drops and replaces it with a message (if the traffic contains violations). FortiGate
injects the block message into the partially downloaded file. The client can use
Notepad to open and view the file.
5. Close Notepad++.
12
View the Antivirus Logs
You will check and confirm the logs for the tests you just performed.
You may need to remove any log filter in the search bar and increase the time frame.
The Details tab shows forward traffic log information, along with the action taken.
Security logs provide information that is more specific to security events, such as filename, virus or botnet, and
reference.
4. Click Log & Report > Security Events > AntiVirus to view antivirus security logs.
You can click Details to view more virus information related to an antivirus log
entry.
13
Enable SSL Inspection in a Firewall Policy
So far, you have tested unencrypted traffic for antivirus scanning. In order for FortiGate to inspect the encrypted
traffic, you must enable deep inspection in the firewall policy. After you enable this feature, FortiGate can
inspect SSL traffic using a technique similar to a man-in-the-middle (MITM) attack.
If you require assistance, or to verify your work, use the step-by-step instructions
that follow.
After you complete the challenge, seeReview the Antivirus History on page 1.
To test antivirus scanning without SSL inspection enabled in the firewall policy
1. On the Local-Client VM, open a browser, and then go to the following website:
https://10.200.1.254/test_av.html
2. Click Advanced.
FortiGate should not block the file, because you did not enable full SSL inspection.
3. In the Security Profiles section, in the SSL Inspection field, select deep-inspection.
4. Keep the remaining default settings, and then click OK to save the changes.
5. Click OK to confirm.
6. On the Local-Client VM, open a browser, and then go to the same website:
https://10.200.1.254/test_av.html
7. In the Download area section, try to download the same eicar.com file again.
14
If the FortiGate self-signed full-inspection certificate is not installed in the
browser, end users will see a certificate warning message. In this environment,
the FortiGate self-signed SSL inspection certificate is installed in the browser. If
the block page does not appear after 2 minutes, close all browser tabs, and then
restart the browser.
You may also need to clear your cache. In Firefox, click Settings > Privacy &
Security. Scroll to History, click Clear History, and then ensure the time range
to clear is set to Everything. Click OK.
You can click Drill down to view more details about a specific threat.
15
To verify the antivirus definitions status
1. Connect over SSH to Local-FortiGate.
execute update-av
After a few seconds, the output should include information similar to the following example:
The output confirms that the device has the latest antivirus packages for correct
protection.
16