Skip to content
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

ci: add minimum GitHub token permissions for workflow #78

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ashishkurmi
Copy link

Description

This PR adds minimum token permissions for the GITHUB_TOKEN in GitHub Actions workflows using secure-workflows.

The GitHub Actions workflow has a GITHUB_TOKEN with write access to multiple scopes. Here is an example of the permissions in one of the workflow runs:
https://github.com/qt/qtbase/actions/runs/3168920282/jobs/5160466776#step:1:19

After this change, the scopes will be reduced to the minimum needed for the following workflow:

  • ninja-build.yml

Motivation and Context

  • This is a security best practice, so if the GITHUB_TOKEN is compromised due to a vulnerability or compromised Action, the damage will be reduced.
  • GitHub recommends defining minimum GITHUB_TOKEN permissions.
  • The Open Source Security Foundation (OpenSSF) Scorecards also treats not setting token permissions as a high-risk issue. This change will help increase the Scorecard score for this repository.

Signed-off-by: Ashish Kurmi [email protected]

@jonaski
Copy link
Contributor

jonaski commented Oct 25, 2022

Qt doesn't use GitHub, this needs to be submitted to Gerrit codereview (https://codereview.qt-project.org/). For instructions see: https://wiki.qt.io/Setting_up_Gerrit and https://wiki.qt.io/Gerrit_Introduction

Copy link

cla-assistant bot commented Nov 15, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants