summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-05-30 23:54:05 +0200
committerLudovic Courtès <ludo@gnu.org>2026-08-17 16:47:36 +0200
commit64d4de2a920445e5992f020e56490f5fcbdbba7c (patch)
treea869360b32fbc5fb0f49d297708ddde801aa3a95 /doc
parent8cb871e0c69030599fa8e8410f1ecaee21ddbbd0 (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.texi12
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.
5674When exporting, the daemon digitally signs the contents of the archive, 5674When exporting, the daemon digitally signs the contents of the archive,
5675and that digital signature is appended. When importing, the daemon 5675and that digital signature is appended. When importing, the daemon
5676verifies the signature and rejects the import in case of an invalid 5676verifies the signature and rejects the import in case of an invalid
5677signature or if the signing key is not authorized. 5677signature or if the signing key is not authorized; as an exception,
5678store items that are @dfn{content-addressed}---source files and
5679@file{.drv} files (@pxref{Derivations})---can be imported even if they
5680lack an authorized signature because adding these to the store is not
5681creating 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
5680The main options are: 5684The main options are:
@@ -5724,6 +5728,7 @@ Alternatively, @var{parameters} can specify
5724public-key related Functions, @code{gcry_pk_genkey},, gcrypt, The 5728public-key related Functions, @code{gcry_pk_genkey},, gcrypt, The
5725Libgcrypt Reference Manual}). 5729Libgcrypt Reference Manual}).
5726 5730
5731@anchor{archive-authorization}
5727@item --authorize 5732@item --authorize
5728@cindex authorizing, archives 5733@cindex authorizing, archives
5729Authorize imports signed by the public key passed on standard input. 5734Authorize 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})
51034If false, system derivations will be built on the machine being deployed to. 51039If false, system derivations will be built on the machine being deployed to.
51040As a bonus, when false, one does not need the target machine to have the
51041key 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}
51036The system type describing the architecture of the machine being deployed 51044The system type describing the architecture of the machine being deployed
51037to---e.g., @code{"x86_64-linux"}. 51045to---e.g., @code{"x86_64-linux"}.
51038@item @code{authorize?} (default: @code{#t}) 51046@item @code{authorize?} (default: @code{#t})
51039If true, the coordinator's signing key will be added to the remote's ACL 51047If true, the coordinator's signing key will be added to the remote's ACL
51040keyring. 51048keyring (@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})