Skip to content

MAINT: Add permissions to docker_build workflow#1441

Merged
spencrr merged 1 commit intomicrosoft:mainfrom
spencrr:spencrr/github-workflow-fix
Mar 7, 2026
Merged

MAINT: Add permissions to docker_build workflow#1441
spencrr merged 1 commit intomicrosoft:mainfrom
spencrr:spencrr/github-workflow-fix

Conversation

@spencrr
Copy link
Copy Markdown
Collaborator

@spencrr spencrr commented Mar 5, 2026

Description

Adds explicit permissions blocks to the docker_build.yml GitHub Actions workflow following the principle of least privilege.

Top-level permissions: contents: read ensures the GITHUB_TOKEN defaults to read-only across all jobs, even newly added ones. Job-level permissions: contents: read added to the 6 test jobs that were missing them:

  • test-local-import, test-local-gui, test-local-jupyter
  • test-pypi-import, test-pypi-gui, test-pypi-jupyter

The 3 build jobs (build-devcontainer, build-production-local, build-production-pypi) already had job-level permissions and remain unchanged.

Without a top-level permissions block, the workflow inherits the repository default token permissions (often write-all). If any step is compromised, the token has broader access than needed. All jobs in this workflow only require contents: 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.

Copy link
Copy Markdown
Contributor

@romanlutz romanlutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's still working, so I'll approve 🙂

@spencrr spencrr changed the title [WIP] MAINT Add permissions to docker_build workflow MAINT: Add permissions to docker_build workflow Mar 7, 2026
@spencrr spencrr force-pushed the spencrr/github-workflow-fix branch from c0ddd22 to 707bb7d Compare March 7, 2026 00:38
@spencrr spencrr marked this pull request as ready for review March 7, 2026 00:38
@spencrr spencrr merged commit ca474d7 into microsoft:main Mar 7, 2026
30 checks passed
riyosha pushed a commit to riyosha/PyRIT that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants