Skip to content

RFC2136/GSS-TSIG against Active Directory broken on external-dns >= 0.18.0 (works fine on 0.15.0) #6573

Description

@Mick46

Summary

RFC2136 provider with GSS-TSIG authentication against a Windows Active Directory
DNS server works correctly on external-dns v0.15.0, but fails with a GSS-API
error on v0.18.0 and v0.21.0 (haven't tested versions in between). This
prevents upgrading past 0.15.0 for any AD-integrated RFC2136 setup.

Environment

  • external-dns versions tested: v0.15.0 (works), v0.18.0 (fails), v0.21.0 (fails)
  • DNS server: Windows Server Active Directory-integrated DNS (dynamic updates
    set to "Secure only")
  • Auth: --rfc2136-gss-tsig with --rfc2136-kerberos-username /
    --rfc2136-kerberos-password / --rfc2136-kerberos-realm
  • Provider config:
  • --provider=rfc2136
    --rfc2136-gss-tsig
    --rfc2136-tsig-axfr
    --rfc2136-kerberos-realm=
    --rfc2136-kerberos-username=
    --rfc2136-kerberos-password=$(PASSWORD)
    --rfc2136-min-ttl=15m
    --rfc2136-zone=

Error (v0.21.0, --log-level=debug)

{"level":"error","msg":"RFC2136 create record failed: soft error"}
...
unexpected acceptor flag is not set: expecting a token from the acceptor, not in the initiator

Root cause analysis

This traces to github.com/bodgit/tsig (the GSS-TSIG library used by
external-dns's rfc2136 provider), specifically to
gss/gokrb5.go:

apreq, err := spnego.NewKRB5TokenAPREQ(cl, tkt, key,
    []int{gssapi.ContextFlagMutual, gssapi.ContextFlagReplay, gssapi.ContextFlagInteg},
    []int{flags.APOptionMutualRequired})

This is a known, long-standing issue: bodgit/tsig#54
(bodgit/tsig#54), open since 2021, specifically
reproducible against Active Directory DNS servers. The issue reporter traced
it to these exact parameters, and found that the ns1/tsig fork
(https://github.com/ns1/tsig/blob/master/gss/gokrb5.go#L150) uses different
values and does not trigger the error:

apreq, err := spnego.NewKRB5TokenAPREQ(cl, tkt, key,
    []int{gssapi.ContextFlagInteg, gssapi.ContextFlagMutual},
    []int{gssapi.ContextFlagMutual})

I don't know why this resolves the issue, but I can confirm it's reproducible:
external-dns v0.15.0 works against our AD DNS server, and v0.18.0/v0.21.0 do
not, with the exact error above. Something changed between external-dns'
usage/bundled version of bodgit/tsig in 0.15.0 vs later releases that
surfaces this pre-existing library bug.

Related issues

Impact

Anyone using --provider=rfc2136 --rfc2136-gss-tsig against Windows AD is
stuck on external-dns v0.15.0 and cannot safely upgrade (missing newer
features, Gateway API v1 support, other bugfixes, etc.).

Ask

  • Could the external-dns maintainers evaluate pinning/patching bodgit/tsig
    with the flag fix from the ns1/tsig fork, or track/escalate
    bodgit/tsig#54 upstream?
  • Alternatively, is there a supported workaround (e.g. a webhook provider
    path) recommended for AD-backed RFC2136 users on current external-dns
    releases?

Happy to provide full debug logs / test any patched build against our AD
environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions