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/5

In general, the fix is to explicitly define a minimal permissions: block for the workflow or for the specific job, instead of relying on repository defaults. Because this workflow only reads GitHub context values and does not perform any GitHub write operations, we can safely restrict GITHUB_TOKEN to read-only.

The best targeted fix here is to add a permissions: section at the job level for trigger-jenkins, directly under runs-on: ubuntu-latest. That makes the job self-contained and ensures the GITHUB_TOKEN has only read access. A minimal and clear configuration is:

permissions:
  contents: read

or, if you prefer a single-line shorthand for all read permissions:

permissions: read-all

Given the current usage, contents: read is sufficient and explicit. No imports, methods, or other code constructs are needed—only the YAML addition within .github/workflows/trigger_jenkins.yaml. No existing steps or behavior need to change.

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

…ng alert no. 5: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@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 8a9ab4f into next Dec 28, 2025
14 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