Skip to content

ci(security-scan): declare workflow_call.secrets so callers can pass by name#21

Merged
WomB0ComB0 merged 1 commit into
mainfrom
ci/declare-security-scan-secrets
Jun 1, 2026
Merged

ci(security-scan): declare workflow_call.secrets so callers can pass by name#21
WomB0ComB0 merged 1 commit into
mainfrom
ci/declare-security-scan-secrets

Conversation

@WomB0ComB0
Copy link
Copy Markdown
Member

Summary

The reusable security-scan.yml consumes SEMGREP_APP_TOKEN, SNYK_TOKEN, and GITLEAKS_LICENSE inside its jobs but does not declare them under workflow_call. With no declaration, the only way a caller can supply them is secrets: inherit — which forwards all of the caller's secrets, not just the three this workflow needs. That trips zizmor's secrets-inherit audit (e.g. resq-software/programs code-scanning alert #11).

This PR declares the three secrets explicitly under workflow_call.secrets, all required: false (each is already gated by its matching enable-* input).

Why it's safe

  • Backward-compatible — existing callers using secrets: inherit keep working unchanged.
  • Opt-in named forwarding — callers can switch to e.g.
    secrets:
      SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
    to clear the zizmor warning.
  • All three stay optional; omitting one leaves that scanner unconfigured (current behaviour).

Follow-up (dependent change)

After this merges, resq-software/programs PR #30 will be updated to pin the new security-scan.yml SHA and replace secrets: inherit with named forwarding of SEMGREP_APP_TOKEN, clearing alert #11. PR #30 already clears alert #10 (unpinned-uses) independently.

Test plan

  • CI green (actionlint / zizmor self-scan).
  • A caller PR forwarding SEMGREP_APP_TOKEN by name resolves and semgrep still runs.

…by name

The reusable security-scan workflow consumes SEMGREP_APP_TOKEN, SNYK_TOKEN
and GITLEAKS_LICENSE in its jobs but did not declare them under
workflow_call, forcing callers to use `secrets: inherit` -- which forwards
ALL of the caller's secrets and trips zizmor's `secrets-inherit` audit
(e.g. resq-software/programs alert #11). Declare them explicitly (all
required: false, each gated by its enable-* input). Backward-compatible.
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@WomB0ComB0, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 7 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b7dfde69-ada6-4201-84e4-22a17abee5f2

📥 Commits

Reviewing files that changed from the base of the PR and between ee20019 and 50e35ec.

📒 Files selected for processing (1)
  • .github/workflows/security-scan.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/declare-security-scan-secrets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@WomB0ComB0 WomB0ComB0 merged commit b48036a into main Jun 1, 2026
7 checks passed
@WomB0ComB0 WomB0ComB0 deleted the ci/declare-security-scan-secrets branch June 1, 2026 03:40
WomB0ComB0 added a commit to resq-software/programs that referenced this pull request Jun 2, 2026
#32)

* ci(security): harden security workflow — clear zizmor alerts #10 & #11

Resolves both open code-scanning alerts on .github/workflows/security.yml
(zizmor 1.24.1, verified locally with `zizmor --persona=auditor`):

- #11 secrets-inherit (warning): replace `secrets: inherit` — which hands
  the reusable workflow ALL of this repo's secrets — with named forwarding
  of just SEMGREP_APP_TOKEN (the only enabled token-consuming scanner).
  Enabled by resq-software/.github#21, which declares the secret under
  workflow_call.secrets; re-pinned to that workflow's new SHA
  (b48036af, #21).
- #10 unpinned-uses (error): already SHA-pinned in #30; carried forward.

Also clears two latent findings the stale scan predates:
- excessive-permissions: drop workflow-level `permissions` to `{}` and move
  contents/security-events/pull-requests scopes onto the `scan` job, so they
  apply only to the reusable call.
- undocumented-permissions: every scope now carries an explanatory comment.

`zizmor --no-online-audits` reports "No findings" on the result.

NOTE: this does not by itself explain the separate scheduled-run
startup_failure (which persisted after the #30 pin); switching off
`secrets: inherit` is the leading remaining hypothesis and this PR tests it.

* fix(ci): grant actions:read so the security reusable can start

Root cause of the security-workflow startup_failure (every run since
2026-05-04, 0 jobs executed): the reusable security-scan.yml's CodeQL and
zizmor jobs request `actions: read` (added in resq-software/.github#20,
2026-05-04 — exactly when the failures began). A reusable workflow's jobs
cannot request a permission the caller did not grant; GitHub rejects the
entire run at startup.

The prior #30 SHA-pin and the secrets-inherit removal did not fix it
because neither granted actions:read. Add it to the scan job's permissions.
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.

1 participant