Support decrypting credentials using an external certificate (aka "make secrets portable")
See original GitHub issueAs a user I want to share a single configuration file between multiple Jenkins instance, including credential definitions. Currently JCasC support plugin supports defining encrypted secrets on the configuration YAML. Configuration example:
credentials:
system:
domainCredentials:
- credentials:
- usernamePassword:
id: "exampleuser-creds-id"
username: "exampleuser"
password: "{AQAAABAAAAAQ1/JHKggxIlBcuVqegoa2AdyVaNvjWIFk430/vI4jEBM=}"
scope: GLOBAL
Encryption is done using the Jenkins-internal secret key which is unique for every Jenkins instance. It means that the credentials are not portable between instances. It also creates obstacles for immutable images which start with a fresh Jenkins instance and initially do not have an initialized secret key for encryption. Although there are workarounds, I suggest adding support of external certificates.
Proposal:
- Users can refer external credentials using a custom string, e.g.
{ENC, PKCS7,AQAAABAAAAAQ1/JHKggxIlBcuVqegoa2AdyVaNvjWIFk430/vI4jEBM=}
(encryptted text) - Encryption keys can be passed through a file. Path to it can be defined via environment variable or the JCasC context configuration section
- Nice2Have: Arbitrary encryption engines are supported, maybe using an extension point
Implementation notes:
- The logic can be implemented using a new
SecretSource
class which includes underlying extensions for encryption methods
Issue Analytics
- State:
- Created 4 years ago
- Reactions:62
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Secret encryption and decryption in AWS Secrets Manager
To decrypt the secret, Secrets Manager first decrypts the encrypted data key using the KMS key in AWS KMS. Secrets Manager does not...
Read more >Secure Secrets: Managing Authentication Credentials
Encrypted: the credentials are encrypted with another password, decreasing the probability and impact of an unauthorized leak. A person who can ...
Read more >Web Authentication: An API for accessing Public Key ... - W3C
A user navigates to example.com on their laptop, is guided through a flow to create and register a credential on their phone. A...
Read more >NIST Special Publication 800-63B
This publication has been developed by NIST in accordance with its statutory ... authentication; credential service provider; digital authentication; ...
Read more >An Overview of Cryptography - Gary Kessler Associates
Three types of cryptography: secret-key, public key, and hash function. ... is a weaker algorithm and intended for use outside of Europe and ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Better late than never, working on it again. Thanks to recent patches by @jetersen , now we have a common way to extend variable resolution methods.
We came up with a couple of groovy script to export credentials in the JCasC format. Here they are, for anyone interested.
Note, they fit our use case with our Username & Password + String + File + SSH credentials, if you’ve additional kind of credentials you’ll need to add stuff.
And we needed a 2nd one for a sub cred domain “Debian package builder”