Skip to content

(ignore) Harden actions/checkout: persist-credentials: false in codeql & dependency-review - #1731

Merged
Dina Berry (MSFT) (diberry) merged 2 commits into
Azure-Samples:mainfrom
diberry:squad/harden-checkout-persist-credentials
Jul 16, 2026
Merged

(ignore) Harden actions/checkout: persist-credentials: false in codeql & dependency-review#1731
Dina Berry (MSFT) (diberry) merged 2 commits into
Azure-Samples:mainfrom
diberry:squad/harden-checkout-persist-credentials

Conversation

@diberry

Copy link
Copy Markdown
Collaborator

Summary

Hardens two GitHub Actions workflows by setting persist-credentials: false on their actions/checkout steps, so GITHUB_TOKEN is not persisted into the PR worktree.

Files changed:

  • .github/workflows/codeql.yml
  • .github/workflows/dependency-review.yml

This follows the prior read-only audit recommendation recorded at C:\project-dina-ai-dev-tools\projects\azure-ai-tools\reports\research-2026-07-16-0958-azure-typescript-e2e-apps-workflow-secrets.md.

No behavior change is intended beyond reducing token exposure in the checked-out workspace.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advisory security review by Statler (project-dina squad): I verified this PR only adds with: persist-credentials: false to the actions/checkout steps in .github/workflows/codeql.yml and .github/workflows/dependency-review.yml.

This correctly implements the audit recommendation. It is a no-behavior-change hardening that prevents the workflow GITHUB_TOKEN from persisting in the PR worktree.

✅ Advisory: approve — safe to merge.

Note: a human collaborator approval is still required to satisfy branch protection.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request hardens the repository’s GitHub Actions security posture by ensuring actions/checkout does not persist GITHUB_TOKEN credentials into the checked-out workspace for the CodeQL and Dependency Review workflows.

Changes:

  • Set persist-credentials: false on actions/checkout in the Dependency Review workflow.
  • Set persist-credentials: false on actions/checkout in the CodeQL workflow.

Reviewed changes

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

File Description
.github/workflows/dependency-review.yml Disables persisted checkout credentials for the dependency review job to reduce token exposure in the workspace.
.github/workflows/codeql.yml Disables persisted checkout credentials for CodeQL analysis runs to reduce token exposure in the workspace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@diberry
Dina Berry (MSFT) (diberry) merged commit a966296 into Azure-Samples:main Jul 16, 2026
2 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.

3 participants