CI/CD
dotsec needs exactly one thing in CI: the ability to unwrap the DEK. For the local provider that's the DOTSEC_PRIVATE_KEY env var; for AWS KMS it's IAM credentials. No files to write, no extra setup step.
GitHub Actions (local provider)
Add the contents of your .sec.key as a repository secret (Settings → Secrets and variables → Actions), e.g. DOTSEC_PRIVATE_KEY. Then:
That's the whole integration. dotsec run decrypts .sec in memory and injects the env vars into npm test. Nothing plaintext ever touches the runner's disk, and encrypted values are redacted from the job log if your process echoes them.
Pass DOTSEC_PRIVATE_KEY on the step that needs it (as above), not at the job or workflow level. Smaller exposure window, and forked-PR workflows never see it.
GitHub Actions (AWS KMS + OIDC)
With the KMS provider there's no dotsec key to manage at all — IAM is the keychain. Use GitHub's OIDC federation so there are no long-lived AWS credentials either:
The assumed role needs kms:Decrypt on your dotsec key. You can pin the permission to dotsec files specifically using the encryption context:
Every decrypt also lands in CloudTrail with that context attached — a free audit trail of which principal decrypted when.
GitLab CI
Anything else
Every CI system reduces to the same two lines:
dotsec checks DOTSEC_PRIVATE_KEY before looking for a .sec.key file, so the env var always wins — see key discovery.
Things to avoid
- Don't
dotsec export -o .envin CI. It writes plaintext to disk where later steps, caches, or artifacts can pick it up.dotsec runkeeps secrets in memory. - Don't echo
dotsec show --revealinto logs. Masked-by-defaultdotsec showexists for a reason. - Don't commit
.sec.keyto make CI work. That defeats the whole model — use the env var.
dotsec knobs that matter in CI
A few configuration items specific to dotsec are worth getting right. Everything else about CI/CD security — workflow approvals, OIDC trust policies, dependency review, action pinning — is your standard cloud-security posture and lives in your existing platform docs, not here.