Skip to content

[CI] Scope workflow permissions and secret inheritance #49729

Closed

Description

@thisisnic

Describe the enhancement

Some workflows use overly broad permissions or pass all secrets to called workflows via secrets: inherit. These should be tightened to follow the principle of least privilege.

Permissions

  • .github/workflows/package_linux.yml has contents: write at the workflow level — this should be scoped to the specific job that needs it.

Secret inheritance

The following workflows pass all secrets to reusable workflows via secrets: inherit instead of explicitly listing required secrets:

  • .github/workflows/cpp_extra.yml (2 instances)
  • .github/workflows/cuda_extra.yml (2 instances)
  • .github/workflows/package_linux.yml (2 instances)
  • .github/workflows/python.yml
  • .github/workflows/r.yml

Component(s)

Continuous Integration

Activity

  1. thisisnic commented on Apr 14, 2026

    @thisisnic
    MemberAuthor

    I don't think we need this, as we're pinning to SHAs in #49735 so this is already mitigated - what do you think @kou?

  2. kou commented on Apr 15, 2026

    @kou
    Member
    * `.github/workflows/package_linux.yml` has `contents: write` at the workflow level — this should be scoped to the specific job that needs it.
    

    We can move

    # Upload to GitHub Release
    contents: write
    to for this.

    The following workflows pass all secrets to reusable workflows via secrets: inherit instead of explicitly listing required secrets:

    * `.github/workflows/cpp_extra.yml` (2 instances)
    
    * `.github/workflows/cuda_extra.yml` (2 instances)
    
    * `.github/workflows/package_linux.yml` (2 instances)
    
    * `.github/workflows/python.yml`
    
    * `.github/workflows/r.yml`
    

    It seems that python.yml and r.yml doesn't have secrets: inherit.

    Other workflows use https://github.com/apache/arrow/blob/main/.github/workflows/check_labels.yml and https://github.com/apache/arrow/blob/main/.github/workflows/report_ci.yml .

    check_labels needs only github.token.

    report_ci needs only github.token, secrets.ARROW_SMTP_PASSWORD and ${{ secrets.ARROW_ZULIP_WEBHOOK }}.

    So we can list them explicitly instead of using secrets: inherit.

    In general, minimum permissions/secrets are better but the ASF GitHub Actions policy doesn't require them. So these changes are not required. They are just better.

    If you can create a PR with generative AI, let's do them.

  3. thisisnic commented on Apr 16, 2026

    @thisisnic
    MemberAuthor

    Thanks! Should be easily automated with genAI, I'll get a PR up

  4. added a commit that references this issue on Apr 18, 2026
  5. added this to the 25.0.0 milestone on Apr 18, 2026
  6. thisisnic commented on Apr 18, 2026

    @thisisnic
    MemberAuthor

    Issue resolved by pull request 49773
    #49773

  7. added a commit that references this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions