jenkinsci / jenkinsci/credentials-binding-plugin
[JENKINS-43814] Password parameters should be hidden in pipeline logs by default
- Dominant language
- Java
- Stars
- 57
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
In a pipeline script when a developer uses `withCredentials` credentials are hidden in logs to reduces the chance of accidental disclosure (see JENKINS-38181">JENKINS-38181)
When using a password parameter in a job the same concept should be applied to it and it should be impossible to display its value in logs
A work-around is to use the MaskPasswordsBuildWrapper but it has to be manually done (and it's a bit crappy)
node {
wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: [[password: "${myPassword}", var: 'PASSWORD']]]) {
println myPassword
sh 'echo "Hello World ${myPassword}"'
}
}
.
---
Originally reported by
aheritier, imported from: Password parameters should be hidden in pipeline logs by default
Raw content of original issue
In a pipeline script when a developer uses `withCredentials` credentials are hidden in logs to reduces the chance of accidental disclosure (see
JENKINS-38181)When using a password parameter in a job the same concept should be applied to it and it should be impossible to display its value in logs
A work-around is to use the MaskPasswordsBuildWrapper but it has to be manually done (and it's a bit crappy)
node {
wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: [[password: "${myPassword}", var: 'PASSWORD']]]) {
println myPassword
sh 'echo "Hello World ${myPassword}"'
}
}
.
Contributor guide
Assessment
This issue has not been assessed yet.