Skip to content

[SECURITY] Harden baked nix.conf: drop accept-flake-config=true for explicit substituters + trusted-public-keys #773

Closed

Description

@c-vigo

Source: PR #670 forward-looking roadmap, thread A — roadmap comment. Part of the #625 Nix migration; small + security-critical, so landing on the migration branch before the dev merge rather than deferring.

Problem

accept-flake-config = true is baked into the image's /etc/nix/nix.conf (flake.nix ~591). Any in-container nix run github:attacker/flake then silently accepts that flake's substituters/trusted-public-keys — the textbook Nix cache-redirection supply-chain attack.

Fix

  • Drop accept-flake-config = true from the baked nix.conf.
  • Bake explicit substituters + trusted-public-keys (cache.nixos.org + the vig-os cachix key) so normal use still hits the caches.
  • Require --accept-flake-config per-invocation for anything that genuinely needs a foreign flake's config.

Acceptance

  • Baked nix.conf no longer sets accept-flake-config = true; explicit substituters/keys present.
  • Image build + dev-shell + CI still resolve from the expected caches (no source-rebuild regression).
  • A foreign flake's nixConfig is not auto-accepted without the explicit flag.

Refs #625, #670.

Activity

  1. added
    priority:high
    area:image
    effort:small
    security
    on Jun 30, 2026
  2. c-vigo commented on Jun 30, 2026

    @c-vigo
    ContributorAuthor

    Landed on the migration branch via #782.

  3. added a commit that references this issue on Jun 30, 2026
    ee9cfb7
  4. added a commit that references this issue on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:imageeffort:smallpriority:highsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions