Action dependencies not pinned to full-length commit SHAs

Open Beginner friendly
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
github-actions
Domain
ci-cd, security

Research direction

Start with PyCQA/bandit-action's action.yml and inspect any composite steps or reusable workflows it calls. Replace each mutable action tag, including setup-python, checkout, and upload-sarif, with the corresponding full-length commit SHA while preserving version comments. Done means all internal action references satisfy the required SHA-pinning policy.

Written by the indexing model from the issue text.

Description

enhancement

Problem

PyCQA/bandit-action itself can be pinned to a full-length commit SHA (e.g.
PyCQA/bandit-action@67a458d90fa11fb1463e91e7f4c8f068b5863c7f), but the internal dependencies it references are pinned only to mutable version tags, not full-length commit SHAs:

  • actions/setup-python@v6
  • actions/checkout@v6
  • github/codeql-action/upload-sarif@v4

Impact

Many organisations and enterprises enforce a policy requiring all actions , including transitive/internal dependencies to be pinned to a full-length commit SHA. When bandit-action is used in such an environment, the workflow fails at the "Prepare all required actions" step with an error like:

Error: The actions actions/setup-python@v5, actions/checkout@v4, and github/codeql-action/upload-sarif@v3
are not allowed in <org>/<repo> because all actions must be pinned to a full-length commit SHA.

Even though the caller has correctly pinned PyCQA/bandit-action to a SHA, the action itself violates the policy because its own action.yml uses tag-based references internally.

Expected behaviour

All action references inside PyCQA/bandit-action's action.yml (and any composite steps or reusable workflows it calls) should be pinned to full-length commit SHAs, for example:

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065  # v5
- uses: github/codeql-action/upload-sarif@v3@...  # pin to SHA

This is also a security best practice recommended by StepSecurity and OpenSSF Scorecard (the "Pinned-Dependencies" check).

Suggested fix

Replace all mutable tag references inside the action's source files with their corresponding full-length commit SHAs.

Environment

  • Runner version: 2.332.0
  • Observed when bandit-action is used in an organisation with mandatory SHA-pinning policy
Dominant language
No language data
Stars
30
Forks
15
Avg merge
2h 11m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PyCQA/bandit-action

All issues in PyCQA/bandit-action

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.