FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
Gaetan_
Staff
Staff
Article Id 329415
Description

This article describes how to renew FortiGate's VPN certificates after a FortiManager upgrade to version 7.2.5 (and above) or 7.4.2 (and above).

For further information, see the release notes:

7.2.5 Release Notes

7.4.2 Release Notes

Scope FortiManager, FortiGate.
Solution
Warning:
Do not perform any 'Policy Package & Device Settings' or 'Device Settings (only)' installation before applying this procedure. Otherwise, expired VPN tunnels will not renegotiate.
 
  1. Architecture Details: The architecture example used in this article is a basic hub and spoke topology with three FortiGates. Screenshots were taken on a 7.2.5 FortiManager. The 7.4.2 GUI features some differences, but the overall procedure remains the same. 
 
 

Lab.jpg

  1. Implementation:
  • Back up the FortiManager configuration. Go to System Settings -> Dashboard and select 'Backup'.

 

a. Perform a backup of FortiManager.jpg

 

  • Deactivate auto-retrieve: On FortiManager, open the CLI Console and set auto-update to 'disable'. This will ensure modifications are not overridden by an auto-retrieve.  

 

CLI_Button_FMG.jpg

  

FMG_Auto-Update_Disable.jpg
  • Display new and former CA certificates: Go to Policy & Objects -> Tools and select 'Feature Visibility'. Then, under 'Advanced', check 'CA Certificates'.

 

b. Feature visibility.jpg

Go to Policy & Objects -> Object Configurations -> Advanced -> CA Certificates. CA2 is the former CA and CA3 is the new one.

 

c. Control FMG_CA.jpg

 

  • Renew device certificates: Go to Device Manager -> Provisioning Template -> Certificate Templates -> OVERLAY-VPN-CERTIFICATE -> More and select 'Generate'. Select all required devices and select 'OK'. 

 

d. Renew certificatesPanel.jpg

d. Renew certificates_Generate.jpg

  • Modify Peers and Peer Groups: Newly generated certificates do not include an ADOM name anymore (which is part of a fix for bug 796858), meaning the peer configuration must be edited. Connect to the Hub, open 'CLI Console', and gather the output of 'show user peer' and 'show user peergrp'.

 

Warning:

Make sure the peer list and especially peer group members are the same among all the devices. In a text editor, remove .<ADOM_Name> (.root in this example) and replace CA2 with CA3.

 

CLI_Button.jpg

e. User_peer_peergrp_Hub.jpg

 

e. Modify Peers and Peer Groups_Edition.jpg

 

Return to FortiManager and go to Device manager -> Scripts > + Create New and select 'Script'. Enter a Script Name, set the Type to 'CLI Script', specify Run Script on as Device Database and paste the previously edited data, then select 'OK'.

 

e. Script.jpg

 

e. Script_Data.jpg

Select the newly created script and select the 'Run Script' button. Select all required devices, move them to the right pane using the right arrow, and select 'Run Now'. A confirmation window will appear. Select OK. Once the script has successfully run, select 'Close'.

 

e. Run Script_1.jpg

e. Run Script_2.jpg

e. Run Script_3.jpg

  • Delete former peers (optional): Connect on the Hub, open the 'CLI Console' and gather the output of the following command:

 

show user peer | grep 'edit\|config\|end'

 

In a text editor, replace edit with delete.

 

e. _Cleaning_1.jpg

 

e. Cleaning_2.jpg

Return to FortiManager and go to Device manager -> Scripts -> + Create New and select 'Script'. Enter a Script Name, set Type to 'CLI Script', specify Run Script as 'Device Database', and paste the previously edited data, then select OK.

 

e. Script.jpg

  

Script_Cleaning_1.jpg

Select the newly created script and select the Run Script button. Select all required devices, move them to the right pane using the right arrow, and select Run Now. A confirmation window will appear. Select OK. Once the script has run successfully, select 'Close'.

 

e. Run Script_1.jpg

e. Run Script_2.jpg

e. Run Script_3.jpg


Warning:

The script may end with errors. This is most likely due to the peer list not being the same among all the devices (a script cannot delete something that does not exist). It is recommended to adapt the script to failed device configurations.

 
  • Install modifications: Select Install Wizard, then select Install Device Settings (Only) and select NextSelect all of the required devices and select NextSelect Install Preview. The following should be available: The new certificate CA3 (under config vpn certificate ca), the previously generated device certificate (under config vpn certificate local), and the peer/peergrp modifications. Close the install preview and select Install.

 

f. Install wizard 1.jpg

f. Install wizard 2.jpg

Once the installation has been completed, select Finish.

 

f. Install wizard 3.jpg

  • Enable auto-retrieve: On FortiManager, open the CLI Console and set auto-update to 'enable'.

CLI_Button_FMG.jpg

  

FMG_Auto-Update_Enable.jpg

  1. Verify certificate, peer and peergrp have been successfully updated on the FortiGates. Connect to the Hub and go to System -> Feature Visibility, check 'Certificates', and select 'Apply'.

 

Verify_1.jpg

 

Go to System -> Certificates, open 'OVERLAY-VPN-CERTIFICATE', and verify the common name does not have the .<ADOM_Name> extension.

 

Verify_2.jpg

 

Open the CLI. By now, the control peer and peer group will have been successfully updated. There should be no mention of .<ADOM_Name> and CA2, especially in the peer group members list.

 

CLI_Button.jpg

 

Verify_3.jpg

 

  1. Cleaning (optional):Go to Device manager -> Scripts -> + Create New and select 'Script'. Fill in a Script Name, set the Type to 'CLI Script', set Run Script on to 'Device Database' and paste the following as the script, then select OK.

 

config vpn certificate ca

delete "root_CA2"

end

 

e. Script.jpg

  

Cleaning_CA_Script.jpg

 

Select the newly created script and select the Run Script button. Select all required devices, move them to the right pane using the right arrow and select Run Now. A confirmation window will appear. Select OK. Once the script has successfully run, select Close.

 

e. Run Script_1.jpg

e. Run Script_2.jpg

e. Run Script_3.jpg

 

Afterwards, install the modification as detailed in 2.g.

 

The procedure to remove CA2 from FortiManager will differ depending on the implementation and its dependencies. As a result, it is not documented in this article. Note that this has no impact.