Simple container secret shell drivers.
The drivers implement secrets/shelldriver/shelldriver.go. See man podman-secret-create for more details.
secret-tool=> uses the session keyring to store container secrets for rootless containersskate=> uses charmbracelet/skate andgpgto store encrypted secrets locally (respects XDG standards)systemd-creds=> usessystemd-credsto store encrypted secrets locally backed by TPM 2.0 or host keys
git clone https://github.com/sabedevops/ContainerSecrets.git
cd ContainerSecrets
# For secret-tool
cp ./drivers/secret-tool.sh $HOME/.local/bin/container-secrets-driver-secret-tool.sh
# For skate
cp ./drivers/skate.sh $HOME/.local/bin/container-secrets-driver-skate.sh
# For systemd-creds
cp ./drivers/systemd-creds.sh $HOME/.local/bin/container-secrets-driver-systemd-creds.shAdd to $XDG_CONFIG_HOME/containers/containers.conf:
[secrets]
driver = "shell"
[secrets.opts]
list = "$HOME/.local/bin/container-secrets-driver-secret-tool.sh list"
lookup = "$HOME/.local/bin/container-secrets-driver-secret-tool.sh lookup"
store = "$HOME/.local/bin/container-secrets-driver-secret-tool.sh store"
delete = "$HOME/.local/bin/container-secrets-driver-secret-tool.sh delete"# Option 1: Reading from file
printf 'mysecret' > ./secret.txt
podman secret create --driver shell 'SECRET_NAME' ./secret.txt
# Option 2: Reading from stdin
printf 'mysecret' | podman secret create --driver shell 'SECRET_NAME' -
# - OR -
echo -n 'mysecret' | podman secret create --driver shell 'SECRET_NAME' -Contributions are welcome! Please see CONTRIBUTING.md for guidelines on how to add and test new drivers.