ci: declare workflow-level contents: read on 16 build/regen workflows - #2584
Conversation
|
@dotnet-policy-service agree |
|
Pretty sure these workflows make use of write permissions (to push the regenerated bindings) |
|
Good thing to check, and you're right that these workflows do push the regenerated bindings. I looked at how they authenticate that push, though, and it doesn't go through the default
A workflow-level I deliberately left Happy to walk through any specific file if you'd like, or drop any you're not comfortable with. |
Pins the default GITHUB_TOKEN to contents: read on every workflow in .github/workflows/. They are all native-library binding regen workflows (angle, assimp, dxvk, glfw, moltenvk, openal-soft, sdl2, shaderc, spirv-cross, spirv-reflect, swiftshader, vkd3d, vulkan-loader, wgpu) plus bindings-regeneration and codeowners checks. None call a GitHub API beyond the initial checkout. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection if the default ever widens, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
d22ff41 to
9ba99d7
Compare
Perksey
left a comment
There was a problem hiding this comment.
Hmmmm, okay I'll merge but I'm not happy with the AI-generated explanation, however accurate it may be. Would appreciate human words next time.
Pins the default
GITHUB_TOKENtocontents: readon every workflow in.github/workflows/. They are all native-library binding regen workflows (angle, assimp, dxvk, glfw, moltenvk, openal-soft, sdl2, shaderc, spirv-cross, spirv-reflect, swiftshader, vkd3d, vulkan-loader, wgpu) plus bindings-regeneration and codeowners checks. None of them call a GitHub API beyond the initial checkout.Why
CVE-2025-30066 (March 2025
tj-actions/changed-filessupply-chain compromise) exfiltratedGITHUB_TOKENfrom workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF ScorecardToken-Permissionscheck.YAML validated locally with
yaml.safe_loadon each touched file.