security: narrow the release token to the job that needs it - #33
Merged
Conversation
The workflow held contents: write for its whole run. It now runs with contents: read and grants write only to the job that publishes the release. OpenSSF Scorecard scores Token-Permissions 0 out of 10 whenever any workflow carries a top-level write permission, however little of the run needs it. This one line was what held the check at zero. Co-Authored-By: Claude Opus 5 <[email protected]>
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.
Was
release.ymlhieltcontents: writefür den gesamten Lauf. Das Recht wandert in den einen Job, der das Release veröffentlicht, alles andere läuft mitcontents: read.Warum das messbar zählt
OpenSSF Scorecard bewertet den Check Token-Permissions mit 0 von 10, sobald irgendein Workflow ein Schreibrecht auf oberster Ebene trägt, unabhängig davon, wie wenig des Laufs es braucht.
Beleg aus dem eigenen Portfolio:
agent-governance-consoleundServiceLLMsetzen das Recht bereits auf Job-Ebene und sind die einzigen beiden Repos mit Token-Permissions 10 von 10. Sie führen auch die Gesamtwertung an.Umfang
Diese Änderung geht durch 26 Repos. Die Platzierung wurde pro Workflow aus dessen Job-Struktur bestimmt: bei geteilten Workflows bekommt nur der Release-Job das Recht, der Build-Job lädt lediglich Artefakte hoch und braucht es nicht. Jede Datei wurde nach der Änderung als YAML validiert.