fix: add public key encryption to github secrets #1317
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current cosign github:// URI reference key generation feature
is not using the repository public key for secrets encryption.
The key reference is only added for Github secrets API request,
the actual secret is provisioned in clear text, is not encrypted
before it reaches the GitHub.
As a result, when the secret is decrypted when used in a codespace
(for example by Github Action) latter fails silently, and the
resulting secret value is empty.
Fix use libsodium sealed box to encrypt secrets before they reach
GitHub as per API guidelines.
Manual test:
Before fix
Actual result
Secret sizes are equal to 0
After fix
Actual result
Secret sizes are as provisioned by cosign
Fixes: #838
Signed-off-by: Mykola Kondratenko [email protected]
Summary
Ticket Link
Fixes
Release Note