Skip to content

SRE-904: Extract the secret handoff into shared actions - #103

Merged
claude[bot] merged 1 commit into
mainfrom
sre-904/shared-secret-handoff-actions
Aug 11, 2026
Merged

SRE-904: Extract the secret handoff into shared actions#103
claude[bot] merged 1 commit into
mainfrom
sre-904/shared-secret-handoff-actions

Conversation

@claude

@claude claude Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Requested by Tim Diekmann · Slack thread

SRE-904

Before

The encrypted job-boundary handoff from #99 lives as inline openssl steps in housekeeping-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-secretvalue + encryption_key in, base64 encrypted_value out (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-secretencrypted_value + encryption_key in, value out; every plaintext line is ::add-mask::ed before the value is written to GITHUB_OUTPUT, and multi-line values are supported via a heredoc with a random delimiter.

housekeeping-dependencies.yml now 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.

Note for #9192 re-pointing: these actions were authored here against the agreed interface (value/encrypted_value/encryption_key); when re-pointing #9192, verify its call sites match these input/output names exactly.

@claude
claude Bot marked this pull request as ready for review August 11, 2026 14:46
@claude
claude Bot requested a review from TimDiekmann August 11, 2026 14:46
@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches CI secret handling and token handoff between jobs; behavior should be equivalent but decrypt output naming and multi-line masking differ slightly from the removed inline steps.

Overview
Moves the AES-256-CBC + PBKDF2 job-boundary secret handoff out of inline shell in housekeeping-dependencies.yml into reusable composite actions encrypt-secret and decrypt-secret, so other workflows can share one implementation instead of duplicating security-sensitive openssl steps.

The Renovate workflow now calls those actions for mint/decrypt and wires RENOVATE_TOKEN from steps.app-token.outputs.value. PR path filters include the new action directories. decrypt-secret masks each line of multi-line plaintext before writing output and uses a random heredoc delimiter for safe multi-line GITHUB_OUTPUT—a small hardening vs the previous single-line ::add-mask::.

Reviewed by Cursor Bugbot for commit 98535f8. Bugbot is set up for automated code reviews on this repo. Configure here.

@claude
claude Bot added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 583b046 Aug 11, 2026
12 checks passed
@claude
claude Bot deleted the sre-904/shared-secret-handoff-actions branch August 11, 2026 14:52
claude Bot pushed a commit to hashintel/hash that referenced this pull request Aug 11, 2026
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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 98535f8. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants