jenkinsci / jenkinsci/credentials-binding-plugin
[JENKINS-68110] String interpolation warning should not appear for SSH key files
- Dominant language
- Java
- Stars
- 57
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
When I do something like this:
withCredentials([sshUserPrivateKey(credentialsId: 'foo', keyFileVariable: 'SSH_KEYFILE')]) {
withEnv(["GIT_SSH_COMMAND=ssh -i ${SSH_KEYFILE}"]) {
// a step that requires GIT_SSH_COMMAND to be set
}
}
I get a warning that a secret as passed to withEnv using string interpolation. That’s not true: the contents of the key file are secret, but the thing I passed to withEnv—its name—is not.
---
Originally reported by haw777, imported from: String interpolation warning should not appear for SSH key files
Raw content of original issue
When I do something like this:
withCredentials([sshUserPrivateKey(credentialsId: 'foo', keyFileVariable: 'SSH_KEYFILE')]) {
withEnv(["GIT_SSH_COMMAND=ssh -i ${SSH_KEYFILE}"]) {
// a step that requires GIT_SSH_COMMAND to be set
}
}I get a warning that a secret as passed to withEnv using string interpolation. That’s not true: the contents of the key file are secret, but the thing I passed to withEnv—its name—is not.
environment
```
Jenkins 2.319.3
Credentials binding plugin 1.27.1
```
Contributor guide
Assessment
This issue has not been assessed yet.