diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-05-30 23:54:05 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-08-17 16:47:36 +0200 |
| commit | 64d4de2a920445e5992f020e56490f5fcbdbba7c (patch) | |
| tree | a869360b32fbc5fb0f49d297708ddde801aa3a95 /doc | |
| parent | 8cb871e0c69030599fa8e8410f1ecaee21ddbbd0 (diff) | |
daemon: Bypass authentication when importing content-addressed store items.
This puts ‘importPaths’ on par with ‘addToStore’ and ‘addTextToStore’: since
the two latter RPCs let anyone add content-addressed items in the store,
there’s no reason for ‘importPaths’ to require signatures by authorized keys
on these content-addressed items.
This will allow for things like ‘guix copy’ of .drv items without
authorization, or ‘guix deploy’ with (build-locally? #f) without
authorization.
* nix/libstore/store-api.hh (isContentAddressedPath): New prototype.
* nix/libstore/store-api.cc (isContentAddressedPath): New function.
* nix/libutil/util.hh (isPlainFile): New prototype.
* nix/libutil/util.cc (isPlainFile): New function.
* nix/libstore/local-store.cc (LocalStore::importPath): Define ‘narHash’ and
‘contentAddressed’. Allow unsigned imports when ‘contentAddressed’ is true;
bypass signature verification when ‘contentAddressed’ is true.
* tests/store.scm ("import not signed"): Rewrite to not use a
content-addressed store item.
("import signed by unauthorized key"): Likewise.
("import not signed but content-addressed tree"): New test.
("import not signed but content-addressed regular file"): New test.
("import signed by unauthorized key but content-addressed"): New test.
("import with corrupt signature"): New test.
("import signed by authorized key but hash doesn't match"): New test.
("import with corrupt signature but content-addressed"): New test.
("import signed by authorized key, hash doesn't match, but content-addressed"):
New test.
* doc/guix.texi (Invoking guix archive): Document the exception for
content-addressed store items. Add anchor for ‘--authorize’.
(Invoking guix deploy): Document the benefit of (build-locally? #f).
Add cross-reference for ‘authorize?’.
Co-authored-by: Reepca Russelstein <reepca@russelstein.xyz>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #8979
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index c5fed97da08..e7f1826542d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -5674,7 +5674,11 @@ references, corresponding derivation, and a digital signature. | |||
| 5674 | When exporting, the daemon digitally signs the contents of the archive, | 5674 | When exporting, the daemon digitally signs the contents of the archive, |
| 5675 | and that digital signature is appended. When importing, the daemon | 5675 | and that digital signature is appended. When importing, the daemon |
| 5676 | verifies the signature and rejects the import in case of an invalid | 5676 | verifies the signature and rejects the import in case of an invalid |
| 5677 | signature or if the signing key is not authorized. | 5677 | signature or if the signing key is not authorized; as an exception, |
| 5678 | store items that are @dfn{content-addressed}---source files and | ||
| 5679 | @file{.drv} files (@pxref{Derivations})---can be imported even if they | ||
| 5680 | lack an authorized signature because adding these to the store is not | ||
| 5681 | creating any new risk. | ||
| 5678 | @c FIXME: Add xref to daemon doc about signatures. | 5682 | @c FIXME: Add xref to daemon doc about signatures. |
| 5679 | 5683 | ||
| 5680 | The main options are: | 5684 | The main options are: |
| @@ -5724,6 +5728,7 @@ Alternatively, @var{parameters} can specify | |||
| 5724 | public-key related Functions, @code{gcry_pk_genkey},, gcrypt, The | 5728 | public-key related Functions, @code{gcry_pk_genkey},, gcrypt, The |
| 5725 | Libgcrypt Reference Manual}). | 5729 | Libgcrypt Reference Manual}). |
| 5726 | 5730 | ||
| 5731 | @anchor{archive-authorization} | ||
| 5727 | @item --authorize | 5732 | @item --authorize |
| 5728 | @cindex authorizing, archives | 5733 | @cindex authorizing, archives |
| 5729 | Authorize imports signed by the public key passed on standard input. | 5734 | Authorize imports signed by the public key passed on standard input. |
| @@ -51032,12 +51037,15 @@ with an @code{environment} of @code{managed-host-environment-type}. | |||
| 51032 | @item @code{host-name} | 51037 | @item @code{host-name} |
| 51033 | @item @code{build-locally?} (default: @code{#t}) | 51038 | @item @code{build-locally?} (default: @code{#t}) |
| 51034 | If false, system derivations will be built on the machine being deployed to. | 51039 | If false, system derivations will be built on the machine being deployed to. |
| 51040 | As a bonus, when false, one does not need the target machine to have the | ||
| 51041 | key of the deployment machine among its authorized keys and thus the | ||
| 51042 | @code{authorize?} field below can remain @code{#f}. | ||
| 51035 | @item @code{system} | 51043 | @item @code{system} |
| 51036 | The system type describing the architecture of the machine being deployed | 51044 | The system type describing the architecture of the machine being deployed |
| 51037 | to---e.g., @code{"x86_64-linux"}. | 51045 | to---e.g., @code{"x86_64-linux"}. |
| 51038 | @item @code{authorize?} (default: @code{#t}) | 51046 | @item @code{authorize?} (default: @code{#t}) |
| 51039 | If true, the coordinator's signing key will be added to the remote's ACL | 51047 | If true, the coordinator's signing key will be added to the remote's ACL |
| 51040 | keyring. | 51048 | keyring (@pxref{archive-authorization, authorizing imports}). |
| 51041 | @item @code{port} (default: @code{22}) | 51049 | @item @code{port} (default: @code{22}) |
| 51042 | @item @code{user} (default: @code{"root"}) | 51050 | @item @code{user} (default: @code{"root"}) |
| 51043 | @item @code{identity} (default: @code{#f}) | 51051 | @item @code{identity} (default: @code{#f}) |
