Skip to content

Use minimum required permissions for GitHub workflows#8569

Merged
Stypox merged 1 commit intoTeamNewPipe:devfrom
triallax:add-workflow-permissions
Jul 13, 2022
Merged

Use minimum required permissions for GitHub workflows#8569
Stypox merged 1 commit intoTeamNewPipe:devfrom
triallax:add-workflow-permissions

Conversation

@triallax
Copy link
Copy Markdown
Contributor

@triallax triallax commented Jul 3, 2022

What is it?

  • Meta improvement to the project (dev facing)

Description of the changes in your PR

Use minimum needed permissions for GitHub workflows and jobs. This reduces the attack surface if the workflows are ever compromised.

Due diligence

This reduces the attack surface if the workflows are ever compromised.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jul 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@triallax triallax marked this pull request as ready for review July 3, 2022 18:15
@triallax triallax added the CI Everything related to CI (Continuous integration) label Jul 3, 2022
@triallax
Copy link
Copy Markdown
Contributor Author

triallax commented Jul 3, 2022

The SonarCloud failure is unrelated, this should be good to go.

@triallax
Copy link
Copy Markdown
Contributor Author

triallax commented Jul 5, 2022

We should also probably set the GITHUB_TOKEN permissions to "restrictive" on our existing repositories and on the organization as a whole: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_toke

Copy link
Copy Markdown
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TobiGr @Stypox @TheAssassin
You may have a look at @mhmdanas last comment...

@litetex
Copy link
Copy Markdown
Member

litetex commented Jul 10, 2022

See also TeamNewPipe/NewPipeExtractor#869

Copy link
Copy Markdown
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have manually specified permissions for each workflow, I made the default permissions read-only. Let's see if this works correctly...
image

@Stypox Stypox merged commit 0b644fd into TeamNewPipe:dev Jul 13, 2022
@Stypox Stypox mentioned this pull request Aug 27, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Everything related to CI (Continuous integration)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants