Skip to content

Potential fix for code scanning alert no. 5: Workflow does not contain permissions - #776

Closed
berland wants to merge 1 commit into
mainfrom
alert-autofix-5
Closed

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#776
berland wants to merge 1 commit into
mainfrom
alert-autofix-5

Conversation

@berland

@berland berland commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/equinor/semeio/security/code-scanning/5

The best way to fix this problem is to specify the job's permissions so that the GITHUB_TOKEN granted to each job only has the minimal required access, rather than inheriting potentially dangerous repository defaults. Since this workflow does not require write access to the repository or any other special privileges, the optimal fix is to add a permissions: block to the job definition for type-checking (line 15), setting contents: read. This can be done by inserting:

permissions:
  contents: read

immediately after line 15 (under type-checking:), before any steps. No new packages or imports are required.

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>
@berland
berland marked this pull request as ready for review October 8, 2025 10:31
@berland berland self-assigned this Oct 8, 2025
@berland berland added this to SCOUT Oct 8, 2025
@berland berland moved this to Ready for Review in SCOUT Oct 8, 2025
@berland berland moved this from Ready for Review to In Progress in SCOUT Oct 8, 2025
@berland

berland commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator Author

Superseded by #778

@berland berland closed this Oct 8, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in SCOUT Oct 8, 2025
@frode-aarstad
frode-aarstad deleted the alert-autofix-5 branch December 18, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant