Draft
Conversation
* detect commonly used GitHub owned actions use a map to suggest the minimum permissions needed for the GITHUB_TOKEN
Contributor
Author
|
Hi @dave-bartolomeo here's the draft we discussed |
| // using the data extension or there are no uses steps | ||
| // that are children of the job | ||
| boolean unknownPermissions(Job job) { | ||
| minPermissions(job) = "" and result = true or count(job.getAChildNode*().(MinimumActionsPermissions)) = 0 and result = true |
Check warning
Code scanning / CodeQL
Counting zero elements Warning
| not e.getName() = "workflow_call" | ||
| ) | ||
| select job, | ||
| "Actions Job or Workflow does not set permissions. Recommended minimum permissions are ($@)", |
Check warning
Code scanning / CodeQL
Alert message style violation Warning
| ) | ||
| select job, | ||
| "Actions Job or Workflow does not set permissions. Recommended minimum permissions are ($@)", | ||
| job, getMinPermissions(job) |
Check warning
Code scanning / CodeQL
Alert message style violation Warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request checklist
Add a map to suggest the minimum permissions needed for the GITHUB_TOKEN when commonly used GitHub owned actions are detected
All query authors
.qhelp. See the documentation in this repository.Internal query authors only
.ql,.qll, or.qhelpfiles. See the documentation (internal access required).