summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-10-30 13:53:31 +0100
committerLennart Poettering <lennart@poettering.net>2024-10-30 17:43:53 +0100
commitd9f4dad986dcebd51bdaeb8ba3d2c00cdc0d701e (patch)
tree17fd4b61221cf40a3b15a97c03e58af604dee11e /docs
parentlogind: add BlockWeakInhibited property (diff)
downloadsystemd-d9f4dad986dcebd51bdaeb8ba3d2c00cdc0d701e.tar.xz
systemd-d9f4dad986dcebd51bdaeb8ba3d2c00cdc0d701e.zip
ask-password: Allow configuring the keyring timeout via an environment variable
In mkosi, we want an easy way to set the keyring timeout for every tool we invoke that might use systemd-ask-password to query for a password which is then stored in the kernel keyring. Let's make this possible via a new $SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC environment variable. Using an environment variable means we don't have to modify every separate tool to add a CLI option allowing to specify the timeout. In mkosi specifically, we'll set up a new session keyring for the mkosi process linked to the user keyring so that any pins in the user keyring are used if available, and otherwise we'll query for and store password in mkosi's session keyring with a zero timeout so that they stay in the keyring until the mkosi process exits at which point they're removed from the keyring.
Diffstat (limited to 'docs')
-rw-r--r--docs/ENVIRONMENT.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md
index cf5fb91eb9..48eeaa508c 100644
--- a/docs/ENVIRONMENT.md
+++ b/docs/ENVIRONMENT.md
@@ -735,3 +735,12 @@ Tools using the Varlink protocol (such as `varlinkctl`) or sd-bus (such as
* `SYSTEMD_EXIT_ON_IDLE` – Takes a boolean. When false, the exit-on-idle logic
of these services is disabled, making it easier to debug them.
+
+`systemd-ask-password`:
+
+* `$SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC` - takes a timespan or `default`,
+ which controls the expiration time of keys stored in the kernel keyring by
+ `systemd-ask-password`. If unset or set to `default`, the default expiration
+ of 150 seconds is used. If set to `0`, keys are not cached in the kernel
+ keyring. If set to `infinity`, keys are cached without an expiration time in
+ the kernel keyring.