fix(devcontainer): don't abort firewall setup when an optional domain fails to resolve - #81673
Open
ozdemirsarman wants to merge 1 commit into
Open
Conversation
… fails to resolve
init-firewall.sh runs under `set -e` and exits 1 as soon as any domain in the
allowlist fails to resolve. Since statsig.anthropic.com stopped resolving, that
single NXDOMAIN aborts the whole script: the ipset is left half-populated, the
default DROP policies are never applied, and the devcontainer fails to start
with exit code 1.
A telemetry or marketplace endpoint disappearing should not be able to break
container startup. The domain list is split into required domains, which still
fail loudly because the container is useless without them, and optional ones,
which are skipped with a warning and summarized at the end so the reason for a
later connection failure stays visible.
Invalid (non-IPv4) DNS answers get the same treatment: hard error for required
domains, skip with a warning otherwise.
Verified with a stubbed `dig`/`ipset`:
statsig.anthropic.com unresolvable
before: "ERROR: Failed to resolve statsig.anthropic.com", exit 1
after: warning, remaining domains still added, exit 0
api.anthropic.com unresolvable (required)
after: "ERROR: Failed to resolve required domain api.anthropic.com", exit 1
all domains resolvable
after: unchanged behaviour, exit 0
shellcheck clean.
Fixes anthropics#55623
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #55623
The problem
init-firewall.shruns underset -eand exits 1 as soon as any domain in theallowlist fails to resolve. Since
statsig.anthropic.comstopped resolving, thatsingle NXDOMAIN aborts the whole script: the ipset is left half-populated, the
default DROP policies are never applied, and the devcontainer fails to start with
exit code 1.
A telemetry or marketplace endpoint disappearing should not be able to break
container startup.
The fix
The domain list is split in two:
api.anthropic.com,registry.npmjs.org) — still fail loudly, thecontainer is useless without them.
summarized at the end, so the reason for a later connection failure stays visible
rather than being silently swallowed.
Invalid (non-IPv4) DNS answers get the same treatment: hard error for required
domains, skip with a warning otherwise.
Testing
Verified with a stubbed
dig/ipset:bash -nandshellcheckclean.