Skip to content

test(ci): scope workflow credentials and pin actions - #15006

Merged
google-oss-prow[bot] merged 2 commits into
kubeflow:masterfrom
jeffspahr:codex/actions-least-privilege
Oct 21, 2026
Merged

google-oss-prow[bot] merged 2 commits into
kubeflow:masterfrom
jeffspahr:codex/actions-least-privilege

Conversation

@jeffspahr

Copy link
Copy Markdown
Collaborator

Problem

Several CI workflows inherit the repository's default token permissions instead of declaring what they need. Some dry-run and PR build paths also receive publishing scopes, and most checkouts leave a token available to later build commands. This increases the impact of compromised build code or an action dependency. Simply lowering the repository default would also break reusable image publication callers that do not explicitly allow their callees' permissions.

Changes

  • Give every workflow job explicit permission scopes; preserve required artifact polling, metadata updates, workflow approvals, security reports, and analyzer cancellation behavior.
  • Isolate read-only image dry runs and native tooling PR builds from publishing jobs. Keep image matrices, digest/provenance records, native source comparisons, and verified manifest promotion intact.
  • Separate read-only Python package builds from the OIDC-only publisher. Verify an exact checksum inventory before upload, preserve legacy package selection and dry-run artifacts, and retain failed-job retry behavior through same-run package artifacts.
  • Disable checkout credential persistence, remove unnecessary token environment variables and inherited secrets, and pin existing external action versions to full commit SHAs, including composite dependencies.
  • Add permission, reusable-caller, publication, artifact-integrity, and retry regression coverage; document the staged settings rollout.

Validation

  • 791 resource-script tests, 27 repo-local workflow-script tests, and 7 JUnit-action tests pass. Two network-dependent manifest-rendering methods remain for hosted CI; no source skips were added.
  • Real uv 0.10.3 wheel/sdist output passes the publication staging and checksum verification steps; legacy Makefile package output remains compatible.
  • The configured pre-commit hook chain passes twice, including actionlint. Regenerating the CI workflow inventory produces no diff.
  • No package or image publication was performed as a test. Hosted PR checks provide the full integration evidence.

Rollout

Repository settings are unchanged. Merge and validate these workflow changes before changing settings. Before lowering the repository token default, minimally backport the required image-build/publication caller permissions to supported release branches (including release-2.18) and validate their CI and release dry runs. SHA-policy enforcement and an action allowlist require release-ref and transitive-dependency compatibility checks. A protected PyPI environment remains a coordinated follow-up because its identity must match the external Trusted Publisher configuration.

Checklist:

Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 03:22
@google-oss-prow
google-oss-prow Bot requested review from mprahl and nsingla October 21, 2026 03:22
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Contributor Report for @jeffspahr

Metric Value
Kubeflow org member Yes
Issues opened in kubeflow/pipelines 354
Merged PRs in kubeflow/pipelines 292
GitHub account age 3470 days (created 2017-04-21)
PR comments in kubeflow/pipelines 1511

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Broad changes to credential and publication boundaries require maintainer review of hosted integration evidence.

No open issues 🎉

What changed in this PR

Hardens Kubeflow Pipelines CI credentials and action dependencies while preserving build, publication, and metadata workflows.

Changes:

  • Declares explicit token permissions, disables checkout credential persistence, and pins external actions.
  • Separates read-only builds from publication, adding checksum-verified package handoff.
  • Adds regression coverage and documents the staged repository-settings rollout.
