Enhanced administrator password security
The PBKDF2 hashing scheme with randomized salts is now used to store system administrator passwords on the FortiGate to enhance security. Previously the SHA256 hashing algorithm was used.
With this change, a new command is available to maintain FortiOS downgrade:
config system password-policy
set login-lockout-upon-downgrade {enable | disable}
end
|
set login-lockout-upon-downgrade {enable | disable} |
Enable/disable system administrator login lockout after downgrade to FortiOS firmware that does not support safer passwords (default = disable). When disabled, system administrator passwords with SHA256 hash are kept after successfully converting to PBKDF2 hash. SHA256 hashed passwords are used after downgrading to a firmware version that does not support PBKDF2 hashed passwords. When enabled, system administrator passwords that are converted to PBKDF2 hash will immediately remove the SHA256 hashed password. Upon downgrading the FortiOS firmware to a lower version, where safer passwords are unsupported, the administrators will be locked out. |
When creating a new administrative user in FortiOS 7.6.1 or later, the PBKDF2 hashing scheme is used to store the password. When displayed in the CLI, the password is encoded with a prefix of PB2:
# config system admin
(admin)# edit admin2
new entry 'admin2' added
(admin2)# set accprofile super_admin
(admin2)# set vdom root
(admin2)# set password 123456
(admin2)# show
config system admin
edit "admin2"
set accprofile "super_admin"
set vdom "root"
set password ENC PB20jOHUbfWEI7eKFTnKkE/qBgE5md70OjpXqiHhHTxo48GnIZshrIq67dT1IUouJSxgEZ6NYeAdAS9vLHpZGlcpBmtfUbfFOa6qKaVAN+F9CM=
next
end
Upgrade
To view system administrator passwords before and after upgrade to FortiOS 7.6.1:
-
Before upgrade to FortiOS 7.6.1 or later, view the encoded password. The encoded password shows a
SH2prefix because it was hashed with the SHA256 algorithm:# show system admin config system admin edit "admin1" set accprofile "prof_admin" set vdom "root" set password ENC SH2RHqyB8gaEKC10dzpgU6lZg7YSpnb21wWLFOtqzMlpyKJZyyq3ISFYPyIL/s= next end -
Upgrade to FortiOS 7.6.1 or later. Each system administrator password hashed with SHA256 is stored on FortiGate until each system administrator successfully logs in to FortiOS.
If a system administrator does not log in to FortiGate after upgrading to FortiOS 7.6.1 or later, their password remains saved as the SHA256 hashed password.
-
Log in to FortiOS. The password is converted to a PBKDF2 hashed password.
-
View the encoded password. The encoded password shows a
PB2prefix because it was hashed with the PBKDF2 algorithm:FortiGate login: admin1 Password: Verifying password... $ show system admin config system admin edit "admin1" set accprofile "prof_admin" set vdom "root" set password ENC PB2a2X8D3DIt0gXbBXVdknLZb48BKrGTD50z//UrbpWAD5kpFdwqBKie0h8STxL6Db//wQ2ZWN/5FW3+DkX3+0nBE1RNbeTKSVi18WcFmSPDQM= next end
Downgrade
To support downgrading to an older version that does not support the PBKDF2 hashed password, by default, the old SHA256 hashed password is still stored in the system after being converted to PBKDF2. This is controlled by the following setting that is disabled by default:
config system password-policy
set login-lockout-upon-downgrade disable
end
Downgrading will successfully restore the SHA256 hashed password and operations will continue uninterrupted.
If the login-lockout-upon-downgrade option is enabled:
config system password-policy
set login-lockout-upon-downgrade enable
end
The SHA256 hashed password will be removed from the system as soon as it is converted to a PBKDF2 hashed password upon a successful login.
During a downgrade operation, the system will display the following warning:
# execute restore image ftp FGT_2601F-v7.6.0.F-build3401-FORTINET.out 172.16.106.105 username password This operation will replace the current firmware version and reboot the system! Do you want to continue? (y/n)y Please wait... Connect to ftp server 172.16.106.105 ... Get image from ftp server OK. Verifying the signature of the firmware image. Image verification OK! Warning: Installing image v7.6.0 from v7.6.1 is not a recommended upgrade path. Continuing with the upgrade may result in loss of configuration. Do you want to proceed? Do you want to continue? (y/n)y … You are downgrading to a version that does not support safer passwords. After downgrade, some administrative user (e.g., admin1) no longer will be able to login. Do you want to continue? (y/n)
Administrators can choose to proceed or abort this downgrade.
Finally, if an administrator wants to restore the SHA256 hashed password for a downgrade, they can do the following:
-
Disable the
login-lockout-upon-downgradeoption. -
Log out the current administrator.
-
For each system administrator, log in to the FortiGate to generate the SHA256 hashed password by running the SHA256 hashing algorithm.
|
|
After administrator passwords are converted to PBKDF2 hashed passwords, loading the config file to an older version that does not support safer passwords will lock out the administrators. |