Skip to content

Comments

Potential fix for code scanning alert no. 7: Workflow does not contain permissions#64

Open
perinst wants to merge 1 commit intofeature/mergefrom
hotfix/pipeline
Open

Potential fix for code scanning alert no. 7: Workflow does not contain permissions#64
perinst wants to merge 1 commit intofeature/mergefrom
hotfix/pipeline

Conversation

@perinst
Copy link
Collaborator

@perinst perinst commented May 10, 2025

Potential fix for https://github.com/perinst/dozu-api-service/security/code-scanning/7

To fix the issue, we will add a permissions block to the workflow. This block will be added at the root level to apply to all jobs unless overridden by job-specific permissions blocks. Based on the workflow's operations, the minimal required permissions are:

  • contents: read for accessing repository contents (e.g., during the build job).
  • No write permissions are required since the workflow does not modify repository contents or perform actions like creating releases.

We will add the following permissions block at the root level:

permissions:
  contents: read

This ensures that the GITHUB_TOKEN has only read access to repository contents, adhering to the principle of least privilege.


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>
@perinst perinst marked this pull request as ready for review May 10, 2025 12:44
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