File Description
docs/​agents/​ci.md Documents credential boundaries and rollout.
.github/​workflows/​validate-generated-files.yml Scopes permissions and hardens checkouts.
.github/​workflows/​upgrade-test.yml Declares caller permissions and pins actions.
.github/​workflows/​stale.yml Restricts defaults and pins stale action.
.github/​workflows/​sdk-yapf.yml Applies read-only checkout hardening.
.github/​workflows/​sdk-upgrade.yml Applies read-only checkout hardening.
.github/​workflows/​sdk-isort.yml Applies read-only checkout hardening.
.github/​workflows/​sdk-docformatter.yml Applies read-only checkout hardening.
.github/​workflows/​runtime-base-images.yml Hardens producer credentials and action references.
.github/​workflows/​readthedocs-builds.yml Applies read-only checkout hardening.
.github/​workflows/​python-syntax.yml Pins actions and disables persisted credentials.
.github/​workflows/​publish-packages.yml Separates builds from checksum-verified PyPI publication.
.github/​workflows/​presubmit-backend.yml Applies read-only checkout hardening.
.github/​workflows/​pre-commit.yml Pins checkout, Python, and pre-commit actions.
.github/​workflows/​pr-gate.yml Reduces issue permissions and pins actions.
.github/​workflows/​osv-scanner.yml Pins Python setup.
.github/​workflows/​legacy-v2-api-integration-tests.yml Scopes credentials and removes test token exposure.
.github/​workflows/​kubeflow-pipelines-manifests.yml Applies read-only checkout hardening.
.github/​workflows/​kfp-webhooks.yml Scopes reusable builds and hardens actions.
.github/​workflows/​kfp-sdk-unit-tests.yml Applies read-only checkout hardening.
.github/​workflows/​kfp-sdk-tests.yml Applies read-only checkout hardening.
.github/​workflows/​kfp-sdk-client-tests.yml Scopes reusable builds and hardens actions.
.github/​workflows/​kfp-kubernetes-native-migration-tests.yaml Scopes reusable builds and hardens actions.
.github/​workflows/​kfp-kubernetes-library-test.yml Applies read-only checkout hardening.
.github/​workflows/​image-builds.yml Removes ambient token and pins build actions.
.github/​workflows/​image-builds-release.yml Declares publication permissions without inherited secrets.
.github/​workflows/​image-builds-master.yml Declares publication permissions without inherited secrets.
.github/​workflows/​go-image-digests.yml Hardens checkout.
.github/​workflows/​gh-workflow-approve.yml Removes contents scope and pins scripting actions.
.github/​workflows/​frontend.yml Scopes permissions and pins setup actions.
.github/​workflows/​e2e-test.yml Scopes reusable builds and hardens checkouts.
.github/​workflows/​e2e-test-frontend.yml Scopes credentials and pins integration actions.
.github/​workflows/​docs.yml Hardens checkouts and pins artifact upload.
.github/​workflows/​docs-freshness.yml Scopes credentials and pins setup actions.
.github/​workflows/​create-manifest.yml Removes OIDC scope and pins promotion actions.
.github/​workflows/​contributor-report.yml Hardens trusted checkout and pins Python setup.
.github/​workflows/​compiler-tests.yml Applies read-only checkout hardening.
.github/​workflows/​codeql.yml Narrows permissions and pins scanning actions.
.github/​workflows/​ci-scripts-tests.yml Pins setup actions and hardens checkouts.
.github/​workflows/​ci-passed-stale-revoke.yml Pins trusted checkout.
.github/​workflows/​ci-health-report.yml Hardens report checkout.
.github/​workflows/​ci-checks.yml Removes issue-write scope and pins actions.
.github/​workflows/​check-uv-lock.yml Scopes credentials and pins dependency tooling.
.github/​workflows/​check-requirements-txt.yml Scopes credentials and pins dependency tooling.
.github/​workflows/​build-tools-images.yml Separates PR builds from trusted publication.
.github/​workflows/​build-and-push.yml Separates read-only dry runs from publishing.
.github/​workflows/​arm64-presubmit.yml Declares caller and smoke permissions.
.github/​workflows/​api-server-tests.yml Scopes reusable builds and hardens checkouts.
.github/​resources/​scripts/​workflow_permissions_test.py Guards permissions, caller contracts, and action pins.
.github/​resources/​scripts/​release_image_validation_test.py Updates checkout expectations.
.github/​resources/​scripts/​publish_packages_workflow_test.py Tests publication isolation and artifact integrity.
.github/​resources/​scripts/​maintainer_tools_workflow_test.py Tests split build paths and promotion gates.
.github/​resources/​scripts/​image_publication_permissions_test.py Tests dry-run and publication permission boundaries.
.github/​resources/​scripts/​docker_registry_mirror_test.py Tracks extracted tooling build steps.
.github/​resources/​scripts/​ci_image_artifacts_test.py Uses structural workflow assertions.
.github/​resources/​scripts/​ci_base_workflows_test.py Accepts pinned Python action references.
.github/​resources/​scripts/​artifact_workflow_test_support.py Supports dependency-result expressions.
.github/​resources/​scripts/​artifact_workflow_test_support_test.py Covers skipped dependency results.
.github/​resources/​scripts/​artifact_download_callers_test.py Allows checksum-verified publisher downloads.
.github/​actions/​upload-artifact-with-retry/​action.yml Pins both upload attempts.
.github/​actions/​test-and-report/​action.yml Pins cache and Python actions.
.github/​actions/​setup-python/​action.yml Pins Python and uv setup.
.github/​actions/​setup-python-pip-cache/​action.yml Pins Python and cache actions.
.github/​actions/​junit-summary/​action.yml Pins Python setup.
.github/​actions/​download-artifact-with-retry/​action.yml Pins both download attempts.
.github/​actions/​create-cluster/​action.yml Pins cache and cluster actions.
.github/​actions/​build-tools-images/​action.yml Shares native tooling builds and evidence collection.
.github/​actions/​arm64-smoke/​action.yml Pins smoke-evidence upload.

Review effort: Balanced

Signed-off-by: Jeff Spahr <spahrj@gmail.com>
@zazulam

zazulam commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@github-actions github-actions Bot added the ci-passed All CI tests on a pull request have passed label Oct 21, 2026
@google-oss-prow google-oss-prow Bot added the lgtm label Oct 21, 2026
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zazulam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit 07b65bc into kubeflow:master Oct 21, 2026
207 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ci-passed All CI tests on a pull request have passed lgtm size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants