Privacy archetype: Tor-only egress, fail-closed firewall, nothing persists #143
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#143
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Give the privacy archetype the hardening every privacy VM repeats by hand today: Tor-only egress, a fail-closed firewall, nothing persisted off the data disk, a locked kernel; so a fork gets a privacy machine by declaring one, the way it gets a service machine.
Primary goals:
policy dropon input, forward and output, loopback and established traffic accepted, the Tor uid accepted, and the DHCP exchange as the only root exception; NetworkManager ordered after nftables so no interface comes up without a table./tmpcleaned on boot, core dumps disabled,dmesgrestricted, no swap.services.resolvedandservices.timesyncdoff;security.lockKernelModulesafter boot.nix/builders/service.nix: aprivacyModuleslist composed beforedefinition.nixosModules, with assertions that fail the build when a profile widens the posture by accident.Current state and specifics
nix/builders/privacy.nixcomposes the shared guest base and the profile's modules and nothing else, whilenix/builders/service.nixcarries the service posture (root-only login, the data-disk filesystem, the firewall,service-egress.nixwith its assertions). Three private privacy profiles in one deployment, a bitcoin node, a wallet machine and a nostr signer, each carry the same hardening block by hand, drift included: the block in the node profile proposed for the template in allod/profiles#14 is the reference copy. Each profile also adds what is its own: the node's one-way clearnet exception for the first sync, a chain the base ruleset jumps to that its switch empties once the sync finishes; the wallet's display and clipboard, which needuinputloaded before the kernel locks and spice allowed through; the signer's loopback relay.Those additions are the seam test. The clearnet exception must stay expressible as "add this rule to the exception chain until the marker exists" without the profile owning the ruleset; the display exception must stay a profile addition that the archetype's assertions do not refuse.
security.lockKernelModuleswith a module the profile needs loaded is the known trap: the profile has to list it inboot.kernelModulesso it loads before the lock.The witness is derivation equality on the existing privacy machine: composed through the new archetype with its profile reduced to the service-specific remainder,
config.system.build.toplevel.drvPathequals today's, or the diff names only the lines that moved. The fork-safety fixture gains a privacy machine so a fork's privacy profile is checked against the posture too.Scope
In:
nix/builders/privacy.nixand aprivacy-egress.nixbesideservice-egress.nix, the exception-chain option, the assertions, the fork fixture, the README's Builders section. Out: the profiles themselves, which shrink in their own repos once this lands; the bitcoin node profile's move to the template, allod/profiles#14, which lands first so the archetype has a public consumer to witness against.