Skip to content

Add a Landlock TCP-egress kernel layer to the process backend#273

Merged
seanwevans merged 1 commit into
mainfrom
claude/project-next-steps-z0t47m
Jul 21, 2026
Merged

Add a Landlock TCP-egress kernel layer to the process backend#273
seanwevans merged 1 commit into
mainfrom
claude/project-next-steps-z0t47m

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

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

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
@seanwevans
seanwevans merged commit f4bdbbe into main Jul 21, 2026
18 checks passed
@seanwevans
seanwevans deleted the claude/project-next-steps-z0t47m branch July 21, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants