File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -241,8 +241,9 @@ func calculateScore(result map[string]permissions) int {
241241
242242 // contents.
243243 // Allows attacker to commit unreviewed code.
244+ // Scoring does not apply to job-level permissions, as this is a common place to use third-party actions.
244245 // High risk: -10
245- if permissionIsPresent (perms , "contents" ) {
246+ if permissionIsPresentInTopLevel (perms , "contents" ) {
246247 score -= checker .MaxResultScore
247248 }
248249
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ func TestGithubTokenPermissions(t *testing.T) {
251251 filenames : []string {"./testdata/.github/workflows/github-workflow-permissions-contents-writes-no-release.yaml" },
252252 expected : scut.TestReturn {
253253 Error : nil ,
254- Score : checker .MinResultScore ,
254+ Score : checker .MaxResultScore ,
255255 NumberOfWarn : 1 ,
256256 NumberOfInfo : 1 ,
257257 NumberOfDebug : 4 ,
You can’t perform that action at this time.
0 commit comments