Skip to content

Conversation

@thpierce
Copy link
Contributor

Potential fix for https://github.com/aws/aws-xray-sdk-java/security/code-scanning/2

To fix the problem, you should add a permissions block to the workflow file. The preferred location is at the root level (top of the YAML), which will apply these permissions to all jobs that don't specify otherwise. The minimal, most secure starting point is contents: read, because all shown steps require at most read access to repository contents for checking out code, reading dependencies, caching, reporting, and publishing with secrets provided, rather than relying on GITHUB_TOKEN write access. No steps require write access to the repository via GITHUB_TOKEN (such as pushing code, creating PRs, or drafting releases). This change is made by inserting the permissions block immediately following the name: key (after line 1) in .github/workflows/master-build.yml.

Needed steps:

  • Insert the block:
    permissions:
      contents: read
    after the name: Master Build line (line 1).
  • No additional dependencies or changes are required.
  • No changes to per-job permissions, as no job in the shown code needs more than contents: read.

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>
@thpierce thpierce marked this pull request as ready for review October 14, 2025 16:42
@thpierce thpierce requested a review from a team as a code owner October 14, 2025 16:42
@thpierce thpierce merged commit 0d7e09c into master Oct 14, 2025
8 checks passed
@thpierce thpierce deleted the alert-autofix-2 branch October 14, 2025 20:18
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.

2 participants