FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Rathan_FTNT
Staff
Staff
Article Id 189413
Description
This section describes a collection of changes implemented to make administrative access to the GUI and CLI more secure.

Solution
Disable administrative access to the external (Internet-facing) interface.

When possible, do not allow administration access on the external (Internet-facing) interface.
To disable administrative access, go to Network -> Interfaces, edit the external interface and disable HTTPS, PING, HTTP, SSH, and TELNET under Administrative Access.

From CLI.

# config system interface
    edit <external-interface-name>
    unset allowaccess
end
Allow only HTTPS access to the GUI and SSH access to the CLI.

For greater security never allow HTTP or Telnet administrative access to a FortiGate interface, only allow HTTPS and SSH access.
Change these settings for individual interfaces by going to Network -> Interfaces and adjusting the administrative access to each interface.


From CLI.

# config system interface
    edit <interface-name>
        set allowaccess https ssh
    end
Require TLS 1.2 for HTTPS administrator access.

Use the following command to require TLS 1.2 for HTTPS administrator access from GUI:
# config system global
    set admin-https-ssl-versions tlsv1-2
end
TLS 1.2 is currently the most secure SSL/TLS supported version for SSL-encrypted administrator access.
Re-direct HTTP GUI logins to HTTPS
Go to System -> Settings -> Administrator Settings and enable 'Redirect to HTTPS' to make sure that all attempted HTTP login connections are redirected to HTTPS.

From CLI.
# config system global
    set admin-https-redirect enable
end
Change the HTTPS and SSH admin access ports to non-standard ports.

Go to System -> Settings -> Administrator Settings and change the HTTPS and SSH ports.
Change the default port configurations for HTTPS and SSH administrative access for added security.
To connect to a non-standard port, the new port number has to be included in the collection request.
For example:

- If the HTTPS port to 7734 is changed, browse to https://<ip-address>:7734.
- If the SSH port to 2345 is changed, connect to ssh admin@<ip-address>:2345

From CLI.

# config system global
    set admin-sport 7734
    set admin-ssh-port 2345
end
If the HTTPS or SSH port numbers are changed, make sure that the changes do not conflict with ports used for other services.

Maintain short login timeouts.

Set the idle timeout to a short time to avoid the possibility of an administrator walking away from their management computer and leaving it exposed to unauthorized personnel.
To set the administrator idle timeout, go to System -> Settings and enter the amount of time for the Idle timeout.
A best practice is to keep the default time of 5 minutes.


From CLI.

# config system global
    set admintimeout 5
end
Use the following command to adjust the grace time permitted between making an SSH connection and authenticating.
The range can be between 10 and 3600 seconds, the default is 120 seconds (minutes).
By shortening this time, decrease the chances of someone attempting a brute force attack a from being successful.
For example, set the time to 30 seconds.

# config system global
    set admin-ssh-grace-time 30
end
Restrict logins from trusted hosts.

Setting up trusted hosts for an administrator limits the addresses from where they can log into FortiOS.
The trusted hosts configuration applies to most forms of administrative access including HTTPS, SSH, and SNMP.
When a trusted host for an administrator account is identified, FortiOS accepts that administrator’s login only from one of the trusted hosts.
A login, even with proper credentials, from a non-trusted host is dropped.





Set the idle timeout to a short time to avoid the possibility of an administrator walking away from their management computer and leaving it exposed to unauthorized personnel.

To set the administrator idle timeout, go to System -> Settings and enter the amount of time for the Idle timeout.
A best practice is to keep the default time of 5 minutes.

From CLI.
# config system global
    set admintimeout 5
end
Use the following command to adjust the grace time permitted between making an SSH connection and authenticating.
The range can be between 10 and 3600 seconds, the default is 120 seconds (minutes).
By shortening this time, decrease the chances of someone attempting a brute force attack a from being successful.
For example, set the time to 30 seconds.
# config system global
    set admin-ssh-grace-time 30
