Skip to content

Credentials provider support for builtins.fetch* #8635

Open
@simonzkl

Description

Is your feature request related to a problem? Please describe.

We desperately need some sort of credentials provider support for builtins.fetch* functions. The best you can currently do is to use pkgs.fetchurl, expose your credentials in plain text at some globally accessible path like /etc/nix/my-creds and add it to extra-sandbox-paths. You can restrict access to only nixbld though it's not like it matters because anyone who has access to the nix builder can echo the credentials and fetch them from the build log.

Describe the solution you'd like

  • Similar to fetchGit which is able to use your local ssh agent, you should have some form of way to securely fetch packages on the client side by authenticating locally using a custom credential provider.
  • Packages behind authentication would be fetched on the client side and then passed to the builder.
  • Credential provider could simply read from a local file or execute a custom command (e.g. fetch credentials from pass or the system keychain).
  • Credential provider would be able to set any http header for fetchurl.
  • Credentials should not be saved to the nix store as that is not secure. Credentials can be expiring and user-specific so they're not reproducible anyway.

Describe alternatives you've considered

  • [RFC 0143] Nix Store ACLs is not a solution to this because credentials can be user-specific and expiring which makes them non-reproducible.
  • access-tokens currently doesn't work, is limited to credentials being exposed in plain text, assumes the credentials don't need to be refreshed and is limited to oauth/pat for specific platforms like gitlab/github.

Somewhat related

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalfetchingNetworking with the outside (non-Nix) world, input lockingsecuritySecurity-related issuessettingsSettings, global flags, nix.conf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions