-
Notifications
You must be signed in to change notification settings - Fork 1
Use ProtectJS for secrets management #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Replace 1Password CLI with @cipherstash/protect (protectjs) for encrypting and decrypting CI secrets using ZeroKMS. - Add scripts/ directory with TypeScript encrypt/decrypt tooling - Add encrypted secrets file (.github/secrets.env.encrypted) - Update all workflow files to use protectjs decryption - Add scripts/node_modules/ to .gitignore Requires GitHub secrets: CS_VAULT_CLIENT_KEY, CS_VAULT_CLIENT_ACCESS_KEY
9793ff5 to
4b1f237
Compare
4b1f237 to
f531579
Compare
Replace per-value encryption with single-blob encryption: - Encrypt entire secrets file as one payload - Decrypt once, then parse with dotenv - Simpler, faster, smaller encrypted file
The decrypt step receives bootstrap secrets (CS_CLIENT_ID, etc.) as env vars but they weren't being written to $GITHUB_ENV for subsequent steps. Now forwards all 4 bootstrap secrets alongside decrypted secrets.
yujiyokoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great
auxesis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved — love to see this experimentation, thanks @tobyhede.
It's basically doing what we used to do way back in the day (2021-2022) on the CI for QX with ejson and ejson2env.
I'm a big fan of the approach you've taken of decrypting the environment variables directly into the GitHub Actions environment. It's a much simpler UX for decrypting in one place, and accessing the secrets throughout the rest of the workflow.
In follow up PRs I think it'd be interesting to explore:
- Separate keys per environment variable, so there's a clearer audit trail about which environment variable has been decrypted, rather than the whole "vault" being accessed.
- This approach refactored into a standalone GitHub Action that we publish on our GitHub for folks to use, and that we also dogfood across our CI.
|
@auxesis First version was individual variables, might make that an option. |
Support both whole-file encryption (--file, default) and individual variable encryption (--vars) for CI secrets. - encrypt-secrets.ts: add --file/--vars CLI flags - decrypt-secrets.ts: auto-detect format from encrypted file structure - Backwards compatible: existing file-mode encryption continues to work
Created: scripts directory with TypeScript tooling, encrypted secrets file.