Add a Landlock TCP-egress kernel layer to the process backend#273
Merged
Conversation
The process backend confined the guest's syscalls (seccomp), filesystem (Landlock), and capability classes (eBPF/LSM deny-mask) at the kernel, but network egress was still only a userspace thread-local guard that adversarial Python can bypass with a raw socket. Map the policy's TCP allow-list onto Landlock's network rules (ABI >= 4, Linux 6.7+): the kernel now denies connect() to any port the policy did not allow-list. Landlock keys on port, not address, so this is a coarse kernel backstop beneath the userspace host:port guard, applied only when every allow-listed destination carries a parseable port (otherwise an inexact default-deny ruleset could block a permitted destination). The filesystem and network rules share one ruleset; each access class is handled only when its allow-list is non-empty so a default-deny layer never breaks the interpreter. The outcome is recorded in the confinement report (landlock_net / landlock_net_ports) and the threat model, SECURITY.md, and README are updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PbbJc7Ntj159D9LNGevwC2
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.
The process backend confined the guest's syscalls (seccomp), filesystem (Landlock), and capability classes (eBPF/LSM deny-mask) at the kernel, but network egress was still only a userspace thread-local guard that adversarial Python can bypass with a raw socket.
Map the policy's TCP allow-list onto Landlock's network rules (ABI >= 4, Linux 6.7+): the kernel now denies connect() to any port the policy did not allow-list. Landlock keys on port, not address, so this is a coarse kernel backstop beneath the userspace host:port guard, applied only when every allow-listed destination carries a parseable port (otherwise an inexact default-deny ruleset could block a permitted destination). The filesystem and network rules share one ruleset; each access class is handled only when its allow-list is non-empty so a default-deny layer never breaks the interpreter.
The outcome is recorded in the confinement report (landlock_net / landlock_net_ports) and the threat model, SECURITY.md, and README are updated.
Claude-Session: https://claude.ai/code/session_01PbbJc7Ntj159D9LNGevwC2