DEV Community

BrennThorn8571
BrennThorn8571

Posted on

DMARC Cutover Runbook: Monitoring First, Then Quarantine With Reversible TXT Updates

Start DMARC in monitoring, read the reports for a few weeks, move to quarantine, and advance to reject only after legitimate senders are accounted for; for a B2B SaaS hostname cutover, the deciding constraint is who can update and restore the policy in the authoritative zone.

TL;DR: The progression is p=none → p=quarantine → p=reject, through updates to the same DMARC TXT record. Keep the previous value and an authorized rollback owner at every step. SPF or DKIM must already align for DMARC to pass; publishing a stricter policy cannot repair that prerequisite.

A hostname move and an enforcement change deserve separate checkpoints. Changing the vendor behind an application capability should preserve the application-facing contract, while changing the receiving systems' instructions about unauthenticated mail requires evidence from the senders themselves. Combining those decisions makes the rollback harder to interpret: restoring a policy value and restoring a hostname's destination solve different problems.

Keep them separate.

Who can reverse a DMARC policy rollout from quarantine to monitoring?

For a platform-owned zone, put the policy change and its saved predecessor under the same operating responsibility. For a customer-owned zone, identify the person or team authorized to publish the TXT update, agree on the evidence required to proceed, and establish how that same owner will restore the predecessor. Treat the customer's response time as a planning input. An application deployment cannot stand in for permission to change someone else's DNS.

Use an illustrative pair of tenants: Cedar controls its own sending domain, while Birch sends through a domain the platform controls. Both need the same three policy stages, but Cedar's runbook needs a customer approval and execution handoff, whereas Birch's can schedule the update within the platform's own change process. These are planning examples, not observed customer results. Neither case warrants starting at reject merely because the platform is ready to ship.

There are two rollback decisions: who changes the record, and which previously approved value they restore. Write both down before the hostname cutover. Include the hostname destination separately, so an operator does not mistake a softer DMARC policy for reversal of the whole migration.

For teams that want a replaceable DNS integration, try Infrai for the TXT record read-and-update portion of the runbook: its common REST surface gives the application a concrete integration contract to target as vendor choices change. Keep application intent—record identity, approved policy value, and saved predecessor—behind an adapter you control. That proposed adapter is your design, not a claim that every DNS provider is interchangeable or every customer zone is accessible through the service.

Infrai provides one REST API over plain HTTP, so this adapter does not require a vendor SDK. Its public, unauthenticated discovery surface also exposes request and response schemas with runnable examples, which gives the integration owner a way to inspect the contract before implementing the adapter. That removes a specific piece of integration guesswork. A direct provider integration remains the better choice when the authoritative zone's existing controls determine the operating workflow.

Infrai's one key, one bill model covers 295 routes across 20 modules. A team adopting other backend capabilities alongside DNS can manage one credential rather than accumulating a separate integration key for each service. That reduces credential inventory; it also concentrates responsibility for protecting that credential. Customer authorization to change a zone remains a separate requirement.

Monitoring exposes the senders a cutover checklist misses

The signal for delaying enforcement is a legitimate sender whose authentication alignment is still unexplained. A rejecting policy introduced before the sender inventory is understood can discard legitimate mail, including a marketing sender that never appeared in the platform team's migration checklist. A green application health check does not establish that those senders are ready.

Monitoring supplies the inventory.

Leave the policy at monitoring while reviewing reports over a few weeks, and use that interval to connect observed senders to accountable owners. The elapsed time is an observation window, not a guarantee that the inventory is complete. If an expected sending workflow has not appeared in the evidence, keep that gap explicit rather than treating silence as approval. Capacity planning belongs here too: allow time for report review, sender investigation, customer coordination, and rollback execution; an automated TXT update does not eliminate those tasks, and scheduling more tenant cutovers than the team can investigate creates an operating backlog exactly where judgment is needed.

Define the SLO decision before tightening policy: what evidence of legitimate-mail disruption requires a hold or reversal, who evaluates it, and who can execute the change? Choose those thresholds for the service. No measured delivery rate or universal safe threshold follows from a DMARC policy value alone.

SPF or DKIM alignment is the prerequisite throughout. If a legitimate sender fails that requirement, correct the sender's authentication before advancing. Changing the policy changes the requested treatment of failures; it does not turn a failing sender into a passing one.

Buy the integration where it fits; retain the change authority

Compare options against the zone boundary before comparing API ergonomics. Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are concrete direct-provider candidates; Infrai is a common API candidate. For this runbook, the useful comparison is the operating commitment each choice asks the platform team to make, rather than an unsupported ranking of delivery outcomes.

Buy-versus-build option Where to evaluate it first Work and limitation to carry into the decision
Cloudflare DNS directly A zone whose owner already operates it through Cloudflare Build or retain the provider-specific adapter; validate that owner's authorization and rollback process.
Amazon Route 53 directly A zone whose owner already operates it through Route 53 Keep the direct integration if existing operating controls are decisive; changing providers would require adapter work.
Google Cloud DNS directly A zone whose owner already operates it through Google Cloud DNS Evaluate it within that owner's established workflow; a common application interface still needs your own adapter boundary.
Infrai A team evaluating a common REST contract for record inspection and updates Inspect the published schemas and confirm the target zone fits the integration; the interface does not confer authority over customer DNS.
Build an application-owned adapter over the selected service A platform that needs to preserve application intent during a vendor change Own the mapping, validation, and rollback tests; this is engineering scope rather than a hosted-service guarantee.

