Install an own CA server at home and generate a certificate for FortiGate
To make my home network safer, I added a FortiGate between my router and my home network. The FortiGate comes with a self-signed certificate for the webinterface, but I want more protection because I don’t trust my cat. So, I’m going to create my own certificate authority (CA) using step-ca. This way, I can manage and revoke certificates if needed.
First, deploy step-ca as a Docker container with Portainer (which is a tool to manage Docker containers), but you can also do this directly using Docker or on different operating systems without using Docker.
Set the following environment variables:
https://<step-ca-domain>:9000/health
brew install step
step ca bootstrap --ca-url https://<step-ca-domain>:9000 --fingerprint <root fingerprint> --install
Notice the step cli also installs the root certificate on our system, so the CA is trusted by our OS.
step ca bootstrap --ca-url https://step-ca.masterball.local:9000 --fingerprint 23e95xxxxxxxxxxxxxxxxxxxxxxx --install
The root certificate has been saved in /Users/remcokersten/.step/certs/root_ca.crt.
The authority configuration has been saved in /Users/remcokersten/.step/config/defaults.json.
Installing the root certificate in the system truststore... Password:
done.
step ca token <Subject Alternative Name>
and save is to a variable to use it in the next step.In this example I’ll create a token for fortigate.masterball.local and save in the TOKEN variable. When you get promted for the provisioner key, this is the administrative password
TOKEN = $(step ca token fortigate.masterball.local)
✔ Provisioner: admin(JWK)[kid: qFdStxxxxx - xxxxxxxxx - xxxxxxxx]
Please enter the password to decrypt the provisioner key:
step ca certificate --token <created token> <SAN name> <filename for certificate> <filename for key>
In this step I’ll create a certificate for fortigate.masterball.local and let the CA sign it by providing my generated token.
➜ ~step ca certificate --token $TOKEN fortigate.masterball.local fortigate.crt fortigate.key
✔ CA: https://step-ca.masterball.local:9000
✔ Certificate: fortigate.crt
✔ Private Key: fortigate.key
That’s it! Now my home network is more secure with certificates managed by my own CA, so hopefully my cat can’t capture my credentials.