Consume the claude-sandbox devcontainer feature - #4
Draft
zlrth wants to merge 1 commit into
Draft
Conversation
The Claude-Code- and firewall-shaped parts of .devcontainer — the install, CLAUDE_CONFIG_DIR and the seeded onboarding, init-firewall.sh, the scoped sudoers entry, the NET_ADMIN/NET_RAW caps, the state volume — are now ghcr.io/zlrth/devcontainer-features/claude-sandbox:1, extracted from this repo and published from github.com/zlrth/devcontainer-features. What remains here is only what is shen.clj's own: the JDK/Clojure image, the dev user, the cache-volume mount points, and the Maven/Clojars allowlist. Behavior changes that came with the extraction: - The default permission mode is now acceptEdits (seeded via settings.json), not bypass; bypassPermissions is a documented opt-in on the feature. - Blanket NOPASSWD sudo grants from the base image are removed at build time, so the agent cannot flush its own egress rules. - Claude state lives in a feature-managed volume keyed by devcontainer rather than the hand-named shen-clj-claude-state. Verified from this branch: devcontainer up builds against the published feature; JDK 21 + Clojure 1.12.5 resolve the full :test dep tree through the firewall; clojars reachable, example.com blocked; workspace trusted; sudo scoped to init-firewall.sh alone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Extracts the reusable parts of
.devcontainer/— Claude Code install, persistent auth/state, the default-deny egress firewall, scoped sudo — into a published devcontainer feature,ghcr.io/zlrth/devcontainer-features/claude-sandbox:1, and converts this repo into its first consumer. What remains here is only what is shen.clj's own: the JDK/Clojure image, the dev user, the cache-volume mount points, and the Maven/Clojars allowlist.Behavior changes that came with the extraction:
settings.json), not bypass.bypassPermissionsis a documented opt-in on the feature.NOPASSWDsudo grants from base images are removed at build time — without that, the agent couldsudo iptables -Fand the egress rules were decorative. (The old hand-rolled setup didn't have this hole because theclojureimage has no sudoers entries, but the feature also targets thedevcontainers/baseimages, which do.)${devcontainerId}instead of the hand-namedshen-clj-claude-state. The old volume is orphaned;docker volume rm shen-clj-claude-statereclaims it.Verified from this branch:
devcontainer upbuilds against the published feature; JDK 21 + Clojure 1.12.5 resolve the full:testdep tree through the firewall; clojars reachable,example.comblocked; workspace trusted; sudo scoped toinit-firewall.shalone.🤖 Generated with Claude Code