refactor: FreeBSD platform support cleanup#205
Merged
Conversation
Restrict output file descriptors to write-only after initialization using cap_rights_limit(). Uses per-FD restrictions instead of cap_enter() to preserve sockstat subprocess for process identification.
… safety notes Document that without cap_enter() the sandbox is FD-level hardening only. Replace std::mem::forget(file) with the more idiomatic file.into_raw_fd(). Add safety comments for the variadic __cap_rights_init FFI call.
domcyrus
added a commit
that referenced
this pull request
Apr 9, 2026
- Windows restricted token sandbox (#206) - macOS Seatbelt sandboxing, later tightened (#196, #203) - Linux sandbox hardening: drop capabilities and clear ambient set (#208) - UI: process privilege shown in security section (#197) - Filter: exact port matching and regex support (#195) - VLAN support in PKTAP/SLL parsers and L3 extraction (#202, #199) - IGMP protocol parsing (#209) - Process name for wildcard /proc/net entries (#218) - CPU efficiency improvements in sort/snapshot/rate/timeout paths (#213, #220, #212, #222) — thanks @deepakpjose - FreeBSD platform cleanup (#205) - Fix default interface selection (#194), root detection on Unix (#192) - Dependency updates
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
cap_rights_limit()withoutcap_enter()does not provide meaningful security (cannot prevent opening new files or sockets)cap_enter()+libcasper+libprocstatmigration)Context
Testing on FreeBSD revealed that the Capsicum sandbox as implemented only restricts already-opened FDs to write-only. Without
cap_enter(), a compromised process can stillopen()arbitrary files (e.g. SSH keys) andconnect()to exfiltrate data. Implementingcap_enter()requires switching fromsockstatsubprocess tolibprocstat(3)library calls and integratinglibcasperfor privileged sysctl access from inside capability mode — tracked in ROADMAP.md.Test plan
test-platform-buildsworkflow)