Skip to content

Sign DNS requests by default, for the endpoint's region (#883) - #889

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/883-windows-dns-signing
Oct 13, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/883-windows-dns-signing

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #883

The defect

spored SigV4-signs DNS requests only when SPORE_DNS_SIGV4 is set, and only the three Linux systemd units set it. The Windows service (spored service install) sets no environment, so Windows spored sent unsigned requests, and the AuthType: AWS_IAM Function URL refuses those with 403 regardless of resource policy. Observed on a v0.128.0 Windows spore during #879's validation:

spawn:dns-error = DNS API returned HTTP 403: {"Message":"Forbidden"}

So Windows spores couldn't register DNS — and the DNS lease from #875 couldn't work on Windows.

The opt-in existed to stage the #173 cutover: ship a signing client before flipping the URL to AWS_IAM. Its own comment said "the flip and the default-on switch happen in lockstep". The flip happened; the switch never did. It only looked done because the Linux units set the variable.

The fix

Signing is the default. SPORE_DNS_SIGV4=0 (or false/off/no) is an explicit opt-out for a deployment that genuinely runs an unauthenticated endpoint. An unset variable signs. The =1 the Linux units still set is harmless and left alone.

The signature is scoped to the Function URL's region. Found while making signing default: the region was the client's ambient cfg.Region, falling back to us-east-1. That was right by accident — LoadDefaultConfig doesn't read the region from IMDS, so on an instance it was usually empty and the fallback matched the URL. Any spored environment with AWS_REGION set outside us-east-1 would sign for the wrong region and be refused. The region now comes from the endpoint's own hostname (<id>.lambda-url.<region>.on.aws), which cannot disagree with the endpoint; the ambient region is only a fallback for a custom endpoint whose hostname carries none.

For the production URL this changes nothing on Linux — its region is us-east-1, the same value the fallback produced.

Gates

test revert that fails it
a client with no environment signs — exactly the Windows service's situation back to opt-in
the region follows the endpoint even with AWS_REGION=eu-west-2, end to end through NewClient back to the ambient region
explicit opt-outs disable signing; 1/true/unset all sign opt-out ignored

Not yet: validation on real Windows

spored reaches instances only through a release, so the end-to-end proof — a Windows spore registering DNS, with a lease — is a short Windows launch after the next release. Flagging it rather than claiming it.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

spored signed DNS requests only when SPORE_DNS_SIGV4 was set, and only the Linux
systemd units set it. The Windows service sets no environment, so Windows spored
sent unsigned requests and the AWS_IAM Function URL refused them with 403 —
observed on a v0.128.0 Windows spore. The opt-in existed to stage the #173
cutover; the default-on switch it promised never happened. Signing is now the
default, with an explicit SPORE_DNS_SIGV4=0 opt-out.

The signing region also came from the ambient config, correct only because
LoadDefaultConfig does not read the region from IMDS and the us-east-1 fallback
happened to match. It now comes from the Function URL's own hostname.

Closes #883
@scttfrdmn
scttfrdmn force-pushed the fix/883-windows-dns-signing branch from 99fa653 to ba8fb39 Compare October 13, 2026 19:14
@scttfrdmn
scttfrdmn merged commit 3edc0d6 into main Oct 13, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/883-windows-dns-signing branch October 13, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows spored never signs DNS requests, so Windows DNS (and DNS leases) are refused

1 participant