Technical Tip: How to list the in-use, trusted root CA certificates on a FortiGate from CLI
| Description | This article describes how to list the trusted root CA certificates that are loaded by the fnbamd process on a FortiGate from the CLI. |
| Scope | FortiGate. |
| Solution | The trusted root CA certificates on a FortiGate are published via the FortiGuard network and distributed in the certificate bundle.
To list the current certificate bundle present on the device the following command can be used:
get sys stat | grep Version: diagnose autoupdate versions | grep -A7 'Certificate Bundle'
Example output:
FortiGate # get sys stat | grep Version: FortiGate # diagnose autoupdate versions | grep -A7 'Certificate Bundle'
The process responsible for checking certificates and their validity is the 'fnbamd' process. It loads the local certificate database to verify the trust chain. To list all root CA certificates loaded by fnbamd, the following command can be used:
diagnose test application fnbamd 3
Parameter 3 means show all trusted root CA certificates loaded by fnbamd.
diagnose test application fnbamd
Certificates are stored locally on the FortiGate flash and can be listed with the following commands.
fnsysctl ls -al /etc/cert/
There can be a difference between certificates actively loaded by the fnbamd process and the certificates present on the filesystem. The list of certificates on the flash may differ on different devices. Even devices of the same model and firmware can have different certificates stored on the flash. Some files can be left over from previous installations.
The file listing can therefore not be used to verify the certificates present on the system and/or loaded into fnbamd. To check what CA certificates FortiGate actively uses, use the command 'diagnose test application fnbamd 3'.
Examples:
FortiGate-A # fnsysctl ls -al /etc/cert/ca
One device has the symlink '080911ac' pointing to certificate /etc/cert/ca/root_QuoVadis_Root_CA.cer, while the other device has the same certificate stored with filename 080911ac.0. In both cases, this certificate is not loaded into the fnbamd process.
Related article: Technical Tip: How to View the Default Trusted CA Certificates on FortiGate |