chore(internal): add secrets backup workflow for Infisical migration#12474
Closed
davidkonigsberg wants to merge 1 commit intomainfrom
Closed
chore(internal): add secrets backup workflow for Infisical migration#12474davidkonigsberg wants to merge 1 commit intomainfrom
davidkonigsberg wants to merge 1 commit intomainfrom
Conversation
Co-Authored-By: David Konigsberg <davidakonigsberg@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
🌱 Seed Test SelectorSelect languages to run seed tests for:
How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Refs: Companion to fern-platform#6953 and engineering-docs#33
Adds backup jobs to the existing
infisical-testing.ymlworkflow to safely export all GitHub Actions secrets (repo-level and per-environment) to encrypted files in S3, in preparation for migrating to Infisical for centralized secrets management.Changes Made
.github/workflows/infisical-testing.yml— added 3 parallel backup jobs after the existing admin gate:backup-repo-secretsfern/repo-secrets-<ts>.json.encbackup-fern-devFern Devenvironment secretsfern/fern-dev-secrets-<ts>.json.encbackup-fern-prodFern Prodenvironment secretsfern/fern-prod-secrets-<ts>.json.enc#THIS WORKFLOW IS ONLY TO BE USED FOR TESTINGcommentKey details:
workflow_dispatchonly — must be triggered manuallycheck-adminjob gates all backup jobs (only repo admins can proceed)github-cirole) for AWS — no static keys_BK_-prefixed env vars, serializes to JSON with PythonBACKUP_ENCRYPTION_KEYsecrets3://fern-backups/github-secrets/fern/with SSE-AES256 (repo name in path separates these from fern-platform exports)To decrypt:
openssl enc -d -aes-256-cbc -pbkdf2 -iter 100000 -in <file>.json.enc -out secrets.json -pass pass:"<BACKUP_ENCRYPTION_KEY>"Updates since last revision
infisical-testing.ymlinstead of a standalonebackup-secrets.yml(per reviewer feedback)fern/to S3 key prefix so backups are separated by repo (s3://fern-backups/github-secrets/fern/vss3://fern-backups/github-secrets/fern-platform/)Testing
workflow_dispatchPrerequisites before first run:
BACKUP_ENCRYPTION_KEYrepo secret in GitHub (strong passphrase for AES-256 encryption)github-ciIAM role hass3:PutObjectpermission on thefern-backupsbucketHuman Review Checklist
_BK_*env var names inbackup-repo-secretsagainst the actual secrets configured in GitHub repo settings. Any secrets that exist in GitHub but are missing here will not be backed up (they'll silently be empty strings).FERN_ORG_TOKEN_DEV,AUTH0_DOMAIN,AUTH0_CLIENT_IDare the only environment-scoped overrides inFern Dev. These were inferred fromenvironment: Fern Devblocks inci.yml— there may be additional secrets configured in GitHub that aren't referenced in any workflow.AUTH0_DOMAIN,AUTH0_CLIENT_IDare the only environment-scoped overrides inFern Prod. These were inferred fromenvironment: Fern Prodinpublish-cli.yml.github-ciIAM role hass3:PutObjectpermission on thefern-backupsbucket (likely already configured from fern-platform).BACKUP_ENCRYPTION_KEYrepo secret is acceptable.Link to Devin run | Requested by @davidkonigsberg