systemd-creds driver for secrets management #26762
Replies: 3 comments 7 replies
-
|
Red Hat reference points are the |
Beta Was this translation helpful? Give feedback.
-
|
Also systemd v258 supports user scoped systemd-creds, which would be nice for rootless podman. |
Beta Was this translation helpful? Give feedback.
-
|
I really like this idea. Since systemd simply puts the loaded credentials into a file in a folder specified by A rather simple implementation following the current design in container-libs. This would mean that we need to store "empty" secrets with the correct name to add them to the secrets database. Actual secret data would then be retrieved from credentials directory. This would mean that we need to fail delete and list operations with this driver (or just do nothing and pretend a success). This is probably rather easy to implement. But has the downside that available secrets kinda need to be "synchronized" between podman and systemd. Just having the LoadCredential/LoadCredentialEncrypted directive wouldn't be sufficient. Another approach would be to change how podman handles secrets in general and allow for more flexible management of external secrets. But that would probably mean a larger change in container-libs and podman itself and require a larger discussion about the specific goals and desired architecture here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The very powerful integration of podman and systemd via quadlets makes systemd-creds (also see here) the obvious choice for secure secrets management.
This is not easily possible with one of the current drivers (file, shell, pass) and a new systemd secrets driver would be highly appreciated. The driver would:
LoadCredentialEncrypted=directive upon systemd unit generation for every secret requested in a quadletSecret=directiveThere are workarounds to make it work with the shell driver. One of them looks like below. Unfortunately one has to put the SECRET_ID in the container quadlet file, which has to be extracted from
/var/lib/containers/storage/secrets/secrets.jsonafter creation of the secret with podman./etc/containers/containers.conf:/etc/containers/systemd/printenv.container/var/lib/containers/storage/secrets/secrets.json(created by podman){ "secrets": { "4494b6510222c8b856834c8cb": { "name": "foobar", "id": "4494b6510222c8b856834c8cb", "createdAt": "2025-08-06T16:49:45.901741684+02:00", "updatedAt": "2025-08-06T16:49:45.901741684+02:00", "driver": "shell", "driverOptions": { "delete": "rm /etc/containers/secrets/$SECRET_ID.cred", "list": "/usr/bin/ls $CREDENTIALS_DIRECTORY", "lookup": "/usr/bin/cat $CREDENTIALS_DIRECTORY/$SECRET_ID", "store": "systemd-creds --name=$SECRET_ID encrypt - /etc/containers/secrets/$SECRET_ID.cred" } } }, "nameToID": { "foobar": "4494b6510222c8b856834c8cb" }, "idToName": { "4494b6510222c8b856834c8cb": "foobar" } }/var/lib/containers/storage/secrets/would possibly be used instead of/etc/containers/secrets/.Beta Was this translation helpful? Give feedback.
All reactions