Skip to content

Potential fix for code scanning alert no. 6: Workflow does not contain permissions#24

Merged
BrooksCunningham merged 5 commits intomainfrom
fix_security_gh_action
Nov 18, 2025
Merged

Potential fix for code scanning alert no. 6: Workflow does not contain permissions#24
BrooksCunningham merged 5 commits intomainfrom
fix_security_gh_action

Conversation

@BrooksCunningham
Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/fastly/security-use-cases/security/code-scanning/6

The best fix is to add a permissions block at the top level of the workflow (after the name: and before or after the on: block) or specifically within the test job. In the absence of any need for write permissions, the recommended minimal starting point is to set permissions: contents: read. This provides the minimum repository access, and aligns with the principle of least privilege. The file to edit is .github/workflows/ngwaf-k8s-module-agent.yaml, and the change should add the block:

permissions:
  contents: read

immediately after the name: key (recommended), or within the job if you prefer. In this case, as the workflow has a single job, root-level permissions will apply succinctly and are preferred.


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

BrooksCunningham and others added 5 commits November 17, 2025 10:26
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@BrooksCunningham BrooksCunningham marked this pull request as ready for review November 17, 2025 16:28
@BrooksCunningham BrooksCunningham merged commit 54c32b0 into main Nov 18, 2025
5 of 6 checks passed
@BrooksCunningham BrooksCunningham deleted the fix_security_gh_action branch November 18, 2025 17:28
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