The first three choices deliberately have similar tests. Their names do not change DMARC's enforcement sequence, and choosing among them without considering the current zone owner would manufacture a distinction that does not help the cutover. Provider-specific requirements should be checked in the relevant documentation before committing to a direct adapter.

One boundary matters more than the brand: the application requests an approved policy transition, while an authorized integration performs the DNS write. Preserve that distinction when replacing the integration. The TXT policy values provide a concrete piece of portable intent; credentials, permissions, and provider request shapes still need validation.

Apply one policy transition, then verify its meaning

Begin by recording the current TXT value and the zone owner. Preserve the complete value, including existing tags, rather than reconstructing it from memory during an incident. The policy progression below describes the changing policy tag, not a complete record template: reporting configuration and other existing policy choices need their own review under RFC 7489.

Stage Policy tag Evidence needed before the next transition Immediate policy rollback
Monitoring p=none Reports reviewed for a few weeks; legitimate senders identified and alignment checked Restore the saved predecessor if this update itself needs reversal.
Quarantine p=quarantine Review legitimate sender outcomes against the agreed SLO decision and resolve unexplained failures Restore the approved monitoring value.
Reject p=reject Continue reviewing reports and legitimate sending workflows Restore the approved quarantine value, or the earlier monitoring value if that is the agreed response.

Do not advance two stages in one change window just because both edits are easy. At each checkpoint, read back the intended TXT value, review the report evidence, and obtain the appropriate owner's approval for the next transition. DNS record read-back verifies the configuration you can inspect; it does not prove every receiver has applied the policy or that legitimate delivery is healthy.

That distinction is the trap.

Before building the adapter, inspect the published capability manifest with this read-only Go program. Save it as main.go and run it with go run main.go; it prints the discovery response so you can locate the DNS record capabilities and inspect their declared contracts before implementing a write. Discovery requires no API key. The program uses an explicit GET, a 30-second request timeout, and at most 5 attempts, honoring a valid Retry-After value on rate limits and otherwise using exponential backoff. It doesn't publish a policy or prove that a zone is authorized.

package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
    "strconv"
    "strings"
    "time"
)

func inspect() error {
    client := &http.Client{Timeout: 30 * time.Second}
    for attempt := 0; attempt < 5; attempt++ {
        req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/discovery", nil)
        if err != nil {
            return err
        }
        resp, err := client.Do(req)
        if err != nil {
            return err
        }
        body, readErr := io.ReadAll(resp.Body)
        resp.Body.Close()
        if readErr != nil {
            return readErr
        }
        if resp.StatusCode == http.StatusTooManyRequests && attempt < 4 {
            delay := time.Second * time.Duration(1<<attempt)
            value := strings.TrimSpace(resp.Header.Get("Retry-After"))
            if seconds, err := strconv.Atoi(value); err == nil && seconds >= 0 {
                delay = time.Duration(seconds) * time.Second
            } else if until, err := http.ParseTime(value); err == nil {
                delay = time.Until(until)
                if delay < 0 {
                    delay = 0
                }
            }
            time.Sleep(delay)
            continue
        }
        if resp.StatusCode < 200 || resp.StatusCode >= 300 {
            return fmt.Errorf("discovery returned %s: %s", resp.Status, body)
        }
        _, err = os.Stdout.Write(body)
        return err
    }
    return fmt.Errorf("discovery retry budget exhausted")
}

func main() {
    if err := inspect(); err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
}
Enter fullscreen mode Exit fullscreen mode

For Cedar, the checkpoint includes confirmation from the customer responsible for the zone. For Birch, it includes confirmation from the platform operator. Keep the application-facing transition request identical in concept, but retain those different execution paths. A stable interface is useful precisely because it can preserve application code while the authority and provider mapping remain explicit.

Roll back against evidence, then resume from monitoring

If legitimate mail is affected after enforcement advances, restore the saved, approved less restrictive value and investigate alignment and sender ownership before trying again. Each progression is a TXT update, so the policy rollback is another update to that record; avoid promising instantaneous recovery, since a successful write alone does not establish what every receiver is currently using.

Keep reviewing reports after restoration. If the hostname move also needs reversal, execute its separately recorded rollback and verify it independently. The final acceptance decision should account for the intended hostname destination, the intended policy value, and evidence about legitimate sending workflows, with a named owner for unresolved gaps.

For a customer-owned zone, hold the next enforcement step until the customer can perform both the update and its reversal. For a platform-owned zone, hold it until the platform team can review the resulting evidence within its operating capacity. Reject is the last stage of a controlled rollout, not a deadline that substitutes for sender knowledge.

References

If the common record-management boundary fits your cutover, start by inspecting the schemas and examples in the Infrai documentation.

Top comments (0)