Fix nftables comment quoting and add cgroup isolation toggle#65
Closed
sunkadshreyas wants to merge 1 commit into
Closed
Fix nftables comment quoting and add cgroup isolation toggle#65sunkadshreyas wants to merge 1 commit into
sunkadshreyas wants to merge 1 commit into
Conversation
Three bugs prevented leash from starting on Docker Desktop Kubernetes: 1. nftables comment quoting: Comments like "leash:return-mitm" weren't wrapped in nft-level quotes, causing all nftables rules to fail because ':' is a special token in nft's parser. 2. nftables cgroup path quoting: The cgroup hierarchy path passed to "socket cgroupv2 level 1" wasn't quoted, causing '/' to be parsed as a division operator. 3. Docker Desktop's LinuxKit kernel lacks xt_cgroup (iptables) and nft socket cgroupv2 support, making cgroup-based control plane isolation impossible on that platform. Changes: - Fix ensure_rule() comment quoting in apply-nftables.sh - Fix cgroup path quoting in apply-nftables.sh - Add LEASH_CGROUP_ISOLATION env var (default: "required") to all three scripts so callers can set "optional" for environments where the kernel lacks cgroup matching support - Add nftables package to Dockerfile.leash runtime-base so the preferred nftables code path is available Fixes strongdm#64 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Different solution merged in #66 |
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.
Summary
ensure_rule()comment quoting — colon in comment strings (e.g.,leash:return-mitm) caused nft parser syntax errors, breaking all nftables rules/insocket cgroupv2 level 1path caused nft parser errorLEASH_CGROUP_ISOLATIONenv var (defaultrequired, setoptionalfor Docker Desktop) so leash can start without cgroup-based control plane isolation on kernels that lackxt_cgroup/nft socket cgroupv2supportnftablespackage toDockerfile.leashruntime-base so the preferred nftables code path is availableTest plan
LEASH_CGROUP_ISOLATION=optionalallows leash to start on Docker Desktop (LinuxKit kernel 6.10.14)Fixes #64
🤖 Generated with Claude Code