Repository navigation
docs: reduce permission scope - #2261
Conversation
Only the `deploy` task needs the "pages/id-token:write" permissions. Let's try to limit the potential for badness by only giving that specific job step elevated permission. This was flagged[0] by running Zizmor on the `.github/workflows` dir with Zizmor 0.7.0 in offline mode and seems like a sensible idea. [0]: https://woodruffw.github.io/zizmor/audits/#remediation_2
Benchmark resultsInstruction countsSignificant differencesThere are no significant instruction count differences Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2261 +/- ##
=======================================
Coverage 94.64% 94.64%
=======================================
Files 102 102
Lines 23974 23974
=======================================
Hits 22690 22690
Misses 1284 1284 ☔ View full report in Codecov by Sentry. |
ctz
left a comment
There was a problem hiding this comment.
Thanks for doing this!
My thoughts:: I'd prefer to concentrate on minimising any and all privileges for GHA (like this PR does), rather than try and affix on third party steps. I don't think it's feasible to review those, so we should treat them as untrustworthy and pre-compromised.
(This is also why I don't personally care for release-plz and similar, giving GHA rights to publish your crate feels like the first step on a very painful journey.)
That aligns with my views. I appreciate that our CI is "boring". I won't bother with any follow-ups to switch to SHA pins.
I'm warmer to the idea depending on specific context but for a crate like Rustls it feels like the wrong tradeoff 👍 |
Agreed that reviewing actions changes in any amount of depth is not feasible, so keeping scope minimal seems like the right direction to me.
There will be first-class support for trusted publishing soonish so that might be a more interesting avenue to explore. |
I think this specific error code is because |
Only the
deploytask needs the "pages/id-token:write" permissions. Let's try to limit the potential for badness by only giving that specific job step elevated permission instead of doing it at the workflow level.This was flagged by running Zizmor on the
.github/workflowsdir with Zizmor 0.7.0 in offline mode and seems like a sensible idea.If you run this tool in online mode w/ a
GH_TOKENit also flags several ref-confusion findings for our usage of install-action. I'm not 100% sure why it didn't flag the other instances where we specify dependent actions by tag (e.g.checkout@v4), but the fix in either case is to pin our actions by SHA hash. Since that's a bit more invasive I haven't made that change yet pending some discussion on whether it's something folks are on-board for.