31 Fortinet FortiOS
Mathieu Simon edited this page 2024-10-03 13:26:36 +02:00

FortiOS is an embedded operating system used on various appliances from Fortinet. Depending on the version of FortiOS, not all command may be available, and if major differences are known, they are combined in a specific section.

SSH into an appliance running FortiOS, or use a local serial connection in order to apply these options.

FortiOS >= 7.4.0

Individual FortiOS 7.4.x versions have sometimes introduced changes or added features, they are summarized into a single section referencing only the latest version but are outlined here and recommendations apply to the latest (known) version:

  • 7.4.4: Most commands related to SSH have moved from config system global to config system ssh-config, one command was also renamed
  • 7.4.2: set ssh-hostkey-algo changed, more configurable SSH host key algorithms became available
  • 7.4.1: set ssh-kex-algo changed, more configurable KEX algorithms became available
  • 7.4.0: set ssh-hostkey-algo added, it allows configuring one or more SSH host key algorithms
config system global

# These commands shoulnd't change default settings
set admin-ssh-v1 disable
set strong-crypto enable

# These commands do change default settings
set dh-params 8192

end

config system ssh-config

# These commands do change default settings
set ssh-enc-algo chacha20-poly1305@openssh.com aes256-gcm@openssh.com
set ssh-hsk-algo ssh-ed25519
set ssh-kex-algo diffie-hellman-group16-sha512 diffie-hellman-group18-sha512 curve25519-sha256@libssh.org
set ssh-mac-algo hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com

end

References:

FortiOS >= 7.0.2 <= 7.4.0

Starting with FortiOS 7.0.2 some ciphers became individually configurable, several options have been renamed compared to previous versions.

config system global

# These commands shoulnd't change default settings
set admin-ssh-v1 disable
set strong-crypto enable

# These commands do change default settings
set dh-params 8192
set ssh-enc-algo chacha20-poly1305@openssh.com aes256-gcm@openssh.com
set ssh-kex-algo curve25519-sha256@libssh.org
set ssh-mac-algo hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com

end

References

FortiOS >= 5.6.0 <= 7.0.1

Starting with FortiOS 5.6 strong-crypto defaults to enable while SSHv1 defaults to disable since at least FortiOS 5.0.

config system global

# These commands shoulnd't change default settings
set admin-ssh-v1 disable
set strong-crypto enable

# These commands do change default settings
set dh-params 8192
set ssh-cbc-cipher disable
set ssh-hmac-md5 disable
set ssh-kex-sha1 disable
set ssh-mac-weak disable

end

References

Limitations

In most versions of FortiOS the configuration options available don't permit reaching a perfect score, here are some of the reasons:

  • Ciphers: Only after FortiOS 7.0.2 certain ciphers can be individually enabled and disabled.
  • Host-key algorithms: Only after FortiOS 7.4.1 allows configuring host keys algorithms, therefore rsa-sha2-256 and rsa-sha2-512 cannot be disabled in older releases.

Validated versions

FortiOS ssh-audit
7.4.1 master @ 02ab487232de438c0811116f2676cb1c9b5f3d62
7.2.5 master @ 02ab487232de438c0811116f2676cb1c9b5f3d62
7.0.12 master @ 02ab487232de438c0811116f2676cb1c9b5f3d62
7.0.11 master @ 02ab487232de438c0811116f2676cb1c9b5f3d62