-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78b83d7
commit e2e6649
Showing
5 changed files
with
100 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
doc_meta: | | ||
folder: security | ||
title: mask senstive input | ||
head: | | ||
When you use prompt to accept user input, the terminal will log the senstive information, such as password. There is chance this will go to the logs and be exposed to cause security issue. | ||
Requirement from issue: https://github.com/upcmd/up/issues/20 | ||
sections: | ||
- title: Demo | ||
log: yes | ||
tasks: | ||
- | ||
name: task | ||
task: | ||
- func: shell | ||
desc: input raw value | ||
dvars: | ||
- name: username | ||
flags: [prompt,] | ||
do: | ||
- echo "hello {{.username}}" | ||
|
||
- func: shell | ||
desc: | | ||
input secret, eg a password | ||
this will be masked | ||
however password is still leaked during the debugging or in higher verbose level | ||
dvars: | ||
- name: password | ||
flags: [prompt, masked] | ||
do: | ||
- echo "password is - {{.password}}" | ||
|
||
- func: shell | ||
desc: | | ||
password will be saved and kept into vault intead | ||
dvars: | ||
- name: protectedPassword | ||
flags: | ||
- prompt | ||
- masked | ||
- secret | ||
do: | ||
- echo "this print out nothing as protectedPassword is stored in the vault as secret" | ||
- echo "protectedPassword is - {{.protectedPassword}}" | ||
- echo "this print out the retrieved secret from vault" | ||
- echo "protectedPassword is - {{ "protectedPassword" | fromVault}}" |