Add granular access control for nix store
Motivation
Add functionality to manage POSIX ACLs (access control lists) on Nix store paths (including .drv files) and derivation build logs.
In particular:
- Adds a
nix store accesscommand with the following subcommands:-
info -
protect/unprotect -
grant/revoke
-
- Adds a
--protectflag tonix buildandnix store add-* - Adds
__permissionsargument tobuiltins.derivation, andpermissionsargument tobuiltins.path, which allow to control the permissions on corresponding store objects.
For now, all of these are hidden behind --experimental-flags acls
Context
https://github.com/NixOS/rfcs/pull/143
Implementation strategy
- Add a C++ interface for POSIX ACLs
- Add a Nix data structure to describe ACLs of a store path (
AccessStatus), which can be-
protected(if NOT protected, readable and executable by everyone; else readable and executable only by entities) -
entities(list of entities (users and groups) that have access to a path if it is protected)
-
- Implement setting and getting
AccessStatuson a local store and remote daemon store- If the path/derivation does not exist yet, apply the AccessStatus as soon as the path appears
- Add CLI subcommands and language primitives to manage
AccessStatus-es
Priorities
Add :+1: to pull requests you find important.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/tweag-nix-dev-update-54/39990/1
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/tweag-nix-dev-update-55/40996/1
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/secrets-in-nix-suck-and-how-to-fix-them/43822/5