Machine identities

Updated

A machine identity is a non-human credential: a client id (kmi_…) and a client secret. It is how a CI job, a deploy script or an internal tool reads secrets without a person being involved.

Machine identities

Creating one

Dashboard -> Machine identities -> New identity. Optionally scope it to specific projects; an unscoped identity can read every project in the organization.

Using it

Exchange the credentials for a short-lived token, then pull secrets in whatever shape your job wants:

TOKEN=$(curl -s -X POST https://pipelines.kryptic.dev/api/token \
  -H 'Content-Type: application/json' \
  -d "{\"clientId\":\"$KRYPTIC_CLIENT_ID\",\"clientSecret\":\"$KRYPTIC_CLIENT_SECRET\"}" \
  | jq -r .accessToken)

curl -s "https://pipelines.kryptic.dev/api/secrets/export?projectPublicId=proj_x&environment=production&format=dotenv" \
  -H "Authorization: Bearer $TOKEN" > .env

format accepts:

ValueOutput
dotenv (default)KEY=value lines, quoted where needed
shellexport KEY='value' lines, correctly escaped
jsonA flat JSON object

GitHub Actions

- name: Load secrets from Kryptic
  env:
    KRYPTIC_CLIENT_ID: ${{ secrets.KRYPTIC_CLIENT_ID }}
    KRYPTIC_CLIENT_SECRET: ${{ secrets.KRYPTIC_CLIENT_SECRET }}
  run: |
    TOKEN=$(curl -s -X POST https://pipelines.kryptic.dev/api/token \
      -H 'Content-Type: application/json' \
      -d "{\"clientId\":\"$KRYPTIC_CLIENT_ID\",\"clientSecret\":\"$KRYPTIC_CLIENT_SECRET\"}" \
      | jq -r .accessToken)
    curl -s "https://pipelines.kryptic.dev/api/secrets/export?projectPublicId=proj_x&environment=production&format=shell" \
      -H "Authorization: Bearer $TOKEN" >> "$GITHUB_ENV"

The dashboard generates this snippet pre-filled for GitHub Actions, GitLab CI and plain shell.

Lifecycle

ActionEffect
RotateIssues a new secret and invalidates the old one immediately
DeactivateToken exchange starts returning 401
ScopeRestricts which projects the identity can read

Every read is audit-logged with the machine identity as the actor, so a CI pipeline's access is as reviewable as a person's.