Set permissions for GitHub actions (#5237)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									0729261b62
								
							
						
					
					
						commit
						5c9ef9a843
					
				
							
								
								
									
										6
									
								
								.github/workflows/invalid_question.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/invalid_question.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,8 +3,14 @@ on: | ||||
|   schedule: | ||||
|   - cron: "*/10 * * * *" | ||||
| 
 | ||||
| permissions: | ||||
|   contents: read | ||||
| 
 | ||||
| jobs: | ||||
|   stale: | ||||
|     permissions: | ||||
|       issues: write  # for actions/stale to close stale issues | ||||
|       pull-requests: write  # for actions/stale to close stale PRs | ||||
|     runs-on: ubuntu-latest | ||||
|     env: | ||||
|       ACTIONS_STEP_DEBUG: true | ||||
|  | ||||
							
								
								
									
										6
									
								
								.github/workflows/missing_playground.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/missing_playground.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,8 +3,14 @@ on: | ||||
|   schedule: | ||||
|   - cron: "*/10 * * * *" | ||||
| 
 | ||||
| permissions: | ||||
|   contents: read | ||||
| 
 | ||||
| jobs: | ||||
|   stale: | ||||
|     permissions: | ||||
|       issues: write  # for actions/stale to close stale issues | ||||
|       pull-requests: write  # for actions/stale to close stale PRs | ||||
|     runs-on: ubuntu-latest | ||||
|     env: | ||||
|       ACTIONS_STEP_DEBUG: true | ||||
|  | ||||
							
								
								
									
										6
									
								
								.github/workflows/stale.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/stale.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,8 +3,14 @@ on: | ||||
|   schedule: | ||||
|   - cron: "0 2 * * *" | ||||
| 
 | ||||
| permissions: | ||||
|   contents: read | ||||
| 
 | ||||
| jobs: | ||||
|   stale: | ||||
|     permissions: | ||||
|       issues: write  # for actions/stale to close stale issues | ||||
|       pull-requests: write  # for actions/stale to close stale PRs | ||||
|     runs-on: ubuntu-latest | ||||
|     env: | ||||
|       ACTIONS_STEP_DEBUG: true | ||||
|  | ||||
							
								
								
									
										3
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							| @ -8,6 +8,9 @@ on: | ||||
|     branches-ignore: | ||||
|       - 'gh-pages' | ||||
| 
 | ||||
| permissions: | ||||
|   contents: read | ||||
| 
 | ||||
| jobs: | ||||
|   # Label of the container job | ||||
|   sqlite: | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Naveen
						Naveen