admin管理员组文章数量:1346298
I have a custom script which fetch the secret from vault . ( I cannot use Jenkins credentials to store the secrets )
My code
def executeCommand(def command) {
return sh(script: command, returnStatus: true, label: "Executing Command")
}
def cred = <call some script > ( Returns {username : '', password : '' } )
withEnv(["DOCKER_USER=${cred.username}", "DOCKER_PASS=${cred.password}"]) {
def command = "printf '%s' \"\$DOCKER_PASS\" | docker login ${DockerRepo}.${tmpRepoUrl} -u \$DOCKER_USER --password-stdin"
def status = executeCommand(command)
}
The issue, It is printing the credentials in jenkins logs. [Pipeline] sh (Executing Command) (hide)
- printf somepassword
- docker login docker.test -u test --password-stdin WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
How to avoid printing of command msg in Jenkins logs.
本文标签: Masking of secret in Jenkins logsStack Overflow
版权声明:本文标题:Masking of secret in Jenkins logs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743827214a2545862.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论