creds: Add ImportCredential=
ImportCredential= takes a credential name and searches for a matching credential in all the credential stores we know about it. It supports globs which are expanded so that all matching credentials are loaded.
This commit is contained in:
@@ -138,15 +138,16 @@ manager, please consider supporting the following interfaces.
|
||||
`$container_host_version_id=10`
|
||||
|
||||
5. systemd supports passing immutable binary data blobs with limited size and
|
||||
restricted access to services via the `LoadCredential=` and `SetCredential=`
|
||||
settings. The same protocol may be used to pass credentials from the
|
||||
container manager to systemd itself. The credential data should be placed in
|
||||
some location (ideally a read-only and non-swappable file system, like
|
||||
'ramfs'), and the absolute path to this directory exported in the
|
||||
restricted access to services via the `ImportCredential=`, `LoadCredential=`
|
||||
and `SetCredential=` settings. The same protocol may be used to pass credentials
|
||||
from the container manager to systemd itself. The credential data should be
|
||||
placed in some location (ideally a read-only and non-swappable file system,
|
||||
like 'ramfs'), and the absolute path to this directory exported in the
|
||||
`$CREDENTIALS_DIRECTORY` environment variable. If the container managers
|
||||
does this, the credentials passed to the service manager can be propagated
|
||||
to services via `LoadCredential=` (see ...). The container manager can
|
||||
choose any path, but `/run/host/credentials` is recommended.
|
||||
to services via `LoadCredential=` or `ImportCredential=` (see ...). The
|
||||
container manager can choose any path, but `/run/host/credentials` is
|
||||
recommended.
|
||||
|
||||
## Advanced Integration
|
||||
|
||||
|
||||
+11
-7
@@ -72,6 +72,9 @@ Within unit files, there are four settings to configure service credentials.
|
||||
1. `LoadCredential=` may be used to load a credential from disk, from an
|
||||
`AF_UNIX` socket, or propagate them from a system credential.
|
||||
|
||||
2. `ImportCredential=` may be used to load one or more (encrypted) credentials
|
||||
from disk or from the credential stores.
|
||||
|
||||
2. `SetCredential=` may be used to set a credential to a literal string encoded
|
||||
in the unit file. Because unit files are world-readable (both on disk and
|
||||
via D-Bus), this should only be used for credentials that aren't sensitive,
|
||||
@@ -323,7 +326,7 @@ systemd-creds --system cat mycred
|
||||
Or propagated to services further down:
|
||||
|
||||
```
|
||||
systemd-run -p LoadCredential=mycred -P --wait systemd-creds cat mycred
|
||||
systemd-run -p ImportCredential=mycred -P --wait systemd-creds cat mycred
|
||||
```
|
||||
|
||||
## Well-Known Credentials
|
||||
@@ -430,13 +433,14 @@ a container manager or via qemu) and `/run/credentials/@encrypted/` (for
|
||||
credentials that must be decrypted/validated before use, such as those from
|
||||
`systemd-stub`).
|
||||
|
||||
The `LoadCredential=` and `LoadCredentialEncrypted=` settings when configured
|
||||
with a relative source path will search for the source file to read the
|
||||
credential from automatically. Primarily, these credentials are searched among
|
||||
the credentials passed into the system. If not found there, they are searched
|
||||
in `/etc/credstore/`, `/run/credstore/`,
|
||||
The `ImportCredential=` setting (and the `LoadCredential=` and
|
||||
`LoadCredentialEncrypted=` settings when configured with a relative source path)
|
||||
will search for the source file to read the credential from automatically. Primarily,
|
||||
these credentials are searched among the credentials passed into the system. If
|
||||
not found there, they are searched in `/etc/credstore/`, `/run/credstore/`,
|
||||
`/usr/lib/credstore/`. `LoadCredentialEncrypted=` will also search
|
||||
`/etc/credstore.encrypted/` and similar directories. These directories are
|
||||
`/etc/credstore.encrypted/` and similar directories. `ImportCredential` will search
|
||||
both the non-encrypted and encrypted directories. These directories are
|
||||
hence a great place to store credentials to load on the system.
|
||||
|
||||
## Conditionalizing Services
|
||||
|
||||
Reference in New Issue
Block a user