Generating a CSR Certificate in FortiOS
1. From System > Certificates > Local Certificates, click the “Generate” button to get the following screen:
2. Click “OK”. This will take you back to the “Local Certificates” landing page where you can see your request.
3. Select the new CSR certificate, you can now see that there is a “Download” link available for the CSR you just generated. Click the download link and save the file to your file system.
4. Send this file either to your local certificate administrator or your third-party certificate authority for processing.
Sign a Certificate with Microsoft CA
Although you can create a self-signed certificate with Firebox System Manager or other tools, you can also create a certificate with the Microsoft Certificate Authority (CA).
For authentication, each certificate signing request (CSR) must be signed by a certificate authority (CA) before it can be used. When you create a certificate with this procedure, you act as the CA and digitally sign your own CSR. For compatibility reasons, however, we recommend that you instead send your CSR to a widely known CA. The root certificates for these organizations are installed by default with most major Internet browsers and XTM devices, so you do not have to distribute the root certificates yourself.
For HTTPS Proxy or SMTP Proxy content inspection, we recommend you use your internal CA to sign the request because you must create a CA certificate that can re-sign other certificates. If you create a CSR with Firebox System Manager and have it signed by a prominent CA, it cannot be used as a CA certificate.
You can use most Windows Server operating systems to complete a CSR and create a certificate.
Send the Certificate Request
- In your web browser address bar, type the IP address of the server where the Certification Authority is installed, followed by certsrv.
For example: http://10.0.2.80/certsrv
- Click the Request a Certificate link.
- Click the Advanced certificate request link.
- Click Submit a certificate.
- Paste the contents of your CSR file into the Saved Request text box.
- From the Certificate Template drop-down list, select Subordinate Certification Authority.
- Click Submit.
Issue the Certificate
- Connect to the server where the Certification Authority is installed, if necessary.
- Select Start > Control Panel > Administrative Tools > Certification Authority.
- In the Certification Authority (Local) tree, select Your Domain Name > Pending Requests.
- Select the CSR in the right navigation pane.
- In the Action menu, select All Tasks > Issue.
- Close the Certification Authority window.
Download the Certificate
- In your web browser address bar, type the IP address of the server where the Certification Authority is installed, followed by certsrv.
- Click the View the status of a pending certificate request link.
- Select the certificate request with the time and date you submitted.
- To choose the PKCS10 or PKCS7 format, select Base 64 encoded.
- Click Download CA certificate to save the certificate.
Certification Authority is distributed with Windows Server as a component. If Certification Authority is not installed in the Administrative Tools folder on your server, follow the instructions from the manufacturer to install it.
Importing the Extracted Certificate into the Certificate Store Even though the CA/SSL certificate has been imported into FortiOS, HTTPS proxy/inspection will cease to function if the CA certificate is not installed in the certificate store of the client end point. I will now detail the import of the CA certificate into the Microsoft CAPI, the Mac OS X Keychain and the Java key store.
Importing the Extracted Certificate and Private Key into FortiOS
· Login to your FortiGate/FortiOS admin interface and go to System > Certificates > Local Certificates.
· Click on the Pending certificate
· Click the “Import” link and choose the file from the Local .
· You should get the following message after clicking “OK” in the preceding step: Upload Certificate successfully. Return
· Login Via CLI
config firewall ssl setting
set caname <CAname>
end
Exporting a Certificate from FortiOS
In the event that you need to export a certificate from FortiOS, there are two methods you can use to accomplish this.
GUI Export:
1. Login to FortiOS and go to System > Certificates > Local Certificates.
2. Select the certificate that you would like to export and click the “Download” link at the top of the page.
3. Save the certificate in a location of your choice.
CLI Export:
1. In the FortiOS command line interface, type the following command:
fnsysctl cat /etc/cert/local/Fortinet_CA_SSLProxy.cer
This command will list the certificate content in the console window similar to the following example:
-----BEGIN CERTIFICATE----- MIID1zCCAr+gAwIBAgIBADANBgkqhkiG9w0BAQUFADCBpTELMAkGA1UEBhMCVVMxzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCVN1bm55dmFsZTERMA8GA1UEhMIRm9ydGluZXQxHjAcBgNVBAsTFUNlcnRpZmljYXRlIEF1dGhvcml0eTEVMBMG1UEAxMMRm9ydGlHYXRlIENBMSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGZvcnRp
-----END CERTIFICATE-----
2. Select and copy the certificate content including “-----BEGIN CERTIFICATE-----“ and “-- ---END CERTIFICATE-----“.
3. Open a text editor and paste the certificate content.
4. Save the file as CA.cer.
Microsoft CAPI Certificate Import: The CA certificate will need to be copied to the client end point file system.
· Right-click the CA certificate and select “Install Certificate”.
· When the “Certificate Install Wizard” window appears, click “Next” to begin the import.
· At the “Certificate Store” window, select the option, “Place all certificates in the following store” and click the “Browse” button
· In the “Select Certificate Store” window, select the option for “Show physical stores” then scroll up to “Trusted Root Certification Authorities” and select the sub-directory named, “Local Computer”.
· Click “OK” and then click “Next”. Once you click “Finish” on the final window, you will have successfully imported the CA certificate into the client end point certificate store.
Setup Certificate Authentication for SSL VPN
1. Open a browser and go to your FortiGate administration page.
2. Go to System > Certificates > CA Certificates.
3. Import your CA certificate using the steps found in, “Importing the Extracted Certificate and Private Key into FortiOS”.
4. Once the CA certificate has been successfully imported, go to the FortiGate CLI and enter the following commands:
config user peer
edit -- This is an arbitrary value of your choice.
set ca -- This is the CA certificate that you imported in step 3.
set two-factor enable
set password <pass>-- This is an arbitrary value of your choice.
Note: Use the following commands if they apply to your scenario:
set cn -- This is the common name of the peer certificate. Use only if you wish to specify a single user certificate.
set ldap server -- This is a LDAP server that you have setup under Users > Remote > LDAP – config user ldap.
set ldap-username -- This is an administrator account for your LDAP.
You must use the full DN for this account (eg. cn=administrator, cn=users,dc=fnet,dc=local) set ldap-password -- This is the password for the administrator account specified in the preceding command (set ldap-username).
set subject -- If not set, this will allow any peer certificate subject. If you wish to isolate to just one user, enter any of the peer certificate name constraints.
5. Now you will create a user group for SSL VPN access:
6. Configure your SSL VPN Policy:
config vpn ssl settings
set sslvpn-enable enable
set dns-server1
set reqclientcert enable
set force-two-factor-auth enable
set servercert
set tunnel-ip-pools
end
7. Configure your firewall rules:
8. Open a browser and go to https://:10443/remote/login to test client certificate authentication. If all settings have been configured correctly, the end user should be prompted for his/her certificate and, upon confirmation of said certificate, will then have full access to the profile assigned to his/her group. If the user gets a certificate prompt and a subsequent username and password field page, there is a problem with either the certificate chain or the validation of the user.
9. To troubleshoot issues related to certificate authentication, use the following commands:
diagnose debug app fnbamd 7
diagnose debug enable
Note:
To establish a successful SSL VPN using certificate, below points are mandatory.
a. On Fortigate –
1. A certified CSR certificate - To be installed on local
2. CA certificate from the server. – To be installed under CA certificate
b. On client PC
1. A client Certificate issued by CA server
2. CA certificated download from – Fortigate Local server