Skip to content

Conversation

@tobyhede
Copy link
Contributor

Created: scripts directory with TypeScript tooling, encrypted secrets file.

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
@tobyhede tobyhede force-pushed the zerovlt-ci-integration branch 4 times, most recently from 9793ff5 to 4b1f237 Compare December 22, 2025 02:34
@tobyhede tobyhede force-pushed the zerovlt-ci-integration branch from 4b1f237 to f531579 Compare December 22, 2025 02:55
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.
Copy link
Contributor

@yujiyokoo yujiyokoo left a comment

Choose a reason for hiding this comment

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

This looks great

Copy link
Contributor

@auxesis auxesis left a 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.

@tobyhede
Copy link
Contributor Author

@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
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.

4 participants