Skip to content

Conversation

@mykaul
Copy link
Contributor

@mykaul mykaul commented Dec 22, 2025

Potential fix for https://github.com/scylladb/scylla-machine-image/security/code-scanning/7

In general, the fix is to add an explicit permissions block either at the workflow root (applies to all jobs) or within the specific job that needs it. For this workflow, the job only needs to read repository contents (for checkout) and run commands in Docker containers; there’s no indication that it needs to write to the repo, PRs, issues, etc. Therefore, we can safely restrict GITHUB_TOKEN to contents: read.

The best minimal fix without changing functionality is to add a top-level permissions section right after the on: block. This will apply to the build job (and any future jobs that don’t override permissions) and set contents: read as recommended by CodeQL. No other changes to steps, commands, or actions are required. The edit will be in .github/workflows/build.yml, inserting:

permissions:
  contents: read

at the root level, aligned with on: and jobs:. No imports or external libraries are involved.

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

…. 7: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@mykaul mykaul changed the title Potential fix for code scanning alert no. 7: Workflow does not contain permissions .github/workflows/build.yml: Potential fix for code scanning alert no. 7: Workflow does not contain permissions Dec 22, 2025
@fruch fruch marked this pull request as ready for review December 28, 2025 16:22
Copy link
Collaborator

@fruch fruch left a comment

Choose a reason for hiding this comment

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

LGTM

@fruch fruch merged commit fd3389a into next Dec 28, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants