High Performance Security Workshop: - Hands-On Lab
High Performance Security Workshop: - Hands-On Lab
High Performance Security Workshop: - Hands-On Lab
Workshop
- hands-on lab -
1. Lab objectives
2. Lab topology
The Lab environment has been preconfigured for this workshop, allowing administrative access
to the FGStudent_X and FGRemote_X devices. You will configure firewall policies and apply
security profiles on the configured firewall policies in the following exercises.
1. Connect via RDP to the StudentX server using Administrator / admin login credentials.
Using Firefox Web browser open a new tab and access FGStudent_X GUI with
https://10.1.X.254.
Note: To access the FortiGate GUI using a standard web browser, cookies and JavaScript
must be enabled for proper rendering and display of the graphical user interface.
At the login screen, enter the default username of admin and leave the password blank.
2. From the GUI on the FGStudent_X device, go to Policy & Objects > Addresses and verify if
the following address object exists. If it does not exist, create a new one with the following
settings:
3. The unrestricted internal->wan1 policy will need to be temporarily disabled in the policy
list. To do this, go to Policy & Objects > IPv4 Policy, right-click the Seq.# column of the
internal->wan1 policy and click Disable in the pop-up menu.
4. Next click Create New to add a new firewall policy to provide general Internet access from
the internal network. Configure the following settings:
When creating firewall policies, keep in mind that the FortiGate device is a stateful
firewall, therefore a firewall policy only needs to be created for the direction of the
originating traffic.
5. From the StudentX server, open a web browser and connect to various external web
servers.
6. On the FGStudent_X device go to Policy & Objects > IPv4 Policy and right-click any of the
column headings. In the pop-up menu, make sure that the Count column is enabled and
if not enable it. This column displays packet and bytes count for each firewall policy. Move
this column left or right in the policy table accordingly, for easier viewing.
7. Using putty or other terminal, connect via SSH to the FGStudent_X device – 10.1.X.254.
Login with user admin and no password, then enter the following command to see the
source NAT action:
Sample Output:
1. Use the same steps you performed earlier to create a second firewall policy. Configure
the following settings:
2. From the StudentX server, open a command prompt window and ping the wan1 gateway
as follows:
ping –t 10.100.X.254
Provided you have not changed the rule ordering, the ping should still work as it matches
the ACCEPT policy and not the DENY policy just created. This demonstrates the behavior
of policy ordering. The second policy was never checked because the traffic matched the
first policy.
3. From the GUI on the FGStudent_X device, go to Policy & Objects > IPv4 Policy and right-
click any of the column headings. In the pop-up menu, select ID and click Apply
afterwards. Move this column accordingly for easier viewing. By default only the
sequence number of the firewall policy is displayed in the GUI.
5. Return to the StudentX server and examine the command prompt window still running
the continuous ping. You should observe that this traffic is now blocked.
2. Go to Policy & Objects > IPv4 Policy and edit the General Internet access policy defined
earlier. Turn on AntiVirus and select the default antivirus profile. Click OK.
3. Next go to Security Profiles > Proxy Options and examine the UTM proxy options. The
default profile is displayed. These settings determine how FortiOS handles each
protocol. For example, which port numbers to use, whether to use client comforting,
or Block Oversized File/Email and so on.
4. Go to System > Replacement Message. From the top right-hand corner select
Extended View and under Security modify the Virus Block Page as you wish.
The HTML editor that is displayed allows you to see the changes as you are making
them. Click Save shown above the editor window to apply your changes.
5. On the virtual StudentX server, launch a web browser and access the following web
site:
http://eicar.org
6. On the Eicar web page, click Download Anti Malware Test File (located in the top right-
hand corner of the page) and then click the Download link that appears on the left.
Download the eicar.com file from the Download section area using the HTTP protocol.
The download attempt will be blocked by the FortiGate unit and a replacement
message will be displayed similar to the following (should also include any
customization you made earlier):
7. The HTTP virus message is shown when infected files are blocked or have been
quarantined. In the message that is displayed, click the link to the Fortinet Virus
Encyclopedia to view information about the detected virus.
8. Go to the Eicar download page again. This time, select the eicar.com file from the
Download area using the secure, SSL enabled HTTPS protocol section. The download
should be successful.
10. To ensure that there are no existing sessions prior to deep scanning the
communication exchange, connect to the CLI of the FGStudent_X device and enter the
following command:
11. Return to the Eicar web page and attempt to download the eicar.com file from the
Download area using the secure SSL enabled HTTPS protocol section. This time, the
download will be blocked by the FortiGate unit and the replacement message will be
displayed. (If this is not the case, you may need to clear your recent browsing history
as the object may be cached.)
12. Go to Security Profiles > AntiVirus and change the Inspection Mode for the default
antivirus profile to Flow-based. Click Apply. If the option doesn't appear, ask the
instructor to guide you through the CLI.
Try downloading the eicar.com (with/without SSL) file again. What happens now
when the virus is detected?
13. Go to Policy & Objects > IPv4 Policy and change the SSL inspection profile for the
General Internet access policy to certificate_inspection.
1. Go to Security Profiles > Application Control and review the default application control
sensor. (Ensure you are selecting the sensor named default.)
2. On the Edit Application Sensor page, check the settings for the Video/Audio category.
Enable Traffic shaping for the Video/Audio category and select the shared-1M-pipe
traffic shaper. Click Apply.
Go to Policy & Objects > Traffic Shapers. Edit the shared-1M-pipe traffic shaper and
set the maximum bandwidth to 100 Kbps.
3. Go to Policy & Objects > IPv4 Policy and edit the General Internet access policy. Ensure
that Application Control is turned ON and that the default application control sensor
is selected and enable Log all Session under Logging Options.
4. You will now test the application control configuration. From the virtual StudentX
server, open a web browser and connect to Dailymotion website:
http://dailymotion.com
Check the traffic shaper monitor in FortiView > Traffic Shaping. Observe how the
traffic shaper is dropping packets while some content is still delivered to you.
6. Check the application monitor in FortiView > Applications. If you can’t see this menu
than enter the following commands from CLI in order to enable the UTM monitors:
7. Go to Security Profiles > Application Control and edit the default sensor again. Click
Add Signatures under Application Overrides to add a new application filter.
Click on the signature row to select the signature and click Use Selected Signatures.
Set the Action field for the filter to Block and click Apply.
9. Return the web browser, and attempt to access the following web site:
http://proxite.us
10. On the proxy web page, scroll down to the bottom and enter the URL of 8tracks. Click
Go. You should observe this does allow some connectivity to the site. What action can
be taken to stop this?
You can set the action to block for the Proxy category.
1. From the StudentX server, you first will need to connect to the FGStudent_X device
and restore the configuration file that is needed for this lab.
Connect to the GUI on the FGStudent_X device (10.1.X.254) and restore the following
configuration file: Desktop\Resources\Module4\Student\FGStudent_X_auth.conf.
2. When the device has rebooted review the user configuration for this lab.
Go to User & Device > User Definition to review the local user settings
Go to User & Device > User Groups to review the user group configuration.
3. On the StudentX server, open a web browser and connect to a new web site. At the
login prompt, enter the following credentials:
Username: Student
Password: F0rtinet
You should observe that after successful authentication, you are redirected to your
destination web site.
4. From the GUI on the FGStudent_X device go to Policy & Objects > IPv4 Policy and
review the outgoing firewall policy with authentication configured.
What happens?
You should observe that this is permitted because there is an accept rule for this
traffic.
To force authentication on ICMP and SSH traffic add ALL_ICMP and SSH to the identity
policy rule for the training user group, and then disable the policy that allows
unauthenticated ICMP and SSH traffic.
6. Go to Firewall > User Monitor to view the details of the authenticated user.
7. From the CLI, view the IP addresses and users which have successfully authenticated
to the FortiGate unit with the following command:
In this exercise you will create a firewall policy that uses email captive portal. Once the
device is learnt, access to a test web server should be granted to your device.
1. Go to Policy & Objects > IPv4 Policy and delete any existing firewall policies. Then create
two new device identity firewall policies using the following settings:
Policy 1:
Click OK.
2. In the policy table view, drag the Linux PC identity-based policy after the Collected Emails
identity-based policy and disable the Collected Emails device identity-based policy.
3. You will now create a general access firewall policy. Click Create New and configure the
following:
4. You will now test the device policy. First, execute the following CLI commands to disable
the email DNS check for the captive portal. (This step is required for the purposes of this
lab.)
What happens? If you followed the example as given, nothing should happen because
you have only allowed Linux PCs and you are connecting from the Windows PC. If access
6. Edit the Linux PC policy and add Windows PC as a second Device type.
7. From your web browser, connect to http://10.200.X.254 again. You should now get to the
webpage.
8. Go to User & Device > Custom Devices & Groups and check the new device. It is located
unde Windows PC group. This device is a dynamic device. These devices may update and
are stored to the flash to speed up detection. Use the following command to list the
devices from CLI:
9. Go to User & Device > Device Inventory and delete the Windows device listed in there.
10. Perform a show from the CLI to confirm there are no devices in the configuration file.
Edit the policies created at step 2. Remove Windows PC device type from the first policy
and enable the Collection Emails policy.
Try to access the http://10.200.X.254 webpage again. When prompted add an email
address and click OK. Once email is collected, you should be redirected to http page. The
Collected Emails device sub-policy will match in this case.
11. From the GUI, go to User & Device > Device Inventory and edit your device from the device
list. Add an alias called myDevice. This creates a static device in the configuration file.
12. Go to User & Device > Custom Devices & Groups. Note that your device is already a
member of several predefined device groups. Click Create New and add a new device
group called myDevGroup. From the Members drop-down list, select myDevice and click
OK.
Note that your device is still a member of the predefined groups and is now a member of
the Custom type group called myDevGroup.
13. From the StudentX server, test that you can open a Telnet connection to 10.200.X.254.
You should observe the login prompt on the FGRemote_X device CLI menu.
Click OK.
Use drag-and-drop to reorder the policies so that this policy is first in the list.
15. Perform a telnet test to see if you can open a Telnet connection to 10.200.X.254. You
should observe that the connection now fails to establish.
1. From the StudentX server, you need to connect to the FGStudent_X device and restore the
Desktop\Resources\Module7\Student\FGStudent_X_ipsec.conf configuration file.
2. From the RemoteX server, connect to the FGRemote_X device and restore the
Desktop\Resources\Module7\Remote\FGRemote_X_ipsec.conf configuration file.
3. From the GUI of FGStudent_X device go to VPN > IPsec Tunnels and click Create New.
Name: ToRemote
Template Type: Site to Site
Remote Device Type: FortiGate
NAT Configuration: No NAT between sites
5. Click Next.
7. Click Next.
11. To review the objects created by the VPN wizard log on FGStudent_X and go to VPN > IPsec
Tunnels.
12. Select the VPN and click Edit. Observe the quick mode selectors that the wizard configured
for you:
14. Click on the plus sign added to port1. You will see a new virtual interface named ToRemote
(matching the phase 1 name).
Note: What does this virtual interface tell us about the VPN created by the wizard? Is it policy-
based or route-based?
15. Go to Policy & Objects > Addresses and observe two new Firewall address objects:
ToRemote_local_subnet_1, and ToRemote_remote_subnet_1.
16. Go to Policy & Objects > IPv4 Policy and observe the new two firewall policies: one from
Internal to ToRemote and one from ToRemote to Internal. You will see that the Action in
both cases is Accept.
17. Go to Network > Static Routes and look at the static route added by the wizard.
For learning purposes, you will do the configuration on both FortiGates differently. During this
exercise, you will create the VPN on the Remote-FortiGate side without using the wizard and
using a policy-based configuration.
Policy-based configuration is hidden from the GUI by default. You will un-hide it.
3. Click Apply.
4. To create a policy-based VPN, on the RemoteX device, go to VPN > IPsec Tunnels.
6. Type the name ToLocal and select Custom as the template name.
7. Click Next.
10. Leave the other parameters with its default values and scroll down the windows to display the
phase 2 settings. Click the pencil icon to edit the Phase 2 Selectors:
11. Enter 10.2.X.0/24 as the Local Address and 10.1.X.0/24 as the Remote Address:
Note: Now the quick mode selectors in both sides mirror each other. If that is not the case, the
tunnel will not come up.
The last step is to create a firewall policy to allow traffic. In a policy-based configuration only one
policy is required to allow traffic initiated at either side. The policy is applied bi-directionally.
1. From the RemoteX device GUI, go to Policy & Objects > IPv4 Policy.
4. Click OK.
Note: This is probably the first time you see the action IPsec for a firewall policy. In previous
exercises the available actions were Accept and Deny only. The action IPsec is displayed in the
GUI only when the policy-based VPN settings are not hidden.
The new policy was created below the firewall policy for Internet traffic. You will need to move it
up for the VPN traffic to match it.
1. From the RemoteX device GUI, go to Policy & Objects > IPv4 Policy.
3. Drag and drop the policy for VPN traffic to Local to the top:
Note: In the previous exercise, the VPN wizard added a static route for the VPN traffic. Why don’t
you need to add a static route in this case?
The VPN wizard creates the IPsec using route-based configuration, which always requires
additional routes (usually static routes) to route the traffic through the IPsec virtual interface. This
is usually not required in policy-based configuration. What policy-based configuration requires is
the VPN traffic matching a firewall policy with the action IPsec. As traffic from 10.2.X.0/24 to
10.1.X.0/24 matches the existing default route, and so the IPsec firewall policy from internal to
wan1, no additional routes are needed.
1. From the StudentX device GUI, go to Monitor > IPsec Monitor. Observe that the VPN is
currently down.
No. With the current configuration, the tunnel will stay down until either you manually bring it up
or there is traffic that should be routed through the tunnel. As you are not generating traffic
between 10.1.X.0/24 and 10.2.X.0/24 yet, the tunnel was still down. If you had generated the
required traffic while the tunnel was down, it would have gone up automatically.
3. Open a command prompt window on the Student X Server and execute the following
command to ping RemoteX Server:
ping 10.2.X.1
5. Click Refresh to refresh the screen. You will observe that counters for Incoming Data and
Outgoing Data have increased. This indicates that the traffic between 10.1.X.1 and 10.2.X.1
is successfully being encrypted and routed through the tunnel:
Congratulations. You have successfully configured an IPsec VPN between two FortiGate devices.