-
Notifications
You must be signed in to change notification settings - Fork 496
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
⚠️ Warn and not fail if job perms are content:write #2355
⚠️ Warn and not fail if job perms are content:write #2355
Conversation
If we want to warn on write permissions, but not affect scoring if defined at the run level, this might be better addressed in the scoring code. Curious what others think. Various unit tests ( scorecard/checks/evaluation/permissions.go Line 191 in 36d6a34
The various calls to |
Thanks @spencerschrock, I think it's a good idea to shift the change into the calculate function instead. |
Integration tests success for |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2355 +/- ##
=======================================
Coverage 40.55% 40.55%
=======================================
Files 112 112
Lines 8822 8822
=======================================
Hits 3578 3578
Misses 4984 4984
Partials 260 260 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll let @spencerschrock 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. May be worth adding packages
as that's another permission which results in a -10
deduction if not on the allowlist.
There's also an allowlist for security-events
, but I imagine that's much less commonly used and only a -1
deduction.
Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com>
Integration tests success for |
Thanks @spencerschrock! I raised packages as a suggestion for discussion on #2338 so we can make a PR for that as well if there is agreement |
…ssf#2355) Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: latortuga <latortugaaaa>
…ssf#2355) Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: nathaniel.wert <nathaniel.wert@kudelskisecurity.com>
…ssf#2355) Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: nathaniel.wert <nathaniel.wert@kudelskisecurity.com>
…ssf#2355) Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com> Signed-off-by: Eddie Knight <iv.eddieknight@gmail.com>
Following discussion in #2338, it has been determined that the permissions check should no longer deduct when a job is set to write. This code is a minimalist change, and will require additional polish/cleanup of obsolete logic later.
Signed-off-by: Eddie Knight iv.eddieknight@gmail.com
What kind of change does this PR introduce?
Changes how scoring is done for token permissions
What is the current behavior?
The Token-Permissions check is opinionated regarding job-level permissions.
What is the new behavior (if this is a feature change)?**
The Token-Permissions check now will only issue a warning regarding job-level permissions.
Which issue(s) this PR fixes
Fixes #2338
Special notes for your reviewer
I wasn't able to get the Token-Permissions check to report anything lower than 10/10 when running locally, even for repos that are less than 10 when checked via the API. As such, my validation checks were limited. I suggest a regular contributor or maintainer validates these changes before merging.
Does this PR introduce a user-facing change?