Changes between Initial Version and Version 1 of Security considerations


Ignore:
Timestamp:
04/30/25 10:03:09 (3 weeks ago)
Author:
enno
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Security considerations

    v1 v1  
     1Let’s go through this from a security architecture perspective, and identify:
     2
     3Potential risks
     4
     5Mitigation strategies
     6
     7Recommendations specific to Guix in air-gapped, classified use
     8
     9πŸ›‘οΈ Security Risks in an Air-Gapped Guix Workflow
     101. Supply Chain Attacks via Source Code
     11Even though you're building from source, the upstream source code (tarballs, Git repos) may be maliciously modified.
     12
     13Guix uses cryptographic hash verification, but only against what is declared in the Guix package definition β€” not against independent trust anchors.
     14
     15βœ… Mitigations:
     16
     17Use guix build --source with hash-locked package definitions (content-addressed derivations).
     18
     19Use reproducible builds and determinism checks (e.g., compare build outputs across trusted builders).
     20
     21Consider maintaining a private mirror of trusted source code, and pin hash checks yourself.
     22
     23Use content scanning tools (e.g., static analyzers) on all .tar.gz and Git checkouts.
     24
     252. Compromise via Channel Updates
     26Your Guix package definitions come from Git channels (e.g., guix.git, or your own).
     27
     28If your channel is compromised, malicious package definitions could be delivered.
     29
     30βœ… Mitigations:
     31
     32Use a pinned commit hash in your channels.scm.
     33
     34Verify the channel commit with signed Git commits or tags (Guix supports this).
     35
     36Host your own internal Guix channel for critical environments β€” control what definitions are trusted.
     37
     38Use guix time-machine to avoid rolling updates.
     39
     403. Media Transfer Risks (USB, SD cards)
     41USB drives used for transferring .nar files or source archives can be a vector for malware, even in an air-gapped setup.
     42
     43βœ… Mitigations:
     44
     45Always format and scan USB media on a controlled, known-clean staging machine before inserting into classified systems.
     46
     47Use write-once optical media (DVD-R) where appropriate for immutable transfer.
     48
     49Prefer hash verification of transferred files (sha256sum sources.nar) using offline-known-good hashes.
     50
     514. Build Environment Leakage
     52If the build process writes temporary files or outputs data to places outside the Guix store, secrets or traces of sensitive data could leak or persist.
     53
     54βœ… Mitigations:
     55
     56Use guix build inside a dedicated, minimal, reproducible system (e.g., a guix system vm).
     57
     58Enable build sandboxing (enabled by default in Guix).
     59
     60Disable networking in builders if not already (Guix does this by default, but confirm your configuration).
     61
     62Consider full-disk encryption for the build system.
     63
     645. Tampered Nar Archives
     65.nar archives imported into your air-gapped server could be tampered with in transit.
     66
     67βœ… Mitigations:
     68
     69Sign the archive on the export side and verify the signature on the import side.
     70
     71Use GPG or minisign for signing hashes.
     72
     73Maintain a hash whitelist of approved .nar files on the classified system.
     74
     75Store all .nar imports in a sealed append-only log for auditing.
     76
     77βœ… High-Security Recommendations for Guix in Classified Environments
     78
     79Concern Recommendation
     80Source authenticity     Use fixed-output derivations with pinned hashes
     81Package definition trust        Host internal Guix channel; pin commit hashes
     82Archive integrity       Sign .nar files and verify signatures
     83Reproducibility Use multiple offline builders to cross-check outputs
     84Logging Keep an audit trail of all imports and builds
     85Isolation       Build in virtual machines or system containers with no network
     86Transfer media  Sanitize USBs or use write-once optical media
     87User separation Separate users for import, build, audit, and deployment tasks
     88πŸ” Final Thoughts
     89Guix offers an excellent foundation for secure, reproducible software environments.
     90
     91But air-gapped security is about the whole process, not just the tooling.
     92
     93You should treat the Guix channel, source transport, build environment, and auditability as a single trusted pipeline.