SKY-D376 · CI/CD pipelines
Secrets passed to a reusable workflow from another repository
A job can call a reusable workflow stored in another repository (uses: owner/repo/.github/workflows/x.yml@ref) and hand it secrets, an OIDC token or a write token. SKY-D376 reports that hand-off so someone reviews the other repository, because Skylos cannot see what that workflow does with them.
- Languages
- GitHub Actions workflows
- Quality gate
- Full scan: listed, not counted by the gate. Diff scan: counted toward the gate limits. A diff scan counts a finding whose rule, file and job name are not among the merge base's findings. A baseline scan counts it like a diff scan when the baseline's
rule_coveragelists it. - Finding type
- review
Why it matters
The called workflow runs with your publish token, and whoever can change that repository, or move the tag you call, decides what runs. A compromised shared release workflow can publish to every package that calls it.
What Skylos flags
name: Releaseon: push: tags: ["v*"]permissions: contents: readjobs: publish: uses: acme/release-workflows/.github/workflows/npm-publish.yml@v2 with: package-dir: packages/sdk secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}What Skylos leaves alone
name: CIon: pull_request: push: branches: [main]permissions: contents: readjobs: test: uses: acme/ci/.github/workflows/test.yml@0f1e2d3c4b5a69788796a5b4c3d2e1f00f1e2d3c with: node-version: 22Why Skylos leaves it alone
The shared workflow also lives in another repository, but this job hands it nothing secret: no secrets, no id-token: write and only a read-only token.
How Skylos decides
- Runs with
--danger(and-a). Theca9library reads every*.ymland*.yamlfile directly in.github/workflows. - Looks at jobs whose
uses:names a workflow outside the repository.uses: ./.github/workflows/…is local and is audited with the other publish rules instead. - Collects what the job hands over:
secrets: inherit,toJSON(secrets), everysecrets.NAMEthe job's values mention (insecrets:,with:orif:),id-token: write, and write scopes ofGITHUB_TOKENwhen the job or workflow setspermissions:. - Reports a MEDIUM finding on the
uses:line when that list is not empty, whether or not the reference is pinned to a commit SHA. The message says which.
How to fix it
Keep the release workflow in this repository (here a copy at .github/workflows/npm-publish.yml), where Skylos and your reviewers can read it. If you must call a shared one, pin it to a full commit SHA, pass only the secrets it needs (never secrets: inherit), audit that repository with the same rules, and record the review in a baseline, because the call stays reported.
name: Releaseon: push: tags: ["v*"]permissions: contents: readjobs: publish:Removed: uses: acme/release-workflows/.github/workflows/npm-publish.yml@v2Added: uses: ./.github/workflows/npm-publish.yml with: package-dir: packages/sdk secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}When it can be wrong
- A call pinned to a reviewed commit SHA, in a repository your organisation owns, is still reported: the rule cannot read the other repository.
- Any
secrets.NAMEmentioned in the job counts, even a non-secret setting stored as a secret. - The flagged example also gets SKY-D292 because
@v2is not a commit SHA. Withsecrets: inheritit would also get SKY-D297.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Skylos reads no inline marker for this rule; a
# skylos: ignorecomment above theuses:line does not hide it.Accept a reviewed call with a baseline:
skylos baseline ., then--baseline. The entry matches the rule, file and job name, not the line. In pull-request CI (SKYLOS_POLICY_BASE), the entry must also be in the base commit's.skylos/baseline.json.[tool.skylos] ignore = ["SKY-D376"]turns the rule off for the whole project.