Skip to content

Conversation

@simongdavies
Copy link
Contributor

Potential fix for https://github.com/hyperlight-dev/cargo-hyperlight/security/code-scanning/4

To fix the problem, the workflow should explicitly declare the minimum necessary permissions by adding a permissions block. Since none of the jobs require write access to repository contents, issues, or pull requests, setting permissions: contents: read at the workflow level (immediately under name: CI) covers all jobs while enforcing least privilege. This applies the restriction to all jobs unless a job-specific override is declared. The change should be made by inserting the following block at the top of the workflow file after the name key:

permissions:
  contents: read

No additional imports, methods, or definitions are needed. The fix can be implemented by adding these lines after line 3 and before on: (at line 5 as per the provided lines).


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>
@simongdavies simongdavies marked this pull request as ready for review November 27, 2025 17:56
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