Skip to content

Conversation

@timireland
Copy link
Contributor

Potential fix for https://github.com/NHSDigital/nhs-notify-admail/security/code-scanning/91

To fix this issue, you need to add an explicit permissions block to the workflow to restrict the GITHUB_TOKEN permissions to the minimum required. Since none of the current workflow steps require more than read access (they only check out code, run shell commands, and echo), the minimal necessary permission is contents: read. This should be set at the workflow level (before the jobs: key) so it applies to all jobs—unless specific jobs require broader permissions. Add the following block near the top of the YAML file after the name and before on::

permissions:
  contents: read

This ensures that all jobs and steps run with read-only permissions on the contents, aligning with the principle of least privilege.


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