You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2022/05/13 12:50:09 UTC

[httpcomponents-client] branch master updated: chore: Set permissions for GitHub actions

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new 47d094637 chore: Set permissions for GitHub actions
47d094637 is described below

commit 47d0946372e757ca6e7a366e340f0dba6686b012
Author: nathannaveen <42...@users.noreply.github.com>
AuthorDate: Fri May 13 01:30:12 2022 +0000

    chore: Set permissions for GitHub actions
    
     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: nathannaveen <42...@users.noreply.github.com>
---
 .github/workflows/codeql-analysis.yml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index bb5133149..c74db288a 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -38,8 +38,15 @@ on:
   schedule:
     - cron: '16 7 * * 5'
 
+permissions:
+  contents: read
+
 jobs:
   analyze:
+    permissions:
+      actions: read  # for github/codeql-action/init to get workflow details
+      contents: read  # for actions/checkout to fetch code
+      security-events: write  # for github/codeql-action/analyze to upload SARIF results
     name: Analyze
     runs-on: ubuntu-latest