Skip to content

Commit d0bd021

Browse files
committed
Document peer certificate fingerprinting
1 parent 21c96ab commit d0bd021

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

data/settings.js

+11
Original file line numberDiff line numberDiff line change
@@ -10265,6 +10265,17 @@ The most common choices are \`commonName\` and \`x500UniqueIdentifier\`.
1026510265
Note: [[setting,auth_ssl_username_from_cert]] MUST be enabled.`
1026610266
},
1026710267

10268+
ssl_peer_certificate_fingerprint_hash: {
10269+
default: '',
10270+
seealso: [ 'ssl', '[[link,ssl_configuration]]', '[[link,passdb_check_client_fp]]' ],
10271+
values: setting_types.STRING,
10272+
text: `
10273+
An OpenSSL digest algorithm name to use to hash peer certificate names.
10274+
Setting this value enables \`ssl_client_cert_fp\` and \`ssl_client_cert_pubkey_fp\`
10275+
availability in [[setting,login_log_format_elements]] and also in authentication
10276+
variables. Weak algorithms are explicitly blacklisted, such as MD5.`,
10277+
},
10278+
1026810279
ssl_cipher_list: {
1026910280
default: 'ALL:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH (for ssl_server, empty for ssl_client)',
1027010281
seealso: [ 'ssl', 'ssl_cipher_suites', 'ssl_min_protocol', '[[link,ssl_configuration]]' ],

docs/core/config/auth/passdb.md

+36
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ dovecotlinks:
1818
passdb_result_values:
1919
hash: result-values
2020
text: "passdb: Result Values"
21+
passdb_check_client_fp:
22+
hash: check-client-fp
23+
text: "passdb: check_client_fp Extra field"
2124
---
2225

2326
# Password Databases (`passdb`)
@@ -442,6 +445,39 @@ a load spike of everybody getting logged in at exactly the same time.
442445

443446
Do not perform any authentication, just store extra fields if user is found.
444447

448+
##### `check_client_fp`
449+
450+
Match client certificate or public key fingerprint.
451+
452+
Requires configuring [[setting,ssl_peer_certificate_fingerprint_hash]], [[setting,auth_ssl_require_client_cert]],
453+
and [[setting,ssl_server_request_client_cert]] to require a client cert.
454+
455+
This is intended to replace CA certificates with verifying client certificates using fingerprints, or to enforce
456+
that particular public key is being used. If you are using CA certificates,
457+
you can only fail authentication if the value is non-empty and does not match. If CA certificates are not used, then
458+
if no passdb matches the fingerprint, then authentication is failed.
459+
460+
The failure is per-passdb, so next passdb can continue authenticating the user.
461+
462+
::warning If CA certificates are not used, a passdb must provide a valid check_client_fp (or variant) to validate the
463+
client certificate. If none is provided, the authentication will fail.
464+
465+
##### `check_client_cert_fp`
466+
467+
Match client certificate fingerprint. See [[setting,ssl_peer_certificate_fingerprint_hash]].
468+
469+
Certificate fingerprint is calculated by taking hash value of DER encoded X509 client certificate.
470+
471+
See [[link,passdb_check_client_fp]]
472+
473+
##### `check_client_pubkey_fp
474+
`
475+
Match client public key fingerprint (but not certificate). See [[setting,ssl_peer_certificate_fingerprint_hash]].
476+
477+
Public key fingerprint is calculated by taking hash value of DER encoded certificate public key.
478+
479+
See [[link,passdb_check_client_fp]]
480+
445481
#### `forward_<anything>`
446482

447483
In a proxy, pass the variable to the next hop (backend) as

docs/core/settings/variables.md

+4
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ See also:
287287
| `ssl_security` | TLS session security string. If HAProxy is configured and it terminated the TLS connection, contains "(proxied)". |
288288
| `ssl_ja3` | [[link,ssl_ja3]] composed from TLS Client Hello. |
289289
| `ssl_ja3_hash` | MD5 hash from [[link,ssl_ja3]] composed from TLS Client Hello. |
290+
| `ssl_client_cert_fp` | [[setting,ssl_peer_certificate_fingerprint_hash]] of client certificate. |
291+
| `ssl_client_cert_pubkey_fp` | [[setting,ssl_peer_certificate_fingerprint_hash]] of client certificate public key. |
290292
| `mail_pid` | PID for process that handles the mail session post-login. |
291293
| `original_user` | Same as `user`, except using the original username the client sent before any changes by auth process. With master user logins (also with [[setting,auth_master_user_separator]] based logins),this contains only the original master username. |
292294
| `listener` | Socket listener name as specified in config file, which accepted the client connection. |
@@ -322,6 +324,8 @@ See also:
322324
| `password` | Cleartext password from cleartext authentication mechanism. |
323325
| `secured` | "TLS" with established SSL/TLS connections, "secured" with secured connections (see: [[setting,ssl]]). Otherwise empty. |
324326
| `ssl_ja3_hash` | MD5 hash from JA3 string composed from TLS Client Hello. |
327+
| `ssl_client_cert_fp` | [[setting,ssl_peer_certificate_fingerprint_hash]] of client certificate. |
328+
| `ssl_client_cert_pubkey_fp` | [[setting,ssl_peer_certificate_fingerprint_hash]] of client certificate public key. |
325329
| `cert` | "valid" if client had sent a valid client certificate, otherwise empty. |
326330
| `login_user` | For master user logins: Logged in user@domain. |
327331
| `master_user` | For master user logins: The master username. |

0 commit comments

Comments
 (0)