Repository navigation
ci: Give sign-windows.yaml a read-only top-level token default (#962) - #2659
Merged
Merged
Conversation
GREEN: sign-windows.yaml gains 'permissions: { contents: read }' and its
SEC-002 [[exceptions]] block is deleted. ci-lint precheck drops the
'no top-level permissions block' line and the header falls 545 -> 544
approved exceptions, with no new violation.
Refs #962
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
.github/workflows/sign-windows.yamlcarried no top-levelpermissionsblock, so GitHub applied the wider repository default to the reusable workflow ([SEC-002] no top-level 'permissions' block). This adds a read-only default and deletes the file's SEC-002[[exceptions]]block.RED
595942412— newSignWindowsPermissionsTestinci/test_ci_toml.pyfails on the base:sign-windows.yaml needs a top-level permissions blockandthe SEC-002 exception for sign-windows.yaml must be deleted.GREEN
ci/test_ci_toml.py26 tests OK;ci/test_uv_run.py5 OK;ruff checkclean.ci-lint precheck(pina1917ce) loses the line and the header falls 545 → 544 approved exceptions, with no new violation (11 before and after):git diff origin/master -- ci.tomlshows only this file's six-line block gone.Caveat for the reviewer
The local copy of this reusable workflow is not invoked by any workflow in this repo:
push.yaml'ssign-windows-buildjob calls the pinned upstreamobsproject/obs-studio/.github/workflows/sign-windows.yaml@<sha>and is guarded bygithub.repository_owner == 'obsproject'. So the read-only default has no runtime effect here.The
create-windows-updatejob does request an OIDC token (the "Parse JWT" step +actions/attest), and today it relies on the caller's grants (contents: read,id-token: write,attestations: writein push.yaml). SEC-002 does not allow a job-levelid-token: writeon this job (it is only permitted on an OIDC publisher), so this PR takes the tool's prescribed top-level-only fix. If a caller in this repo is ever repointed at the local copy, the signing job'sid-token/attestationsgrants must be expressed on the job — a follow-up decision that also affects push.yaml'ssign-windows-build.Refs #962