Skip to content

Commit e7abcd4

Browse files
henriettelienrebnorgithub-advanced-security[bot]daghovland
authored
Potential fix for code scanning alert no. 1: Workflow does not contain permissions (#170)
This PR fixes [AB#379924](https://dev.azure.com/EquinorASA/bb9bd8cb-74f7-4ffa-b0cb-60eff0a0be58/_workitems/edit/379924) Potential fix for [https://github.com/equinor/Dexpi2Imf/security/code-scanning/1](https://github.com/equinor/Dexpi2Imf/security/code-scanning/1) To fix this CodeQL warning, add an explicit `permissions` block to the workflow file `.github/workflows/rdf_tests.yml`. The correct location is at the root level, above `jobs:`; this will apply the permissions to all jobs in the workflow. Since none of the steps modify the repo, raise issues, or interact with pull requests, the minimal required permission is likely `contents: read`. This limits the GITHUB_TOKEN such that it can only read the repository contents, reducing the attack surface in case of malicious actors or missteps within the workflow. No changes to steps or logic are required, only the addition of the permissions block at the root of the YAML. _Suggested fixes powered by Copilot Autofix. Review carefully before merging._ Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Dag Hovland <dhovl@equinor.com>
1 parent ceda695 commit e7abcd4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/rdf_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
merge_group:
66
pull_request:
77

8+
permissions:
9+
contents: read
810
jobs:
911
build:
1012
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)