Skip to content

Restrict code quality workflow permissions - #16

Merged
Liang-Chun Tsai (ltsai-dev) merged 3 commits into
mainfrom
ltsai-microsoft-fix-code-scanning-alerts
Aug 18, 2026
Merged

Restrict code quality workflow permissions#16
Liang-Chun Tsai (ltsai-dev) merged 3 commits into
mainfrom
ltsai-microsoft-fix-code-scanning-alerts

Conversation

@ltsai-dev

@ltsai-dev Liang-Chun Tsai (ltsai-dev) commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an explicit deny-all top-level permissions policy to the code-quality workflow
  • retain the job's existing read-only contents permission

High-severity alerts

Alert #2 should transition to fixed after merge and the next Scorecard run.

Pin workflow actions to immutable commits and install pre-commit from a fully hashed lock file.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7334a342-1040-40cb-a01e-81d4db18579d
Liang-Chun Tsai added 2 commits August 18, 2026 13:52
Keep the top-level token permission restriction and remove medium-severity dependency pinning changes from this pull request.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7334a342-1040-40cb-a01e-81d4db18579d
Add an explicit top-level deny-all permission policy while retaining the job's read-only contents permission.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7334a342-1040-40cb-a01e-81d4db18579d

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.

Pull request overview

This PR hardens the repository’s GitHub Actions security posture by pinning third-party actions to immutable commit SHAs, tightening GITHUB_TOKEN permissions, and making the code-quality Python tooling install reproducible via a hashed dependency lockfile.

Changes:

  • Pinned referenced GitHub Actions in several workflows from mutable tags (e.g., @v7) to specific commit SHAs.
  • Reduced default workflow token permissions (using permissions: {}) and scoped job permissions more tightly (notably in dependency review and code quality workflows).
  • Replaced ad-hoc pip installs/upgrades with pip --require-hashes using a dedicated, fully-hashed requirements lock for pre-commit tooling.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/test-thinkingbox-tools.yml Pins actions/checkout and astral-sh/setup-uv to commit SHAs for deterministic workflow dependencies.
.github/workflows/test-tb-business-ops-servers-202606.yml Same action pinning hardening for the TB business ops servers test workflow.
.github/workflows/scorecard.yml Pins Scorecard-related actions to SHAs (checkout, scorecard-action, upload-sarif).
.github/workflows/dep-review.yml Moves to default-deny workflow permissions and pins checkout + dependency-review action to SHAs.
.github/workflows/codeql.yml Pins CodeQL actions to SHAs for deterministic security scanning dependencies.
.github/workflows/code-quality.yml Defaults workflow permissions to none, pins actions to SHAs, and installs tooling via a hashed requirements lock.
.github/workflows/requirements-code-quality.txt Adds a fully hashed, pinned dependency lockfile used by the code-quality workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ltsai-dev Liang-Chun Tsai (ltsai-dev) changed the title Harden workflow dependency pinning Restrict code quality workflow permissions Aug 18, 2026
@ltsai-dev
Liang-Chun Tsai (ltsai-dev) merged commit 9732d76 into main Aug 18, 2026
5 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