JENKINS-60373: Read secret from file and encode it with base64
See original GitHub issueFeature Request
I am looking for a way to practically and securely inject binary secrets from /run/secret
into a file
credential type (plain-credentials
plugin). The challenge is, the input is expected to be base64 encoded so reading the file as-is from /run/secrets
does not work. Extending plain-credentials
to read the file content instead of expecting inlined string is something that was proven challenging to secure. Several approaches to address that was discussed in JENKINS-60373 and I would like to propose the most straightforward one[1].
Introduce a new syntax, that would permit reading file from filesystem and encoding the content with base64 to close the gap between traditional secrets injection and file
credential. The reasoning is that when the feature is specific for JCasC, it is by definition restricted to administrators eliminating possible arbitrary file read vulnerabilities.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:15 (15 by maintainers)
Top GitHub Comments
@jglick @olivergondza @timja Switching to apache’s StringSubstitutor would enable this Though the default lookup might be too powerful for JCasC use case.
Though it will cleanup some of the code as StringSubstitutor already supports default value via
:-
Also supports nested variable substitution. So you could have something likeI would properly settle for:
Ah I would need to use different
BenchmarkMode
lucky there are annotations for that.