Docker lastpass is a binary written in golang to synchronize your lastpass secrets with docker secret.
docker-lastpass use great lastpass-go library.
- Lastpass Account (Free or premium)
- Docker Swarm (Docker Secret is unavailable in docker standalone)
./docker-lastpass --config config.toml --username <lastpass-email> --password <lastpass-password>
Parameter | Description | Required | Default |
---|---|---|---|
--config |
Set config file path | ❌ | config.toml |
--username |
Lastpass Username | ✔️ | |
--password |
Lastpass Password | ✔️ | |
--otp |
One Time Password | ❌ |
config.toml example
[log]
level = "debug" # debug,info,warn or error
[lastpass]
twofactor = "push" # disable,push or OTP
[secrets]
groups = ["docker"]
lists = []
Secrets In groups add one or more "Folder" name in your lastpass. All secrets of each group will be synchronized.
In list add one or more secret "Name".
For each lastpass secret 2 docker secrets are created (Username and Password).
For example if your secret name in lastpass is test secret
docker-lastpass create secret lastpass_test-secret_Username
and lastpass_test-secret_Password
docker secret ls
ID NAME DRIVER CREATED UPDATED
bhu3uuyl9nuxxx lastpass_test-secret_Password xx days ago xx days ago
jn9rqksbf00xxx lastpass_test-secret_Username xx days ago xx days ago
Lastpass API not provide timestamp for edit secret. it is therefore impossible to modify an existing secret. It is therefore to delete the secret in docker so that it can be recreated.