Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy certificate to FortiGate firewall using API #6236

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

NotAnotherHelloWorld
Copy link

This PR adds a new deploy hook for FortiGate firewalls. It:

  • Uploads the server and CA certificate to FortiGate via API.
  • Sets the uploaded certificate as the active web GUI certificate.
  • Removes previously deployed certificate (name stored in acme domain conf).
  • Does not remove CA certificates (in case of external dependencies).

Why is this needed?

FortiGate's native ACME integration:

  • Does not support wildcard certificates.
  • Does not work with custom management ports (e.g., DNAT web traffic).
  • Does not support domain validation.

Usage

acme.sh --deploy -d example.com --deploy-hook fortigate --insecure

--insecure required in case of invalid pre-existing certificate

API Requirements

Create a REST API admin with an admin profile assigned the following permissions:

  • System → Configuration [Read/Write] (for setting the active GUI certificate)
  • VPN → [Read/Write] (for uploading and removing certificates)

Set "Scope" to "global" if using VDOMs. Be aware that the certificate will be visible to all VDOMs.

Tested On:

  • FortiGate 61F v7.4.7 (without VDOMs)
  • FortiGate 100F v7.4.6 (with VDOMs)

@NotAnotherHelloWorld
Copy link
Author

Sorry about the duplicate PRs–Git and I are a work in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant