-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Minimum Permissions Map #18517
base: main
Are you sure you want to change the base?
Add Minimum Permissions Map #18517
Conversation
* detect commonly used GitHub owned actions use a map to suggest the minimum permissions needed for the GITHUB_TOKEN
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
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.qhelp
files. See the documentation (internal access required).