SRE-904: Extract the secret handoff into shared actions - #103
Conversation
PR SummaryMedium Risk Overview The Renovate workflow now calls those actions for mint/decrypt and wires Reviewed by Cursor Bugbot for commit 98535f8. Bugbot is set up for automated code reviews on this repo. Configure here. |
encrypt-secret and decrypt-secret moved upstream (hashintel/.github#103, same interface); the local copies are gone and all references pin the merge commit. mint-sccache-credentials stays local — it is bound to this repository's Vault role and R2 credential layout.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 98535f8. Configure here.
| ENC_KEY: ${{ inputs.encryption_key }} | ||
| run: | | ||
| : "${ENCRYPTED_VALUE:?}" "${ENC_KEY:?}" | ||
| value=$(printf '%s' "${ENCRYPTED_VALUE}" | openssl enc -d -aes-256-cbc -pbkdf2 -pass env:ENC_KEY -base64 -A) |
There was a problem hiding this comment.
Decrypt strips trailing newlines
Medium Severity
Capturing openssl decrypt output in $() drops all trailing newlines before masking and writing value. The action advertises multi-line support, so secrets that require a final newline (for example PEM or SSH keys) will not round-trip faithfully for callers such as hash#9192.
Reviewed by Cursor Bugbot for commit 98535f8. Configure here.


Requested by Tim Diekmann · Slack thread
SRE-904
Before
The encrypted job-boundary handoff from #99 lives as inline
opensslsteps inhousekeeping-dependencies.yml, and any other workflow wanting the same pattern (hashintel/hash#9192) has to carry its own copy — two implementations of the same security-sensitive shell to keep in sync.After
Two generic composite actions own the mechanics, and workflows state only intent:
.github/actions/encrypt-secret—value+encryption_keyin, base64encrypted_valueout (openssl enc -aes-256-cbc -pbkdf2 -salt), guarded with fail-loud: "${VAR:?}"so a missing secret stops the run before anything is handed over..github/actions/decrypt-secret—encrypted_value+encryption_keyin,valueout; every plaintext line is::add-mask::ed before the value is written toGITHUB_OUTPUT, and multi-line values are supported via a heredoc with a random delimiter.housekeeping-dependencies.ymlnow uses them via the repo's$/convention in place of its inline steps — same secret (RENOVATE_TOKEN_ENC_KEY), same job outputs, same masking-before-anything-else ordering, so behavior is unchanged. The encrypt/decrypt round-trip (single- and multi-line values, wrong-key and empty-input failure paths) was verified with dummy values.hashintel/hash#9192 will consume these by pinned SHA once merged, instead of carrying local copies.