Skip to content

Potential fix for code scanning alert no. 16,17,18,19: Workflow does not contain permissions - #275

Merged
yeoldegrove merged 4 commits into
mainfrom
fix/workflow-permissions
Dec 1, 2026
Merged

yeoldegrove merged 4 commits into
mainfrom
fix/workflow-permissions

Conversation

@yeoldegrove

@yeoldegrove yeoldegrove commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/gardenlinux/docs/security/code-scanning/16, https://github.com/gardenlinux/docs/security/code-scanning/17, https://github.com/gardenlinux/docs/security/code-scanning/18, https://github.com/gardenlinux/docs/security/code-scanning/19

Add an explicit top-level permissions section to restrict the default GITHUB_TOKEN scope.

Best fix (without changing functionality):

  • Insert at workflow root (after name, before on) a permissions block:
    • contents: read

Why this is best:

  • Satisfies CodeQL requirement for explicit permissions.
  • Enforces least privilege for the implicit token.
  • Does not interfere with existing GitHub App token usage for write operations.

yeoldegrove and others added 4 commits December 1, 2026 14:58
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
@yeoldegrove yeoldegrove changed the title Potential fix for code scanning alert no. 16: Workflow does not contain permissions Potential fix for code scanning alert no. 16,17,18,19: Workflow does not contain permissions Dec 1, 2026
@yeoldegrove
yeoldegrove marked this pull request as ready for review December 1, 2026 14:00
@yeoldegrove
yeoldegrove requested a review from ByteOtter December 1, 2026 14:00
@yeoldegrove yeoldegrove self-assigned this Dec 1, 2026
@yeoldegrove yeoldegrove added this to the 2026-12 milestone Dec 1, 2026
@yeoldegrove
yeoldegrove merged commit a1f75b2 into main Dec 1, 2026
28 of 31 checks passed
@yeoldegrove
yeoldegrove deleted the fix/workflow-permissions branch December 1, 2026 14:07
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