Skip to content

Conversation

bigstinky86
Copy link

@bigstinky86 bigstinky86 commented Apr 9, 2020

Sometime it is needed to hide sensitive data from appearance in logs but save the rest ssh command to verify. Output suppressing is a good way to hide whole command but not only sensitive data.

This changes allow to set placeholders in SSH command and replace them right before executing. It shows command without sensitive data and executes it with proper data.

The output will look like

[sshexec] Connecting to localhost:22
[sshexec] cmd : echo ::username::--::password::--::username:: >> ant_test_hide

But file will contain all the passed data

SomeUser--SOmePass--SomeUser

sshexec task was called

<sshexec host="${host}"
               username="${username}"
               keyfile="${user.home}/.ssh/id_rsa"
               trust="true"
               command="echo ::username::--::password::--::username:: >> ant_test_hide"
               hideSensitive="true"
               bindSensitive="username=SomeUser|password=SOmePass"
               sensitiveDelimiter="|"
               placeholderBracket="::"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant