From: Leo Famulari <leo@famulari.name>
To: Nathan Dehnel <ncdehnel@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: How to put a file in /gnu/store and set its permissions
Date: Sun, 5 Dec 2021 00:12:58 -0500 [thread overview]
Message-ID: <YaxKWmMLf39WGhSf@jasmine.lan> (raw)
In-Reply-To: <CAEEhgEs9E8ZMZtYR3RhYSDQDfTCoX4eFECFGbWw-G7ruyUOS3w@mail.gmail.com>
On Sat, Dec 04, 2021 at 04:47:12PM -0600, Nathan Dehnel wrote:
> https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html
> This says to set #:recursive? #t and guix will preserve its
> permissions in the store. I have done this:
>
> (define guixrig_host_rsa_key
> (local-file "ssh/guixrig_host_rsa_key" #:recursive? #t))
>
> The file this expression puts in the store has permissions of 444,
> despite the original being 400. How do I prevent guix from changing
> permissions, or manually override them?
In general, the store cannot be used to store secrets. By design,
everything in the store is made world-readable despite what permissions
are set, for example in a package definition. I'm not sure if that's
documented in the manual; I don't see it in the manual section The Store
[1].
I'm not sure exactly what code ensures that everything in the store is
readable, but it's probably somewhere in the daemon [0], which is what
writes to the store [1].
The question of how to handle secrets in Guix has been discussed many
times over the years and there are some solutions in various services;
maybe there is a canonical solution now. But basically the idea is to
store the secret outside of the store, like in /etc, as defined in a
service configuration in config.scm.
Hopefully some other people can join the conversation with more specific
advice.
[0]
https://git.savannah.gnu.org/cgit/guix.git/tree/nix?h=v1.3.0
[1] I'd guess that canonicaliseTimestampAndPermissions is always called:
https://guix.gnu.org/manual/en/html_node/The-Store.html
next prev parent reply other threads:[~2021-12-05 5:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 22:47 How to put a file in /gnu/store and set its permissions Nathan Dehnel
2021-12-05 5:12 ` Leo Famulari [this message]
2021-12-05 21:18 ` Nathan Dehnel
2021-12-06 2:30 ` Gary Johnson
2021-12-08 0:59 ` Nathan Dehnel
2021-12-08 6:02 ` Arun Isaac
2021-12-08 16:26 ` Gary Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YaxKWmMLf39WGhSf@jasmine.lan \
--to=leo@famulari.name \
--cc=help-guix@gnu.org \
--cc=ncdehnel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).