Skip to content

Potential fix for code scanning alert no. 17: Workflow does not contain permissions #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

j-baines
Copy link
Contributor

@j-baines j-baines commented Jun 9, 2025

Potential fix for https://github.com/vulncheck-oss/go-exploit/security/code-scanning/17

To fix the issue, we need to add a permissions block to the workflow. Since the workflow only performs basic CI tasks (build, lint, and test), it requires minimal permissions. The contents: read permission is sufficient for these operations. This block should be added at the root level of the workflow to apply to all jobs.

Steps to implement the fix:

  1. Add a permissions block at the root level of the workflow file.
  2. Set contents: read as the permission, which limits the GITHUB_TOKEN to read-only access to the repository contents.

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

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@j-baines j-baines marked this pull request as ready for review June 9, 2025 10:55
@j-baines j-baines merged commit ce298ca into main Jun 9, 2025
6 checks passed
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