Skip to content

Potential fix for code scanning alert no. 5: Workflow does not contain permissions - #284

Open
Tatsat (Tats) Mishra 🐉 (Tatsinnit) wants to merge 1 commit into
mainfrom
alert-autofix-5
Open

Tatsat (Tats) Mishra 🐉 (Tatsinnit) wants to merge 1 commit into
mainfrom
alert-autofix-5

Conversation

@Tatsinnit

Copy link
Copy Markdown
Member

Potential fix for https://github.com/Azure/aks-set-context/security/code-scanning/5

Add an explicit workflow-level permissions block to enforce least privilege for all jobs in .github/workflows/unit-tests.yml.

Best fix without changing functionality:

  • Add at the top level (after on: block, before jobs:):
    • permissions:
    • contents: read
  • This grants only read access to repository contents for GITHUB_TOKEN, which is sufficient for checkout and typical test/build operations in this workflow.
  • No imports, methods, or dependency changes are needed (YAML config only).

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Tatsinnit
Tatsat (Tats) Mishra 🐉 (Tatsinnit) marked this pull request as ready for review November 29, 2026 23:57
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