Skip to content

Harden workflow token permissions, pin github-script SHA, and add CodeQL workflow config#5727

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/sec-check-missing-permissions
Draft

Harden workflow token permissions, pin github-script SHA, and add CodeQL workflow config#5727
Copilot wants to merge 2 commits into
mainfrom
copilot/sec-check-missing-permissions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 6, 2026

📝 Summary of Changes

This PR addresses security findings for GitHub Actions workflow hardening: missing explicit token permissions and an unpinned action reference. It also adds a CodeQL workflow that uses the repository’s CodeQL config file for path exclusions.


Changes Made

  • Updated workflow permissions:
    • .github/workflows/copilot-dco.yml with:
      • checks: write
      • pull-requests: read
    • .github/workflows/markdownlint-cli2.yml with:
      • contents: read
  • Refactored action pinning in .github/workflows/auto-label-bugs.yml:
    • actions/github-script@v7actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
  • Added .github/workflows/codeql.yml to run CodeQL on push, pull_request, and weekly schedule, with explicit permissions and pinned CodeQL actions
  • Added workflow reference to existing repo config:
    • config-file: ./.github/codeql-config.yml

Example pinned-action change:

uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1

Checklist

Please ensure the following before submitting your PR:

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.

Screenshots or Logs (if applicable)

N/A (workflow configuration changes only)


👀 Reviewer Notes

  • Scope is intentionally narrow: only the workflows called out by security findings plus the requested codeql.yml addition.
  • All newly introduced third-party action references in touched files are pinned to full SHAs.

@kubestellar-prow kubestellar-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: no Indicates the PR's author has not signed the DCO. labels Jun 6, 2026
@kubestellar-prow
Copy link
Copy Markdown

Hi @Copilot. Thanks for your PR.

I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubestellar-prow kubestellar-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 6, 2026
Signed-off-by: GitHub <noreply@github.com>
@kubestellar-prow
Copy link
Copy Markdown

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@kubestellar-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from clubanderson. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 6, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 6, 2026

Deploy Preview for kubestellar-docs ready!

Name Link
🔨 Latest commit 8ca9783
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6a2421576bc5080008e9d737
😎 Deploy Preview https://deploy-preview-5727--kubestellar-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Add missing workflow permissions declarations in copilot-dco.yml and markdownlint-cli2.yml Harden workflow token permissions, pin github-script SHA, and add CodeQL workflow config Jun 6, 2026
Copilot AI requested a review from clubanderson June 6, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: no Indicates the PR's author has not signed the DCO. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sec-check] Missing workflow permissions declarations in copilot-dco.yml and markdownlint-cli2.yml

2 participants