The net zone's two remaining hardening items are decided, with the reasons where the design is - #35
Merged
Merged
Conversation
…asons where the design is Bridge ports are not pinned. Pinning was designed to contain a routed zone that could re-address its end or forge a frame. That zone does not exist: its bounding set is CAP_NET_BIND_SERVICE alone, a zone policy that would keep either network capability for a routed zone is refused, and packet sockets are refused by family; the launcher suite reads the bounding set and the boundary suite asks for the socket. Pinning would make the same check a second time, inside the zone treated as hostile, and the kernel would have to carry NF_TABLES_BRIDGE and BRIDGE_NETFILTER built in to do it. More kernel reachable from a hostile zone, for a check the capability drop already makes. It comes back on the table if a routed zone is ever allowed a network capability. dhcpcd cannot have its own privilege separation in the net zone. It would need setgroups, which the zone has denied for good, and CAP_SETUID, CAP_SETGID and CAP_SYS_CHROOT, none of which the net zone has. Three more capabilities for the hostile zone so that one program can build a smaller sandbox inside it is a net loss; the zone is the sandbox. The roadmap item asked for the second "or a recorded reason it cannot have it"; the first is a decision not to build, made under the standing instruction to keep the kernel as small as it can be. Docs only.
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.
Docs only. Closes the roadmap's "The net zone's remaining hardening" by deciding both halves and writing the reasons where the design already discusses them (
docs/design/net-zone.md, "Not built, and why it is not a gap in the boundary").Bridge ports are not pinned
Pinning was designed to contain a routed zone that could re-address its end of the veth or forge a frame. That zone does not exist:
CAP_NET_BIND_SERVICEalone (the launcher suite readsCapEff = CapPrm = CapBnd = 0x400from the host side);policy.rsrefuses a zone policy that would keepCAP_NET_ADMINorCAP_NET_RAWfor a routed zone;So it cannot change its address or its MAC, cannot send from an address that is not its own, and cannot put a frame on the wire the kernel did not build for it. Pinning would make the same check a second time, inside the net zone, which is the zone treated as hostile. To do that the kernel would have to carry
NF_TABLES_BRIDGEandBRIDGE_NETFILTERbuilt in, because the net zone loads its rules from inside a user namespace and the kernel will not autoload a module for one. That is more kernel reachable from a hostile zone in exchange for a check the capability drop already makes. It comes back on the table if a routed zone is ever allowed a network capability.dhcpcd cannot have its own privilege separation there
The roadmap asked for it "or a recorded reason it cannot have it". The reason: to separate, dhcpcd must
setgroups,setgid,setuidandchroot. The zone'ssetgroupsisdenyfor good, its passwd is synthesized (root and nobody), and its bounding set isCAP_NET_BIND_SERVICE,CAP_NET_ADMINandCAP_NET_RAW, with none ofCAP_SETUID,CAP_SETGIDorCAP_SYS_CHROOT. Three more capabilities for the hostile zone so that one of its programs can build a smaller sandbox inside it is a net loss. The zone is the sandbox.Whose decision
The second half is what the roadmap asked for. The first is a decision not to build something the roadmap named, made under the owner's standing instruction to keep the kernel as small as it can be and not to build what a simpler mechanism already does. It is one paragraph and one tick to reverse.