end
Restrict logins from trusted hosts.

Setting up trusted hosts for an administrator limits the addresses from where they can log into FortiOS.
The trusted hosts configuration applies to most forms of administrative access including HTTPS, SSH, and SNMP. When you identify a trusted host for an administrator account, FortiOS accepts that administrator’s login only from one of the trusted hosts. A login, even with proper credentials, from a non-trusted host is dropped.
Even if trusted hosts are configured, if you have enabled ping administrative access on
On a FortiGate interface, it will respond to ping requests from any IP address.
To identify trusted hosts, go to System > Administrators, edit the administrator account, enable Restrict login to trusted hosts, and add up to ten trusted host IP addresses.

From CLI.
# config system admin
    edit <administrator-name>
        set trustedhost1 172.25.176.23 255.255.255.255
        set trustedhost2 172.25.177.0 255.255.255.0
    end
Trusted host IP addresses can identify individual hosts or subnets.
Just like firewall policies, FortiOS searches through the list of trusted hosts in order and acts on the first match it finds.
When trusted hosts are configred, start by adding specific addresses at the top of the list.
Follow with more general IP addresses.
adding addresses is not necessary to all of the trusted hosts as long as all specific addresses are above all of the 0.0.0.0 0.0.0.0 addresses.

Set up two-factor authentication for administrators.

FortiOS supports FortiToken and FortiToken Mobile 2-factor authentication. FortiToken Mobile is available for iOS and Android units from their respective application stores.
Every registered FortiGate unit includes two trial tokens for free. You can purchase additional tokens from your reseller or from Fortinet.
To assign a FortiToken to an administrator, go to System -> Administrators and select 'Enable Two-factor Authentication' for each administrator.

Create multiple administrator accounts.

Rather than allowing all administrators to access ForiOS with the same administrator account, create accounts for each person or each role that requires administrative access.
This configuration allows to track the activities of each administrator or administrative role.

To let administrators have different functions, can add different administrator profiles.
Go to System -> Admin Profiles and select' Create New'.

Modify administrator account lockout duration and threshold values.

By default, the FortiGate sets the number of password retries at three, allowing the administrator a maximum of three attempts to log into their account before locking the account for a set amount of time.
Both the number of attempts (admin-lockout-threshold) and the wait time before the administrator can try to enter a password again (admin-lockout-duration) can be configured within the CLI.

From CLI.
# config system global
    set admin-lockout-threshold <failed_attempts>
    set admin-lockout-duration <seconds>
end
The default value of admin-lockout-threshold is 3 and the range of values is between 1 and 10.
The admin-lockout-duration is set to 60 seconds by default and the range of values is between 1 and 4294967295 seconds.
Keep in mind that the higher the lockout threshold, the higher the risk that someone may be able to break into the FortiGate.

Example.
To set the admin-lockout-threshold to one attempt and the admin-lockout-duration to a five minute duration before the administrator can try to log in again, enter the commands:
# config system global
    set admin-lockout-threshold 1
    set admin-lockout-duration 300
end





Rename the admin administrator account.

Improve security by renaming the admin account.
To do this, create a new administrator account with the super_admin admin profile and log in as that administrator.
Then go to System -> Administrators and edit the admin administrator and change the User Name. Renaming the admin account makes it more difficult for an attacker to log into FortiOS.

Add administrator disclaimers.

FortiOS can display a disclaimer before or after logging from GUI or CLI (or both).
In either case the administrator reads and accept the disclaimer before they can proceed.

Use the following command to display a disclaimer before logging in:
# config system global
    set pre-login-banner enable
end
Use the following command to display a disclaimer after logging in:
# config system global
    set post-login-banner enable
end
Customize the replacement messages for these disclaimers by going to System -> Replacement Messages.
Select 'Extended View to view' and edit the Administrator replacement messages.

From the CLI.
# config system replacemsg admin pre_admin-disclaimer-text
# config system replacemsg admin post_admin-disclaimer-text

Contributors