Enable host-managed Attic HTTPS and shared IPv6 preference #331
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!331
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/attic-direct-https"
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?
Adds declarative host-managed HTTPS for Attic and an explicit IPv6-first address-selection policy in the shared NixOS baseline, retaining IPv4 fallback.
Validation:
nix flake checkand the Vega system build passed. A live Vega canary passed trusted HTTPS and cache-read/download checks from the LAN and an external host. Permanent activation remains pending.Automated code review
Reviewed commit:
22e34953e686668c05aa4d8c0bb5dfd80006c859Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
The supplied change adds
modules/services/attic-https.nix(nginx vhost + ACME/lego Cloudflare DNS-01 issuance + firewall ingress for 443), reaches it throughimports = [ ./attic-https.nix ]atmodules/services/atticd.nix:14, enables it only on Vega vianixosConfig.attic.publicHttps, and addssecrets/acme/vega.yamlwith a matching.sops.yamlrule. I verified the wiring that is checkable in the checkout: the relative paths resolve correctly (atticd.nix:14->modules/services/attic-https.nix;../../secrets/acme/vega.yaml-> repo-rootsecrets/acme/vega.yaml), the file's recorded recipients (electra, vega, yubikey-nano5c, yubikey-5-nfc, provision-key) match the new.sops.yaml:24key_groups exactly, the keycloudflare_dns_tokenexists in that file, the vhost proxies to the same private listener127.0.0.1:8081thatatticd.nixstill sets,attic.nimmog.ukremains inallowed-hosts, andnixosConfig.userEmailhas a default inmodules/common/default-config.nix:14. Thenetworking.getaddrinfo.precedencehunk restates the standard table and its own comment declares that intent, so I did not report it as a defect. No evaluation-blocking defect was demonstrable from the supplied evidence;nix flake checkand the canary are asserted in the PR text only and could not be re-run. Three latent, evidence-backed concerns remain: the new module is not host-scoped despite hard-coding Vega-only values, the 443 ingress is keyed on a literal interface name with no supporting evidence or validation, and the new SOPS rule grants a wider audience than the repository's established Vega-only pattern.Blocking findings
None.
Important findings
None.
Suggestions
New module is reached through a module shared with Lyra while hard-coding Vega-only values (modules/services/atticd.nix:14; high confidence)
modules/services/atticd.nix:14addsimports = [ ./attic-https.nix ];andhosts/lyra/default.nix:51imports../../modules/services/atticd.nix, so the new module is loaded on Lyra too. Inside it,modules/services/attic-https.nix:27fixessopsFile = ../../secrets/acme/vega.yamlandhostName = "attic.nimmog.uk"are fixed, and.sops.yaml:24scopes that file to electra/vega/YubiKeys/provision-key with no lyra recipient.scripts/check-service-exposure.nix:17lists 443 inretiredPortsand asserts no non-nebula.meshinterface allows it onflake.nixosConfigurations.lyra, while the new module setsnetworking.firewall.interfaces.<interface>.allowedTCPPorts = [ 443 ]. The module is inert today because its whole config islib.mkIf cfg.enableand Lyra does not setnixosConfig.attic.publicHttps.Impact: Not a defect in the current tree, but the capability is not host-scoped: a future Lyra enablement would attempt to decrypt a file Lyra is not a recipient of and would trip the authoritative
service-exposureflake assert, so a toggle becomes an evaluation/deployment failure instead of a clean refusal. The repository already has a convention for this:modules/services/newt.nix:24makessopsFilea required host-set option with a comment saying every enabling host must set it.Suggested fix: Scope the ingress to the intended hardware: import
./attic-https.nixfromhosts/vega/default.nixrather than from the sharedatticd.nix, or parameterisesopsFile/hostNameper host following thenewt.nixpattern and add an assertion rejecting non-Vega use alongside the existingservices.atticd.enableassertion.Direct 443 ingress is keyed on an unverifiable literal interface name with no validation (hosts/vega/default.nix:161; medium confidence)
nixosConfig.attic.publicHttps = { enable = true; interface = "enp86s0"; };feedsnetworking.firewall.interfaces.${cfg.interface}.allowedTCPPorts = [ 443 ]atmodules/services/attic-https.nix:81.enp86s0occurs nowhere else in the repository, and no supplied file contains an interface listing for Vega. Every other firewall rule in the checkout keys on a stable name:networking.firewall.interfaces."nebula.mesh"(hosts/vega/default.nix:278) andnetworking.firewall.interfaces.${newtBridge.interface}withnewtBridge.interface = "newt_default"(hosts/vega/default.nix:176). The option itself (modules/services/attic-https.nix:12-16) has no default, no type restriction, and no assertion that the interface exists.Impact: If the literal does not match Vega's persistent interface, the 443 rule is attached to an interface that is not present, so the direct HTTPS ingress is not permitted on the LAN/external path even though
nix flake checkpasses; this is the part of the change a canary taken over a different path could mask. A renamed or removed interface would fail silently rather than closed.Suggested fix: Record the live interface name in the PR evidence (
ip -a link show/udevadmoutput) and, if the name is genuinely kernel-generated, add an assertion or documented default so an absent or renamed interface fails at evaluation instead of silently dropping the ingress.New SOPS rule grants the ACME token to electra, wider than the repository's Vega-only pattern (.sops.yaml:24; medium confidence)
The added rule
path_regex: secrets/acme/vega\.yaml$lists key_groups*electra, *vega, *yubikey-nano5c, *yubikey-5-nfc, *provision-key. The comparable Vega-only rules in the same file -secrets/karakeep-server\.yaml,secrets/forgejo[-_]runner\.yaml,secrets/beszel/vega\.yaml,secrets/nebula/vega\.yaml- list only*vegaplus the two YubiKeys and*provision-key. The token's only consumer in the diff is Vega:modules/services/attic-https.nix:26-28readscloudflare_dns_tokenintocredentialFiles.CF_DNS_API_TOKEN_FILE, and the file is named and scoped to Vega.Impact: electra, an AI laptop host, gains the ability to decrypt a Cloudflare zone-scoped DNS token used only by Vega's ACME service, which is broader than the established per-host scoping convention documented in the adjacent rules (e.g. the
nebula-ca.yamlandpaseo.yamlcomments justify each audience). No comment explains why electra is included here.Suggested fix: Drop
*electraunless it is required for a creation/rotation ceremony -*provision-keyalready covers provisioning - and if it is intentional, state the reason in a comment as the neighbouring rules do.Tests and validation
Questions
--dns.propagation.wait 60sa current lego option?extraLegoFlagsis passed through verbatim, so an unrecognised flag would fail certificate issuance at runtime without any flake-check signal; nothing in the supplied material contains lego's option set.dnsProvider = "cloudflare"alone cause nixpkgs to add lego's--dns(DNS-01) flag? The vhost isonlySSL = truewith a single port-443 listener anduseACMEHost, so no port-80/acme-challenge location exists; the supplied material does not show how nixpkgs composes the lego command.[::]:443listener rather than by the existing Pangolin/Newt route?.forgejo/workflows/attic-cache.yml(ATTIC_SERVER_URL) and the shared substituter inmodules/common/nix-settings.nixactually reach, given public DNS forattic.nimmog.ukis unchanged by this diff?Review limitations
nix flake check, the Vega build, theservice-exposure/token-tv-configflake checks, and the canary were not re-run; their passing status is taken from the pull-request text only.networking.getaddrinfo.precedence's documented default,security.acme.certs.*.credentialFilessemantics, lego's flag names, or nixpkgs' nginx/ACME command composition; I therefore did not report the getaddrinfo hunk as a defect.attic.nimmog.uk, Cloudflare zone configuration, and nginx/ACME runtime behaviour could not be inspected.secrets/acme/vega.yamlwas read only as SOPS ciphertext; the token value and its Cloudflare scope cannot be inspected.Diff coverage
.sops.yaml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchhosts/vega/default.nix: reviewed — included in a context-limited batchmodules/common/base.nix: reviewed — included in a context-limited batchmodules/services/attic-https.nix: reviewed — included in a context-limited batchmodules/services/atticd.nix: reviewed — included in a context-limited batchsecrets/acme/vega.yaml: reviewed — included in a context-limited batchReview metadata
Automated code review
Reviewed commit:
e8caed8345d296a2023e2da29b77ec0248bd5e3dVerdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
After checking the supplied diff against the checked-out tree, I found no defect I can evidence in the changed files. The wiring is internally consistent:
modules/services/attic-https.nix:66proxies tohttp://127.0.0.1:8081, which matches the unchangedlisten = "127.0.0.1:8081"inmodules/services/atticd.nix:79, and the forwardedHost $hostisattic.nimmog.uk, which is present inallowed-hostsatmodules/services/atticd.nix:78; the module is imported and enabled only on Vega (hosts/vega/default.nix:30,:160-164); the four age recipients embedded insecrets/acme/vega.yamlmatch the new.sops.yamlrule (*vega,*yubikey-nano5c,*yubikey-5-nfc,*provision-key) exactly, and that rule precedes the broadsecrets/.*\.yaml$fallback. The getaddrinfo table inmodules/common/base.nix:45reproduces glibc's documented built-in precedence values verbatim, so it is a no-op restatement rather than a behaviour change. I rejected the prior review's findings: its 'world-readable token' claim rests on a premise contradicted by the supplied tree (many existing declarations omitmode/owner, e.g.modules/services/atticd.nix:23-31,modules/services/newt.nix:56,modules/services/beszel-agent.nix:11,modules/services/bookstack-mcp.nix:68-76), so there is no demonstrated deviation from a repository convention, and I could not verify sops-nix's default mode from supplied material; the 'missing Known Secrets row' finding is located insecrets/README.md, which is not a changed file; the hardcodedhostName/sopsFileand the unverifiedenp86s0interface name are design/verification concerns, not demonstrated defects.Blocking findings
None.
Important findings
None.
Suggestions
None.
Tests and validation
Questions
--dns.propagation.wait 60sthe flag spelling accepted by the lego version shipped bysecurity.acme? Neither the option name (extraLegoFlags) nor the flag can be checked from this checkout (no nixpkgs available), so a wrong spelling would fail only at certificate issuance, not atnix flake check.enp86s0confirmed against live Vega state? It occurs only athosts/vega/default.nix:163in this repository, andhosts/vega/hardware-configuration.nixcontains no interface names, so nothing in the checkout corroborates it;networking.firewall.interfacesaccepts any key at evaluation time.modules/services/attic-https.nixintended to be Vega-only?hostName = "attic.nimmog.uk"(:5) andsopsFile = ../../secrets/acme/vega.yaml(:27) are literals, whereas the comparable host-scoped modulemodules/services/newt.nix:41-47makessopsFilea required option. Please confirm the Vega-only scope is deliberate rather than something to parameterise.modules/common/base.nix:45intended purely to make glibc's documented defaults explicit (it matches them exactly, so it is a no-op), or was a different ordering intended?services.newtis supplied outside this repository, so its listening socket could not be inspected here.Review limitations
networking.getaddrinfo.precedence,security.acme.certs.<name>.extraLegoFlags,credentialFiles,services.atticd,services.newt, and sops-nix's default secret mode/owner could not be verified; the getaddrinfo values were compared only against the comment's own claim and the diff.secrets/acme/vega.yamlagainst.sops.yaml, not the token's value, scope, or validity.Diff coverage
.sops.yaml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchhosts/vega/default.nix: reviewed — included in a context-limited batchmodules/common/base.nix: reviewed — included in a context-limited batchmodules/services/attic-https.nix: reviewed — included in a context-limited batchmodules/services/atticd.nix: reviewed — included in a context-limited batchsecrets/acme/vega.yaml: reviewed — included in a context-limited batchReview metadata