Skip to content

ops(github): the op-pipeline generator cannot express OIDC, since it emits no uses: steps and no permissions beyond the finding mode's #2242

Closed

Description

@lex00

Reported by the choudoufu side while wiring the first GitHub-first pipeline over a chant terraform Op against a real AWS account. Verified on main at ee69dba.

lexicons/github/src/components/generate-op-pipeline.ts builds one job whose steps are actions/checkout@v4, one run: line per beforeScript entry, chant run <op>, and one run: per extraScript entry (lines 202-205). permissions: is permissionsFor(findingMode, trigger) (line 213) and nothing can add to it. So aws-actions/configure-aws-credentials with id-token: write, the one proven AWS auth path in this org, cannot be generated. Static credentials through the variables env mapping can, which is the wrong default to ship.

The forgejo dialect reuses this generator and ignores permissions:; gitlab has no uses: concept at all, so the option shape has to degrade by name there.

Proposed

A setup (or steps) option on the scheduled Op spec that takes a list of { uses, with?, env? } and { run } entries emitted between checkout and beforeScript, and an additive permissions option merged over the mode's least-privilege set, never replacing it, with id-token: write as the motivating value. The github dialect emits both; forgejo emits the steps and drops the permissions as it does today; gitlab refuses uses entries by name at build time. The plan-on-pr example gains the OIDC form as its documented AWS auth, with the role ARN read from a repository variable.

Acceptance

  • A scheduled Op spec with a uses: aws-actions/configure-aws-credentials@v4 setup step and permissions: { id-token: write } generates a job whose steps are checkout, that action with its with:, the terraform install, chant run, and whose permissions: is the mode's set plus id-token: write.
  • A spec whose additive permissions try to widen something the mode already grants, or grant write-all, is refused at build time.
  • gitlab refuses a uses entry by name; forgejo emits the step.
  • lexicons/terraform/examples/plan-on-pr documents OIDC as the AWS auth path and examples.test.ts asserts the generated steps and permissions.

Activity

  1. lex00 commented on Sep 7, 2026

    @lex00
    ContributorAuthor

    Prior art checked before filing: nothing covers this. #2084 added the pull_request and push triggers to this generator without touching steps or permissions; #891 built the component pipeline generator with the same checkout-plus-run shape; #298 scoped OIDC for the gitlab lexicon's own CI_JOB_TOKEN, a different surface. The generator has never emitted a uses: step other than checkout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions