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.
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
set to "Secure only")
--rfc2136-gss-tsigwith--rfc2136-kerberos-username/--rfc2136-kerberos-password/--rfc2136-kerberos-realm--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 byexternal-dns's rfc2136 provider), specifically to
gss/gokrb5.go: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/tsigfork(https://github.com/ns1/tsig/blob/master/gss/gokrb5.go#L150) uses different
values and does not trigger the error:
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/tsigin 0.15.0 vs later releases thatsurfaces this pre-existing library bug.
Related issues
during verify, not during AP_REQ negotiation), but likely related root
cause in the same GSS-TSIG/AD code path
error, open since 2021, not yet fixed
Impact
Anyone using
--provider=rfc2136 --rfc2136-gss-tsigagainst Windows AD isstuck on external-dns v0.15.0 and cannot safely upgrade (missing newer
features, Gateway API v1 support, other bugfixes, etc.).
Ask
bodgit/tsigwith the flag fix from the
ns1/tsigfork, or track/escalatebodgit/tsig#54upstream?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.