Feature request - Add interactive input password for secrets
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
The docker secrets is realy secret for other users or leak?
The use of the docker secret create command does not protect the security of the secrets before they are generated, because when they are entered through a CLI command, this can be recorded, for example, in .bash_history.
An awkward but useful solution was to add whitespace before the command, this prevented it from being saved in the command history, but in CentOS 8 this does not happen and is saved anyway.
[root@server ~]# print dev | docker secret create mysql-root -;
[root@server ~]# exit
[root@server ~]# cat ~/.bash_history
printf dev | docker secret create my_secret -
exit
[root@server ~]#
There is an option to delete the history of the bash but it is not a formal solution since if a user forgets to clean the history they will be able to expose passwords in their history.
In CLI, all the commands I know except for a docker that request a password do so in a hidden way through an interactive entry where the content is masked and invisible, for example:
passwdcommand.mysqladminroot password set.sshlogin.tty1login.
Docker secrets are supposed to avoid sending passwords flat with docker compose or enviroment options, but creating this "secret" password requires exposing the password in logs or screen visibility. In the official documentation there is no option to hide this entry.
I have created a basic but ineffective solution:
while read -e line; do printf $line | docker secret create mysql-root -; break; done;
This makes entering the password interactive but not hidden on the screen. This can be added as aliases. It is a good idea to integrate an interactive option to create passwords or secrets, for example:
[root@server ~]# docker secret create mysql-root -i
hidden secret:
fg1tc9114100w2f2fpzvnp4zr
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the docker secret create CLI entry point and trace how secret data is read when the source is -. Done means an optional interactive mode accepts input without echoing it and avoids placing the secret in the shell command; add coverage for the command's interactive behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100