A remote-administration module for a hypervisor nobody sits at #68
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/nexus#68
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 a hypervisor that nobody sits at a way to be administered over SSH, as a module that machine imports, so that a hypervisor which does not import it has no listener by construction.
Primary goals:
nixosModules.remoteAdminhas noenableoption; a machine either imports it or runs no sshd, the shapeallod/archetypesmodules/public-host.nixalready uses for internet-facing machines.Current state and specifics
The host module runs no sshd and opens no port:
nix/configuration.nixsetsnetworking.firewall.allowedTCPPorts = [ ]and noservices.opensshoption. That is the right posture for a machine someone sits at, and it is the only posture available. A headless hypervisor has no way in.The module belongs in this repository, not in
allod/archetypes, because of where a hypervisor can import it from. The hypervisor builder composes the machine's profile definition, so the import is made byprofiles;profilescannot takearchetypesas an input without a cycle, and it can takenexus. This repository also already owns the firewall being opened.Shape:
interfaces(non-empty list of interface names) andport;services.openssh.enable = true,openFirewall = false,PasswordAuthentication = false,KbdInteractiveAuthentication = false,PermitRootLogin = "no";networking.firewall.interfaces.<name>.allowedTCPPortscarries the port, so the global list stays empty.Which keys the hypervisor accepts is not this module's business: the hypervisor builder sets the account's authorized keys from the identity record, tracked in allod/archetypes#89.
Validation
A check that composes the module onto the template host and reads the evaluated options: sshd on, passwords and root login off, the global port list still empty, the port present on each named interface. A second fixture with an empty interface list must fail evaluation.
Scope
In scope: the module, its export, its check, and a README section.
Tracked in allod/archetypes#89: more than one hypervisor in a deployment, and which keys a hypervisor authorizes.
Not in scope: unlocking an encrypted disk at boot on a machine with no console. That is hardware, or a separate issue if it is ever wanted in software.
Prepared on branch
agent/remote-admin, awaiting relay. The module isnixosModules.remoteAdminwith optionsinterfacesandport, and aremote-admincheck.Review found two defects, both fixed on the branch: sshd's port was not set from
port, so a non-default port opened a port with no listener; and the empty-interface fixture passed on an unrelated assertion of the template host, so it is now selected by its own message.nixosModules.remoteAdmin is on master with its check, and allod/nexus#70's hardening of it is merged.