Forbid target container from communicating with control plane#54
Merged
Conversation
…ane API This change blocks the target container from reaching the leashd control plane API. Previously, a process running inside the target container could potentially connect to leashd's HTTP API (default port 18080) and interact with the control plane. This is a security boundary violation - a compromised AI agent should not be able to access the policy management API. How it works: The iptables/nftables rule matches packets originating from the target container's cgroup and destined for the leashd control port, then rejects them with TCP reset. This blocks all interfaces (localhost, LAN, etc.) since the rule targets the port regardless of destination IP. Files changed: - internal/assets/apply-iptables.sh: Added iptables rule using cgroup matching to block target container from leashd port - internal/assets/apply-nftables.sh: Added equivalent nftables rule for systems using nftables - internal/assets/apply-ip6tables.sh: Added IPv6 equivalent rule - internal/leashd/runtime.go: Updated to pass leashd port and cgroup path to the firewall scripts - e2e/integration/integration_test.go: Added integration test 'baseline/control-plane-isolation' to prevent regressions Security: https://github.com/strongdm/leash/security/advisories/GHSA-9x85-c42x-79cx
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.
fix(security): block target container from reaching leashd control plane API
This change blocks the target container from reaching the leashd control
plane API. Previously, a process running inside the target container could
potentially connect to leashd's HTTP API (default port 18080) and interact
with the control plane. This is a security boundary violation - a
compromised AI agent should not be able to access the policy management API.
How it works:
The iptables/nftables rule matches packets originating from the target
container's cgroup and destined for the leashd control port, then rejects
them with TCP reset. This blocks all interfaces (localhost, LAN, etc.)
since the rule targets the port regardless of destination IP.
Files changed:
matching to block target container from leashd port
systems using nftables
to the firewall scripts
'baseline/control-plane-isolation' to prevent regressions
Addresses and resolves GHSA-9x85-c42x-79cx.