Set minimum permissions for workflows

Open
#1,900 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions
Domain
ci-cd, security

Research direction

Start by reviewing the workflows under .github/workflows, including ci-java7.yaml around line 42, and compare their actions with the GitHub Actions permissions documentation linked in the issue. Identify the minimum permissions each workflow needs, then verify that workflows using actions/checkout retain the required read access and that all workflow files follow the intended restriction.

Written by the indexing model from the issue text.

Description

type: feature request

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe.
GitHub workflows are granted high permissions by default. Permissions that allow, for example, to delete your source code and publish releases. The permissions can be exploited by malicious actions run in the workflow or malicious PRs if run on pull_request_target. This is specially important when using 3P actions such as:
https://github.com/googleapis/google-http-java-client/blob/1acedf75368f11ab03e5f84dd2c58a8a8a662d41/.github/workflows/ci-java7.yaml#L42.

Describe the solution you'd like
Set restricted permissions to run GitHub workflows or declare minimum permissions in the workflows.
e.g. permissions: contents: read for workflows that only need to do actions/checkout.

Describe alternatives you've considered
None.

Additional context
My name is Gabriela and I work on behalf of Google and the OpenSSF suggesting supply-chain security changes.

Dominant language
Java
Stars
1.4k
Forks
476
Avg merge
10h 47m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-http-java-client

All issues in googleapis/google-http-java-client

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.