Skip to content

ci: add top-level permissions for least-privilege security#3540

Open
Ankitsinghsisodya wants to merge 2 commits intoknative:mainfrom
Ankitsinghsisodya:ci/add-permissions-test-podman-next
Open

ci: add top-level permissions for least-privilege security#3540
Ankitsinghsisodya wants to merge 2 commits intoknative:mainfrom
Ankitsinghsisodya:ci/add-permissions-test-podman-next

Conversation

@Ankitsinghsisodya
Copy link
Copy Markdown

@Ankitsinghsisodya Ankitsinghsisodya commented Mar 27, 2026

Summary

  • Add permissions: contents: read to test-podman-next.yaml to restrict the default GITHUB_TOKEN to read-only access, following the principle of least privilege.

Fixes #3539

Test plan

  • Verify CI passes — no functional change, workflow only needs read access

The job defines a matrix with ubuntu-latest (x86_64) and
ubuntu-24.04-arm (ARM64) but runs-on was hardcoded to ubuntu-latest,
so both matrix entries ran on x86_64. Use the matrix value so ARM64
tests actually run on ARM hardware.

Fixes knative#3537
Add `permissions: contents: read` to the test-podman-next workflow
to restrict the default GITHUB_TOKEN to read-only access.

Fixes knative#3539
Copilot AI review requested due to automatic review settings March 27, 2026 20:26
@knative-prow knative-prow bot requested review from dsimansk and jrangelramos March 27, 2026 20:26
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Mar 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ankitsinghsisodya
Once this PR has been reviewed and has the lgtm label, please assign matzew for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Mar 27, 2026

Hi @Ankitsinghsisodya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow knative-prow bot added size/XS 🤖 PR changes 0-9 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels Mar 27, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to tighten GitHub Actions security by applying least-privilege GITHUB_TOKEN permissions, while also adjusting an existing workflow job to actually use its OS matrix.

Changes:

  • Add top-level permissions: contents: read to the test-podman-next scheduled workflow.
  • Update the Functions workflow’s test-e2e-podman job to run on ${{ matrix.os }} (so the ARM64 matrix entry is used).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/test-podman-next.yaml Restricts default token permissions to contents: read at workflow scope.
.github/workflows/functions.yaml Makes test-e2e-podman actually run per matrix.os instead of always ubuntu-latest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 249 to +255
needs: precheck
runs-on: ubuntu-latest
strategy:
matrix:
os:
- "ubuntu-latest" # x86_64
- "ubuntu-24.04-arm" # ARM64
runs-on: ${{ matrix.os }}
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The PR description/test plan says this is a no-functional-change update to add least-privilege permissions for test-podman-next.yaml, but this diff also changes the test-e2e-podman job to run on matrix.os (enabling the ARM64 runner entry in the matrix). Please update the PR description (and test plan) to reflect this additional CI behavior change, or split it into a separate PR if it’s unrelated to #3539.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test 🤖 Needs an org member to approve testing size/XS 🤖 PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add top-level permissions for least-privilege security in test-podman-next workflow

2 participants