StackExchange / dnscontrol

Infrastructure as code for DNS!
https://dnscontrol.org/
MIT License
3.13k stars 397 forks source link

Add MTA-STS_BUILDER #3055

Open pro-sumer opened 3 months ago

pro-sumer commented 3 months ago

Is your feature request related to a problem?

Adding MTA Strict Transport Security (MTA-STS) to a domain requires adding several records. For DMARC we have a builder (DMARC_BUILDER); it would be nice if we have one for MTA-STS as well.

Describe the solution you'd like

A new language construct MTA-STS_BUILDER that adds the appropriate CNAME/TXT/A records for MTA-STS:

MTA-STS_BUILDER({
    policy-domain: "@",
    id: "20240721201600",
    rua: [
        "mailto:tlsrpt@example.com",
    ],
}),

Describe alternatives you've considered

Adding those records individually:

[
    CNAME('mta-sts', '@'),
    TXT('_mta-sts', 'v=STSv1; id=20240721201600'),
    TXT('_smtp._tls', 'v=TLSRPTv1; rua=mailto:tlsrpt@example.com; id=20240721201600'),
]

Additional context

More info on setting up MTA-STS records:

tlimoncelli commented 3 months ago

I'm kind of torn on how to handle this kind of submission. On one hand, it is great to be able to offer such macros. On the other hand, we've had problems where the macros get so complex that they need support, and I'm not in a position to support them. In one case we needed to make a breaking change and... that got complex.

Here's some ideas I have:

CC @cafferata for visibility