Skip to content

Take the scanner's key from 1Password, not from a GitHub secret - #27

Merged
imanimanyara merged 1 commit into
mainfrom
ci/secrets-from-1password
Nov 13, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
ci/secrets-from-1password

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Summary

Follows #26. That added the ggshield job reading GITGUARDIAN_API_KEY as a GitHub secret; this
makes 1Password the source and leaves GitHub holding one credential.

- uses: 1password/load-secrets-action@70062d7a876d3eb6334754fa26efd2fbd90c32f2 # v5.0.1
  with:
    export-env: true
  env:
    OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
    GITGUARDIAN_API_KEY: op://CI/GitGuardian/credential
before after
GitHub secrets this workflow needs GITGUARDIAN_API_KEY OP_SERVICE_ACCOUNT_TOKEN
Adding a second credential a second GitHub secret one more op:// line
Rotating one re-set the secret edit it in 1Password; nothing here changes

The op:// reference is not a secret. It names a location, not a value, so it belongs in the
file in plain text and reads as documentation of what the job needs.

Unchanged

The gate still skips with a ::warning when the credential is absent, so this cannot redden
callers before the token exists — it now asks whether 1Password is reachable rather than whether
one key is set. Failing closed stays right for a finding and wrong for a missing setting.

What is needed to make it run

  1. A 1Password service account scoped to a CI vault only — one that can read personal vaults
    turns a CI compromise into a password-manager compromise.
  2. Its token as the org secret OP_SERVICE_ACCOUNT_TOKEN (admin:org scope required).
  3. A GitGuardian item in that vault with the API key in credential.
  4. Callers passing secrets: inherit.

Steps 1–3 involve credential values and are the owner's to run; I have not seen or handled any of
them.

Still true from #26

security.yml has one caller across 299 workflow files — package-scaffolder-old, superseded,
no remote. Adopting it is a separate change, and the reason its existing composer audit and OSV
jobs also reach nobody.

The approach is recorded in imanimanyara/agent-config as a rule
(#6).

GITGUARDIAN_API_KEY was a second GitHub secret to create, hold and rotate. Now
the workflow names it with an op:// reference and fetches it at run time, and
GitHub holds one credential instead: OP_SERVICE_ACCOUNT_TOKEN, scoped to the CI
vault.

The reference is a location rather than a value, so it belongs in this file in
plain text -- it documents what the job needs, and rotating the credential
behind it changes nothing here. That is the point: rotation stops being a
per-repository, per-secret chore.

The gate now asks whether 1Password is reachable rather than whether one key is
set, and still skips with a warning rather than failing. Failing closed is right
for a finding and wrong for a missing setting.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@imanimanyara
imanimanyara merged commit 32f7bc4 into main Nov 13, 2026
3 checks passed
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.

2 participants