Skip to content

Commit 5930794

Browse files
committed
Document peer certificate fingerprinting
1 parent 2aecda0 commit 5930794

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

data/settings.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10290,6 +10290,17 @@ The most common choices are \`commonName\` and \`x500UniqueIdentifier\`.
1029010290
Note: [[setting,auth_ssl_username_from_cert]] MUST be enabled.`
1029110291
},
1029210292

10293+
ssl_peer_certificate_fingerprint_hash: {
10294+
default: '',
10295+
seealso: [ 'ssl', '[[link,ssl_configuration]]', '[[link,passdb_check_client_fp]]' ],
10296+
values: setting_types.STRING,
10297+
text: `
10298+
An OpenSSL digest algorithm name to use to hash peer certificate names.
10299+
Setting this value is required for \`ssl_client_cert_fp\` and \`ssl_client_cert_pubkey_fp\`
10300+
availability in [[setting,login_log_format_elements]] and also in authentication
10301+
variables. Weak algorithms are explicitly disallowed, such as MD5.`,
10302+
},
10303+
1029310304
ssl_cipher_list: {
1029410305
default: 'ALL:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@STRENGTH (for ssl_server, empty for ssl_client)',
1029510306
seealso: [ 'ssl', 'ssl_cipher_suites', 'ssl_min_protocol', '[[link,ssl_configuration]]' ],

docs/core/config/auth/passdb.md

Lines changed: 39 additions & 0 deletions
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,42 @@ 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+
This is intended to replace CA certificates with verifying client certificates using fingerprints, or to enforce
453+
that particular public key or certificate is being used.
454+
455+
To enable this feature, you need to configure:
456+
457+
* [[setting,auth_ssl_require_client_cert,yes]]
458+
* [[setting,ssl_peer_certificate_fingerprint_hash,sha256]], or some other valid hash
459+
* [[setting,ssl_server_request_client_cert,any-cert]] if you don't want to validate cert against certificate authority
460+
461+
::warning If CA certificates are not used, a passdb must provide a valid check_client_fp (or variant) to validate the
462+
client certificate. If none is provided, the authentication will fail.
463+
464+
When feature is enabled, and certificate has not been validated by certificate authority (or is self-signed), at least one passdb must successfully match the fingerprint, otherwise the whole authentication will fail with "Client didn't present valid SSL certificate".
465+
466+
If your certificate is authenticated by certificate authority, using any of the fingerprint matching keywords will fail that passdb if the fingerprint does not match, but next password database can still authenticate the user. Note though that none of the passdbs are required to successfully match the fingerprint in this case.
467+
468+
##### `check_client_cert_fp`
469+
470+
Match client certificate fingerprint. See [[setting,ssl_peer_certificate_fingerprint_hash]].
471+
472+
Certificate fingerprint is calculated by taking hash value of DER encoded X509 client certificate.
473+
474+
See [[link,passdb_check_client_fp]]
475+
476+
##### `check_client_pubkey_fp
477+
`
478+
Match client public key fingerprint (but not certificate). See [[setting,ssl_peer_certificate_fingerprint_hash]].
479+
480+
Public key fingerprint is calculated by taking hash value of DER encoded certificate public key.
481+
482+
See [[link,passdb_check_client_fp]]
483+
445484
#### `forward_<anything>`
446485

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

docs/core/settings/variables.md

Lines changed: 4 additions & 0 deletions
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)