Skip to content

Potential fix for code scanning alert no. 29: Workflow does not contain permissions#1484

Closed
rocketstack-matt wants to merge 1 commit intomainfrom
alert-autofix-29
Closed

Potential fix for code scanning alert no. 29: Workflow does not contain permissions#1484
rocketstack-matt wants to merge 1 commit intomainfrom
alert-autofix-29

Conversation

@rocketstack-matt
Copy link
Member

Potential fix for https://github.com/finos/architecture-as-code/security/code-scanning/29

To fix the problem, add a permissions block to the workflow file to explicitly set the minimal required permissions for the GITHUB_TOKEN. Since the workflow only needs to read repository contents, set contents: read at the top level of the workflow (just after the name: line and before on:). This will apply the restriction to all jobs in the workflow. No other changes are needed, as none of the steps require additional permissions.


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>
@rocketstack-matt rocketstack-matt marked this pull request as ready for review August 6, 2025 11:46
Copilot AI review requested due to automatic review settings August 6, 2025 11:46
@rocketstack-matt rocketstack-matt requested a review from a team as a code owner August 6, 2025 11:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a security code scanning alert by adding explicit permissions to a GitHub Actions workflow. The change restricts the GITHUB_TOKEN to only have read access to repository contents, following the principle of least privilege.

Key Changes

  • Added minimal permissions block to workflow file to address security vulnerability

@@ -1,4 +1,6 @@
name: Build Calm Hub For Unit Test Coverage
permissions:
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The permissions block should be placed after the 'name' field but before the 'on' field for better organization and clarity. Consider adding a blank line before the permissions block to improve readability.

Copilot uses AI. Check for mistakes.
@rocketstack-matt rocketstack-matt deleted the alert-autofix-29 branch August 6, 2025 11:50
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