Skip to content

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

Merged
garloff merged 2 commits into
mainfrom
alert-autofix-2
Dec 3, 2025
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#337
garloff merged 2 commits into
mainfrom
alert-autofix-2

Conversation

@garloff

@garloff garloff commented Dec 2, 2025

Copy link
Copy Markdown
Member

Potential fix for https://github.com/SovereignCloudStack/docs/security/code-scanning/2

To fix this problem, you should add a permissions block to the workflow to explicitly minimize the GITHUB_TOKEN permissions. Since the workflow only checks out the repository, installs Node and dependencies, and builds the site, the job does not appear to require any write permissions. The minimal permission required is contents: read, which allows the workflow to read repository contents (needed by actions/checkout). Add the following block above jobs: in .github/workflows/build.yml:

permissions:
  contents: read

This will ensure that GITHUB_TOKEN is restricted to a minimal, read-only scope.

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>
Signed-off-by: Kurt Garloff <kurt@garloff.de>
@garloff garloff self-assigned this Dec 2, 2025
@garloff garloff added bug Something isn't working documentation Improvements or additions to documentation labels Dec 2, 2025
@garloff
garloff marked this pull request as ready for review December 2, 2025 18:56
@garloff
garloff requested a review from maxwolfs December 2, 2025 18:58

@mbuechse mbuechse 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.

To be frank, I don't feel competent to judge this change, but I will be happy to assist in mending any problems arising from it.

@garloff
garloff merged commit 326966a into main Dec 3, 2025
7 checks passed
@garloff
garloff deleted the alert-autofix-2 branch December 3, 2025 14:04
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Sovereign Cloud Stack Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants