Certificate pinning#
When the server connects to another server over TLS, it has to decide whether the certificate it is shown is the right one. The usual answer is "a known authority signed it for this name". That answer fails for much of what a file transfer server talks to: its own DMZ server, the other member of a cluster, a partner's server with a certificate of the partner's own authority, a machine that is reached by its IP address.
For those, the server pins: it remembers the certificate it saw the first time, and from then on accepts that one and refuses a stranger.
CrushMFT 27 pins by default.
When a certificate is accepted#
A certificate that a server presents is accepted when one of these holds, tried in this order:
- It is the pinned one. Exactly the certificate on record for that host, or one that was replaced recently and is still in its grace time, or one whose fingerprint an administrator listed.
- A trusted authority vouches for it, and it is issued for the name or address that was dialed. It is recorded as the host's certificate.
- The host has no pin yet. The certificate is pinned, and written down before the connection is used.
- It is a plain renewal of the pinned one: see below.
Anything else is refused, and stays refused until an administrator acts. Time alone never lets a certificate in: when a pinned certificate expires, nothing opens, and the same certificate is still accepted.
Renewals#
Certificates are replaced regularly. A pin that had to be reset by hand each time would be turned off within a year. So a new certificate is taken as a renewal, without anybody's help, when it fits the way the old one was trusted:
| The pinned certificate | A new one is accepted when |
|---|---|
| came from a public authority | it comes from a trusted authority too, for the same names |
| came from an internal authority that the host sent along | it chains to that same authority and has the same purpose |
| anything else, such as self-signed | it has the same key |
It must also be a server certificate, valid now, and cover every name the pin covers. The links to a DMZ server and to a replication partner only accept the same-key rule.
A certificate that was replaced stays accepted for a while, so that a host with several machines can change them one by one.
Where the pins are#
In the file cert_pins.txt in the server's folder: one line per host. The file is the truth. It is read again for every connection, so a change holds at once, with no restart.
| To | Do |
|---|---|
| see the pins | Encryption, tab Cert Pins |
| accept a certificate that was refused | remove that host's line. The next certificate seen is pinned. |
| start over for all hosts | remove the file |
| accept whatever one host shows | add that host to Trusted domains on the same tab |
Each way of writing a host is a pin of its own: 10.0.1.5, dmz1 and dmz1.example.com are three. The port is not part of it.
Trusted domains#
Trusted domains lists host names, with * and ? as wildcards, whose certificate is taken as it comes: no pin is checked or written. Use it sparingly, for services whose certificates change in ways no rule can follow. Every name on it is a host you have decided not to check.
When a pin blocks#
A refused certificate means one of two things: the other side changed its certificate in a way that is not a plain renewal, or somebody is in between. The server cannot know which, so it stops.
- An alert of the kind Certificate Pin Blocked tells you, if you made one. Make one.
- Ask the owner of the other server whether they changed the certificate, and for its fingerprint.
- If it matches, remove the host's line from
cert_pins.txt.
Do not get into the habit of removing lines without asking. The one time it matters looks exactly like all the others.
What is pinned#
| Connection | Pinned |
|---|---|
| to a DMZ server, to a replication partner, to the other servers of a cluster | always |
| a user's folder or a job's task on another server | when the item is set to pin; items that verify by authority are checked the usual way |
| reverse proxy rules | yes |
| the public services the server itself calls, such as update checks | checked by authority, not pinned |
A pin on the certificate that is built into every copy of CrushMFT only notices a change; it proves nothing, because everybody has that certificate. Give DMZ and cluster links certificates of their own.
Good practice#
- Make the alert.
- Use host names, and always the same name for the same host.
- Give partners notice before you replace a certificate on your server with a new key: their systems may pin too.
- Back up
cert_pins.txtwith the settings.