Skip to content

Commit d8f6c94

Browse files
authored
Merge pull request #92 from oh2fih/master
Warn about overriding DANE
2 parents b1ef575 + d9cff18 commit d8f6c94

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ postfix-mta-sts-resolver
33

44
[![Build Status](https://travis-ci.org/Snawoot/postfix-mta-sts-resolver.svg?branch=master)](https://travis-ci.org/Snawoot/postfix-mta-sts-resolver) [![Coverage](https://img.shields.io/badge/coverage-97%25-4dc71f.svg)](https://travis-ci.org/Snawoot/postfix-mta-sts-resolver) [![PyPI - Downloads](https://img.shields.io/pypi/dm/postfix-mta-sts-resolver.svg?color=4dc71f&label=PyPI%20downloads)](https://pypistats.org/packages/postfix-mta-sts-resolver) [![PyPI](https://img.shields.io/pypi/v/postfix-mta-sts-resolver.svg)](https://pypi.org/project/postfix-mta-sts-resolver/) [![PyPI - Status](https://img.shields.io/pypi/status/postfix-mta-sts-resolver.svg)](https://pypi.org/project/postfix-mta-sts-resolver/) [![PyPI - License](https://img.shields.io/pypi/l/postfix-mta-sts-resolver.svg?color=4dc71f)](https://pypi.org/project/postfix-mta-sts-resolver/) [![postfix-mta-sts-resolver](https://snapcraft.io//postfix-mta-sts-resolver/badge.svg)](https://snapcraft.io/postfix-mta-sts-resolver) ![CodeQL](https://github.com/Snawoot/postfix-mta-sts-resolver/workflows/CodeQL/badge.svg)
55

6-
Daemon which provides TLS client policy for Postfix via socketmap, according to domain MTA-STS policy. Current support of RFC8461 is limited - daemon lacks some minor features:
6+
Daemon which provides TLS client policy for Postfix via socketmap, according to domain MTA-STS policy.
77

8-
* Fetch error reporting
9-
* Fetch ratelimit (but actual fetch rate partially restricted with `cache_grace` config option).
8+
Current support of [RFC 8461](https://www.rfc-editor.org/rfc/rfc8461) is limited:
9+
10+
* [MTA-STS policy overrides DANE TLS authentication](#warning-mta-sts-policy-overrides-dane-tls-authentication) against [RFC 8461, 2](https://www.rfc-editor.org/rfc/rfc8461#section-2).
11+
12+
* Daemon lacks some minor features:
13+
14+
* Fetch error reporting.
15+
* Fetch ratelimit (but actual fetch rate partially restricted with `cache_grace` config option).
1016

1117
Server has configurable cache backend which allows to store cached STS policies in memory (`internal`), file (`sqlite`) or in Redis database (`redis`).
1218

@@ -186,6 +192,40 @@ If your configuration already has some TLS policy maps, just add MTA-STS socketm
186192
Reload Postfix after reconfiguration.
187193

188194

195+
### Warning: MTA-STS policy overrides DANE TLS authentication
196+
197+
Due to Postfix's limitations, a resolved MTA-STS policy overrides DANE TLS authentication ([RFC 6698](https://www.rfc-editor.org/rfc/rfc6698)), because DANE is an internal feature of Postfix, and the postfix-mta-sts-resolver always responds with a ([`smtp_tls_policy_maps`](https://www.postfix.org/postconf.5.html#smtp_tls_policy_maps)) lookup result `secure` for [Secure server certificate verification](https://www.postfix.org/TLS_README.html#client_tls_secure).
198+
199+
* The resulting behaviour is against [RFC 8461, 2](https://www.rfc-editor.org/rfc/rfc8461#section-2):
200+
> However, MTA-STS is designed not to interfere with DANE deployments when the two overlap; in particular, senders who implement MTA-STS validation MUST NOT allow MTA-STS Policy validation to override a failing DANE validation.
201+
202+
Domains implementing both MTA-STS and DANE probably want DANE to be preferred:
203+
204+
* DANE allows strict binding of certificates; the policy can authorize only a certain certificate or certificates from a certain CA. With MTA-STS, a certificate from any trusted CA is automatically trusted; [RFC 8461, 10.1](https://www.rfc-editor.org/rfc/rfc8461#section-10.1):
205+
206+
> SMTP MTA-STS relies on certificate validation via PKIX-based TLS identity checking [RFC6125]. Attackers who are able to obtain a
207+
valid certificate for the targeted recipient mail service (e.g., by compromising a CA) are thus able to circumvent STS authentication.
208+
209+
* Based on DNSSEC, DANE not vulnerable to downgrade attack that could prevent policy discovery. MTA-STS security considerations acknowledges this weakness in [RFC 8461, 10.2](https://www.rfc-editor.org/rfc/rfc8461#section-10.2):
210+
211+
> Since MTA-STS uses DNS TXT records for policy discovery, an attacker who is able to block DNS responses can suppress the discovery of an
212+
MTA-STS Policy, making the Policy Domain appear not to have an MTA-STS Policy.
213+
214+
> Resistance to downgrade attacks of this nature -- due to the ability to authoritatively determine "lack of a record" even for non-participating recipients -- is a feature of DANE, due to its use of DNSSEC for policy discovery.
215+
216+
* The postfix-mta-sts-resolver does not intent to implement policy lookups for DANE, and responses other than `secure` with `match=` would not verify the TLS certificate as required by [RFC 8461, 4,2](https://www.rfc-editor.org/rfc/rfc8461#section-4.2).
217+
218+
If you wish to meet this requirement:
219+
220+
* List a DANE policy resolver responding with `dane-only` (for [Mandatory DANE](https://www.postfix.org/TLS_README.html#client_tls_dane)) before postfix-mta-sts-resolver in `smtp_tls_policy_maps` lookup table list.
221+
222+
* Alternatively, you could use a static lookup table for domains known to implement both MTA-STS & DANE, e.g.,
223+
224+
```
225+
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy,socketmap:inet:127.0.0.1:8461:postfix
226+
```
227+
228+
189229
## Operability check
190230
191231
Assuming default MTA-STA daemon configuration. Following command:

man/mta-sts-daemon.1.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ Reload Postfix. Then verify it works:
5050

5151
*/usr/sbin/postmap -q dismail.de socketmap:inet:127.0.0.1:8461:postfix*
5252

53+
This configuration overrides DANE TLS authentication. If you wish to meet the
54+
requirement of RFC 8461, section 2, you should list a DANE policy resolver (or
55+
a static lookup table for domains known to implement both MTA-STS & DANE) before
56+
mta-sts-daemon in smtp_tls_policy_maps.
57+
5358
== See also
5459

5560
*mta-sts-query*(1), *mta-sts-daemon.yml*(5)

0 commit comments

Comments
 (0)