Report format
What a script sends to your own receiver after each installation, so you can see every server's certificate in one place.
Turn it on
Reporting is off until you give the script an HTTPS address: -ReportUrl on the PowerShell scripts,
--report-url on the bash scripts, or the report address variable at the top of the script. An empty address
sends nothing. The scripts that can report:
The scripts that install a certificate in the background (Deploy-FortiGate.ps1, Deploy-FortiMail.ps1,
Deploy-FortiManager.ps1, Deploy-FortiADC.ps1, Deploy-FortiNAC.ps1, Deploy-FortiWeb.ps1,
Deploy-PaloAlto.ps1, fairssl-fortigate, fairssl-fortimail) and FairSSLResultNotification.ps1 can report
each result to an address of your choice, so one place shows what every server installed and what failed.
Turning it on
A script reports when it has a report address, and sends nothing when it has none.
| Script | Report address |
|---|---|
| PowerShell | -ReportUrl https://reports.example.com/acme in the command, or the line $DefaultReportUrl = '' near the top of the file |
| Bash | --report-url https://reports.example.com/acme in setup, or the line DEFAULT_REPORT_URL="" near the top of the file |
The scripts in this library have an empty address. The copies in FairSSL’s simple-acme download have FairSSL’s
address on that line, and FairSSL’s guides for the Linux scripts give it with --report-url; that line is the
only difference. In PowerShell, -ReportUrl '' turns reporting off for one command. Only an https address is
used.
The request
POST <report address>
Content-Type: application/json
Accept: application/json
The body is one JSON object in UTF-8. There is no authentication: a receiver treats a report as a claim and checks it against what it knows (FairSSL compares the account, the domain and the certificate with its own ACME orders). A report is sent only when the script finds the ACME account of the certificate.
| Field | Type | Sent | Meaning |
|---|---|---|---|
kid | string | always | The ACME account URL the certificate was ordered with |
renewal_id | string | always | The renewal on this server: simple-acme’s renewal id, or the id setup made for the Linux scripts |
domain | string | always | The certificate’s primary name |
status | string | always | Result of the certificate order: success, failure or unknown |
install_status | string or null | when known | Result of the installation: success, failure, unknown; null while a worker is still trying |
install_error_code | string | on failure | A short code such as CONNECT_FAILED, NO_ACCESS, ROLLED_BACK, POSH_SSH_MISSING |
install_error_string | string | on failure | One sentence, at most 500 characters |
thumbprint | string | when read | SHA-1 fingerprint of the certificate |
certificate_sha256 | string | when read | SHA-256 fingerprint of the certificate |
expiry_at | string | when read | Expiry, ISO 8601 UTC |
key_type | string | when read | RSA 2048, ECDSA P-256 |
machine_name | string | always | The server’s name |
client_version | string | when read | The ACME client: 2.4.1 (simple-acme), lego 4.x |
script_version | string | always | The script’s own version |
installations | array | always | One entry per installation step: plugin and, for a script, script (file name), script_version and (PowerShell) script_sha256 of the file as it lies on the server |
stores | array | notification script | simple-acme’s store plugins of the renewal |
os_version, powershell_version | string | when read | The server’s operating system and PowerShell |
device_model, device_version | string | when read | What the appliance says it is: FortiGate-VM64, v7.4.13 |
meta | object | always | Details for a person: the worker’s log of the attempt (log), the appliance address, attempt number, simple-acme’s error messages |
The scripts never send a password, an API key, a private key, a certificate, their own parameters or simple-acme’s log.
The answer
A report is delivered when the answer’s body is JSON with "ok": true:
{"ok": true}
| Answer | What the script does |
|---|---|
"ok": true | Deletes the report. |
No answer, an HTTP error, a body without "ok": true | Keeps the report and sends it again: the notification script after 1, 5 and 15 minutes and then every hour, the workers with each attempt and then on their own schedule. There is no limit on time or attempts, and a restart of the server does not lose a report. |
A body with "errors" | The receiver read the report and refused its content. Deploy-FortiGate.ps1, Deploy-FortiMail.ps1, Deploy-FortiManager.ps1, Deploy-FortiADC.ps1, Deploy-FortiNAC.ps1, Deploy-FortiWeb.ps1 and the Linux scripts move it to a folder refused beside their outbox and do not send it again, so it cannot hold up the reports behind it. Deploy-PaloAlto.ps1 and FairSSLResultNotification.ps1 keep sending it. |
A receiver therefore answers "ok": true to every report it has stored, also one it has seen before: the same
report can arrive twice when an answer was lost on the way. A receiver that is busy answers anything else, and
the report comes back.
A minimal receiver
Any HTTPS endpoint that stores the body and answers {"ok": true} is a receiver. Reports are small: a few
kilobytes, and tens of kilobytes when a worker’s log of a long attempt is in it.
One script per server, or sslbrain does it for all your servers without scripts.
Feedback and improvements are welcome: info@fairssl.dk