MAINT: Add permissions to docker_build workflow#1441
Merged
spencrr merged 1 commit intomicrosoft:mainfrom Mar 7, 2026
Merged
Conversation
romanlutz
approved these changes
Mar 6, 2026
Contributor
romanlutz
left a comment
There was a problem hiding this comment.
Looks like it's still working, so I'll approve 🙂
c0ddd22 to
707bb7d
Compare
riyosha
pushed a commit
to riyosha/PyRIT
that referenced
this pull request
Mar 24, 2026
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.
Description
Adds explicit
permissionsblocks to thedocker_build.ymlGitHub Actions workflow following the principle of least privilege.Top-level
permissions: contents: readensures the GITHUB_TOKEN defaults to read-only across all jobs, even newly added ones. Job-levelpermissions: contents: readadded to the 6 test jobs that were missing them:test-local-import,test-local-gui,test-local-jupytertest-pypi-import,test-pypi-gui,test-pypi-jupyterThe 3 build jobs (
build-devcontainer,build-production-local,build-production-pypi) already had job-level permissions and remain unchanged.Without a top-level
permissionsblock, the workflow inherits the repository default token permissions (oftenwrite-all). If any step is compromised, the token has broader access than needed. All jobs in this workflow only requirecontents: read.Tests and Documentation
No test or documentation changes needed. This is a CI workflow configuration change only. The workflow YAML is syntactically valid and the permissions are consistent across all jobs.