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

Reduce scorecard workflow permissions scope #2326

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

robert-cronin
Copy link
Collaborator

@robert-cronin robert-cronin commented Nov 29, 2024

Description of the PR

Fixes #2275

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If GraphQL schema is changed, GraphQL client updates/additions have been made
  • If OpenAPI spec is changed, make generate has been run
  • If ent schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@robert-cronin robert-cronin force-pushed the fix/zizmore-scorecard-warning branch from 4f86ef0 to c7f93be Compare November 29, 2024 00:03
@robert-cronin
Copy link
Collaborator Author

I did try with the id-token: write permission set but it seems that the Scorecard API has some checks to ensure the integrity of the data, including default branch check:

https://github.com/robert-cronin/guac/actions/runs/12076752606/job/33678574053
https://github.com/ossf/scorecard-action?tab=readme-ov-file#workflow-restrictions

Copy link
Contributor

@funnelfiasco funnelfiasco left a comment

Choose a reason for hiding this comment

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

We shouldn't declare write permissions at the workflow level as a matter of practice. Write permissions should be granted on a per-job basis as needed. The practical effect is the same here, since there's only one job, but the tooling will still complain :-)

@robert-cronin robert-cronin force-pushed the fix/zizmore-scorecard-warning branch from c7f93be to f7fe0a3 Compare December 2, 2024 22:21
@robert-cronin
Copy link
Collaborator Author

We shouldn't declare write permissions at the workflow level as a matter of practice. Write permissions should be granted on a per-job basis as needed. The practical effect is the same here, since there's only one job, but the tooling will still complain :-)

Oh, I missed the existing id-token permission set on the job level! Thank you for catching that! I'll take out the permission I added to the workflow level

@robert-cronin robert-cronin force-pushed the fix/zizmore-scorecard-warning branch from f7fe0a3 to 0c3b288 Compare December 2, 2024 22:30
Copy link
Contributor

@funnelfiasco funnelfiasco left a comment

Choose a reason for hiding this comment

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

LGTM!

@kodiakhq kodiakhq bot merged commit 5f4b21c into guacsec:main Dec 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zizmor audit for scorecard workflow
4 participants