Skip to content

DKIM probe is CNAME-only → Google Workspace (TXT google._domainkey) not detected; asymmetric vs Microsoft #28

Closed

Description

@fpietrosanti

Hi David — thanks for mxmap and the ESORICS work. We run a downstream fork focused on the Italian public administration (mxmap.it). While auditing inbound email-security gateways we hit what looks like an asymmetry in DKIM-based provider detection, and we'd like to validate it with you before sending a PR.

Observation

probes.probe_dkim queries each DKIM selector as a CNAME:

# src/mail_sovereignty/probes.py
async def probe_dkim(domain: str) -> list[Evidence]:
    """Query DKIM selector CNAMEs and match targets."""
    for sig in SIGNATURES:
        for selector in sig.dkim_selectors:
            qname = f"{selector}._domainkey.{domain}"
            answer = await resolve_robust(qname, "CNAME")   # CNAME only
            ...
            if match_patterns(target, sig.dkim_cname_patterns):
                ...  # Evidence(kind=DKIM, ...)

This works for Microsoft 365, whose selector1._domainkey is a CNAME → *.onmicrosoft.com.

But the Google signature also expects a CNAME:

# src/mail_sovereignty/signatures.py — Provider.GOOGLE
dkim_selectors=("google", "google2048"),
dkim_cname_patterns=("domainkey.google.com",),

Google Workspace publishes google._domainkey.<domain> as a TXT DKIM key (v=DKIM1; k=rsa; p=…), not a CNAME to domainkey.google.com. So the CNAME query returns nothing and dkim_cname_patterns=("domainkey.google.com",) (almost) never matches a real Workspace domain → no DKIM evidence for Google.

Impact

DKIM carries the highest single weight (WEIGHTS[DKIM] = 0.15). When the MX is an inbound security gateway/relay that hides the real provider (Libraesva, Proofpoint, Barracuda, regional relays…), Microsoft still wins via its DKIM CNAME, but Google loses its strongest signal and falls back to weaker/optional ones (_spf.google.com, google-site-verification=) — or to "independent/unknown". Net effect: Google Workspace is under-detected behind gateways, asymmetrically vs Microsoft.

Real-world evidence

Italian regional healthcare: sardegnasalute.it is an inbound antispam relay in front of ~11 regional health agencies (ASL). Their domains publish a Google Workspace DKIM TXT at google._domainkey.<domain> and include:_spf.google.com, yet emit no DKIM evidence under the CNAME-only probe. Verifiable today:

  • aslnuoro.it → google._domainkey.aslnuoro.it IN TXT v=DKIM1; k=rsa; p=…
  • aslgallura.it → same; MX = mx0X.sardegnasalute.it (relay, non-Google IP)

Question / validation request

  1. Is the CNAME-only DKIM probe intentional, rather than also reading the selector as TXT and recognizing a v=DKIM1 key?
  2. Would you accept a PR that, when a selector does not resolve as CNAME, falls back to a TXT lookup and emits DKIM evidence on a v=DKIM1 key (e.g. Google for google/google2048)?

We have a concrete dataset (Italian PA) where this materially changes provider attribution, and we're happy to contribute the fix + tests once you confirm the direction. Downstream tracking issue to follow.

Thanks!

Activity

  1. fpietrosanti commented on Jun 18, 2026

    @fpietrosanti
    Author

    Downstream tracking issue (with the same evidence + our planned fix, held until you validate the direction here): mxmap-it/mxmap.it#17

  2. davidhuser commented on Aug 18, 2026

    @davidhuser
    Collaborator

    Thank you for the detailed report, this is exactly the kind of probe refinement worth pursuing. As announced in #30, the Swiss pipeline here is frozen and won't see further probe development, so I'm closing this in favor of the successor project, where classification and the new security-scanning stage are actively developed: https://github.com/mxmap/secassure2026. Would you mind refiling there so the DKIM detection asymmetry can be looked at? Much appreciated.

  3. fpietrosanti commented on Aug 19, 2026

    @fpietrosanti
    Author

    Re-filed on the successor as requested — since issues are disabled there, it went in as a PR with the fix and field-validation data included: mxmap/secassure2026#34. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions