LAB 5 - Logging and Monitoring
LAB 5 - Logging and Monitoring
© FORTINET
Lab 5: Logging and Monitoring
In this lab, you will configure log settings on Local-FortiGate, configure alert email, and view logs.
Objectives
l Configure logging on FortiGate so FortiGate understands how to log traffic.
l Configure threat weight.
l Monitor logs through alert emails.
l View logs on the Local-FortiGate GUI.
Time to Complete
Estimated: 35 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file to Local-FortiGate. After the reboot, you must also
check your web filter license status, because you will be using web filtering in this lab and it must show as
licensed.
© FORTINET
To check the web filter license status upon reboot
1. Continuing on the Local-Windows VM, log in to the Local-FortiGate GUI at 10.0.1.254 with the user name
admin and password password.
2. Select Dashboard, and in the Licenses widget, verify that there is a green check mark next to Web Filtering,
indicating the service is licensed and active.
If it is licensed, continue to Configuring Log Settings on page 92
3. If there is a grey ? icon next to Web Filtering, indicating the license status is unavailable, complete the following:
a. Click System > FortiGuard.
b. Scroll to the bottom of the page, and then, next to Filtering Services Availability, click Check Again to
force an update.
c. Click OK to confirm.
You should see a confirmation message indicating that the web filtering service is available.
To record network activity, you must configure logging on FortiGate. In this exercise, you will configure the log
settings.
Configuring log settings does not generate logs directly on FortiGate. Rather, log settings define if, where, and
how a log is stored.
The objective of this exercise is to prepare the log settings on Local-FortiGate. For the purposes of this lab, this
includes:
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure Threat Weight on page 94.
Field Value
Disk <enable>
© FORTINET
4. In the Log Settings section, make sure the following settings are configured:
Field Value
Event logs provide all of the system information generated by the FortiGate
device (they are not caused by traffic passing through firewall policies).
However, it is good practice to track and monitor events that occur on
FortiGate.
These logs record traffic directly to and from FortiGate and can fill up your disk
quickly if not properly managed and monitored. For the purposes of this lab,
leave all local traffic log options disabled.
Field Value
6. Click Apply.
© FORTINET
Configure Threat Weight
To prioritize solving the most relevant issues easily, you can configure severity levels for IPS signatures, web
categories, and applications that are associated with a threat weight (or score). Threat weight allows you to set
the risk values for low, medium, high, and critical levels, and then apply a threat weight to specific categories.
The objective of this task is to set the following categories to critical status:
l Malicious Websites
l Hacking
l Explicit Violence
l Pornography
You will use threat weight later when searching for logs at a specific threat weight.
3. In the Risk Level Values section, record the value associated with the Critical risk level.
You will use this information later to search for logs using the risk level value as a filter.
Critical
4. Click Apply.
Now that you've defined if, where, and how a log is stored using the FortiGate log settings, you must define
whether logs are generated. To accomplish this, you must enable logging on your firewall policy. A log message
can generate only when logging is enabled on a firewall policy.
For the purposes of this lab, two firewall policies have been created for you. However, you will now need to
configure these firewall polices for logging.
l IPS: You will use this firewall policy to capture IPS traffic.
l Full Access: You will use this firewall policy to capture antivirus, web filter, DNS, and application control traffic.
IPS
l IPS | default
Full Access
l AntiVirus | default
l Web Filter | Category-block-and-warning
l DNS Filter | default
l Application Control | block-high-risk
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Monitoring Logs Through Alert Email on page 98.
© FORTINET
IPS default
3. In the Logging Options section, enable Log Allowed Traffic, and then select All Sessions.
Remember, you will not get logs of any kind if Log Allowed Traffic is not enabled.
4. Click OK.
You've successfully enabled logging on your firewall policy. Later in this lab, you will test these log settings.
© FORTINET
AntiVirus default
3. In the Logging Options section, enable Log Allowed Traffic, and then select All Sessions.
Remember, you will not get logs of any kind if Log Allowed Traffic is not enabled.
4. Click OK.
You've successfully enabled logging on your firewall policy. Later in this lab, you will test these log settings.
In this exercise, you will configure alert emails, run some traffic through the Local-FortiGate, and view alert
emails.
Because you can’t always be physically at the FortiGate device, you can monitor events by setting up alert
emails. Alert emails provide an efficient and direct method of notifying an administrator of events.
An SMTP mail server is required for alert email to operate. Because configuring a mail
server is out of scope for this lab, it has been preconfigured for you. You can view the
email service configuration on the Local-FortiGate GUI by clicking System >
Advanced.
Field Value
From FortiGate@training.lab
To admin@training.lab
Interval 1
Generate Traffic
For the purposes of this lab, you must generate traffic so you can see the logs collected by FortiGate.
© FORTINET
The traffic you generate will go through Local-FortiGate. You have already enabled
the security policy on the IPS firewall policy and enabled logging for all sessions.
You will use two different tools to create different types of traffic.
In this lab, you will direct FIT-generated traffic through the Local-FortiGate. The FIT is behind port3 on the Local-
FortiGate. The traffic from FIT will go through the Full Access firewall policy. For more information, see
Network Topology on page 10.
You configured the Full Access firewall policy to include the following security policies and logging options:
Because FIT-generated traffic will originate from the IP of the FIT VM (10.0.1.20),
all these logs will show the same source IP in the logs. This is a limitation of the lab
environment. In a real-world scenario, you will likely see many different source IPs for
your traffic.
© FORTINET
To generate traffic through FIT
1. Continuing on the Local-Windows VM, open PuTTY and connect over SSH to the FIT saved session.
2. At the login prompt, enter student with the password password.
3. Type the following commands:
cd FIT
Traffic begins to generate and repeats the script each time it completes.
4. Leave the PuTTY session open (you can minimize it) so traffic continues to generate.
This will run throughout the remainder of this lab.
Do not close the FIT PuTTY session or traffic will stop generating.
You will direct the Nikto-generated traffic through Local-FortiGate. Nitko is running on the Linux VM, and the
traffic will go through the egress to ingress firewall policy named IPS. For more information, see Network
Topology on page 10.
You configured the IPS firewall policy to include the following security policy and logging options:
© FORTINET
Because Nikto-generated traffic will originate from the IP of the Linux VM where Nikto
is installed (10.200.1.254), all these logs will show the same source IP in the
FortiGate logs. This is a limitation of the lab environment. In a real-world scenario, you
will likely see many different source IPs for your traffic.
The scan will continue for approximately 25 minutes. The dialog displays an End Time and indication that 1
host is tested when complete.
You can run the command again after the scan completes (press the up arrow and then press Enter) to
generate more logs, but it's not required. One cycle will provide enough logs for the purposes of this lab.
4. Leave the PuTTY session open (you can minimize it) so traffic continues to generate.
This will run for the remainder of the lab.
Do not close the LINUX PuTTY session or traffic will stop generating.
© FORTINET
View Alert Emails
Now that traffic is being sent through your FortiGate, you can check the admin@training.lab email to see if any
alerts have been generated based on that traffic. You configured the alert email to generate an alert every one
minute any time an intrusion is detected by the IPS security profile on the IPS firewall policy, and any time the
web filter security profile blocks traffic on the Full Access firewall policy.
The log message that accompanies an alert provides more details about the traffic that caused the alert.
2. Select the inbox of the admin@training.lab email account and click Get Messages.
You should see a message in the admin inbox with a subject of "Message meets Alert condition". If no email
appears in the inbox, wait 30 seconds, and then click Get Messages again.
4. Open another alert email and record the following information from a single web filter log:
Field Value
date
time
logid
subtype
level
© FORTINET
Field Value
sessionid
profile
catdesc
crscore
You will locate this log on the Local-FortiGate GUI in the next exercise.
5. Select the email of the log you recorded by clicking the star icon to the left of the email subject.
The star icon turns yellow.
If you would like to review more alert emails, click Get Messages in your admin inbox
again. You configured your alert email to send messages that meet the alert condition
every one minute.
In this exercise, you will view logs using both the Log & Report and FortiView menus of the Local-FortiGate
GUI. You will also configure filter options to locate specific logs.
In this exercise, you will examine the logs on the Local-FortiGate GUI, based on the traffic you generated from
the FIT VM and Nikto.
Forward Traffic
The first place you will examine logs is on the Forward Traffic page.
All security profile-related logs are tracked within the forward traffic logs, so you can search all forward traffic in
one place. This is helpful if you are looking to see all activity from a particular address, security feature, or traffic.
Security profile logs are still tracked separately in the GUI, but only appear when logs exist.
© FORTINET
Filter Value
This filters on all Web activity greater than or equal to the Critical (50) risk
level.
If the information on which you are filtering does not appear in the table, you may
need to add the related column to the table. To do so, right-click any column in the
table and select the column you want to add. For example, to view the Threat Score
column, add Threat Score. At the bottom of the list, click Apply to refresh the table
with the new column.
© FORTINET
5. View both the Details and Security tabs to see what information is available.
If this menu item does not display, you can refresh the page, or log out of the Local-
FortiGate GUI and log in again.
2. Locate the log in the alert email that you recorded in To view your alert emails on page 102 by using log filters.
© FORTINET
Stop and think!
Which filter would best return the specific log you are seeking? For example, filters based on log subtype or
crscore would most likely return too many logs, making the search inefficient.
3. After you locate the log, double-click the entry to view the log details.
As you can see, the log details in the alert email are the same as the log details on the GUI. The only
difference is the format. Alert emails provide the log detail information in raw format, while the GUI provides
the log detail information in a formatted format.
l View the GUI page that shows intrusion prevention logs only.
l Filter for a log with the attack name NetworkActiv.Web.Server.XSS.
l View information about the attack on FortiGuard.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see View Logs in FortiView on page 108.
© FORTINET
This takes you to the FortiGuard website, where you can gather more information about the specific attack,
such as the description of the attack, affected products, impact, and recommended actions.
FortiView is a comprehensive monitoring system for your network that integrates real-time and historical data into
a single view on your FortiGate.
2. Use the search settings to display the Web activity in a different way. For example:
l Select Categories and 1 hour to see the Web categories most accessed in the last hour.
© FORTINET
Close both the FIT and LINUX PuTTY sessions to stop log generation.