Skip to content

feat: add attestations: write permission for image provenance attestation - #381

Merged
matthyx merged 2 commits into
kubescape:mainfrom
Varadraj75:feat/add-attestations-write-permission
Jun 9, 2026
Merged

feat: add attestations: write permission for image provenance attestation#381
matthyx merged 2 commits into
kubescape:mainfrom
Varadraj75:feat/add-attestations-write-permission

Conversation

@Varadraj75

@Varadraj75 Varadraj75 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds attestations: write to the pr-merged job permissions so the actions/attest-build-provenance step added to the shared incluster-comp-pr-merged.yaml workflow in kubescape/workflows can push attestations to the GitHub attestations API. Without this the attest step fails with a 403 on release runs.

Additional Information

This is part of a series of PRs adding SLSA provenance attestation across kubescape repos, tracked in kubescape/kubescape#1033. Requires kubescape/workflows#89 to be merged first.

Related issues/PRs

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas
  • I have performed a self-review of my code
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Chores
    • Updated internal workflow permissions configuration to support additional system operations.

…tion

Required by the attest-build-provenance step added to the shared
incluster-comp-pr-merged.yaml workflow in kubescape/workflows.

Signed-off-by: Varadraj75 <agrawalvaradraj2007@gmail.com>
Copilot AI review requested due to automatic review settings June 6, 2026 11:13
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Varadraj75, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 8 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8fa23954-e735-4531-a56a-4769e19d6c4c

📥 Commits

Reviewing files that changed from the base of the PR and between 6aa0d4a and e344213.

📒 Files selected for processing (1)
  • .github/workflows/pr-merged.yaml
📝 Walkthrough

Walkthrough

The GitHub Actions workflow file for merged PRs is updated with a single permission addition: attestations: write is added to the pr-merged job's permissions block, enabling the workflow to write attestations when a PR is merged.

Changes

Workflow Permissions Update

Layer / File(s) Summary
Attestations Permission Addition
.github/workflows/pr-merged.yaml
The pr-merged job permissions block is extended with attestations: write to allow attestation creation during merged PR runs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • kubescape/operator#352: Modifies the same .github/workflows/pr-merged.yaml pr-merged job's permissions block with different permission entries.

Suggested reviewers

  • Naor-Armo

Poem

🐰 A whisper of words, a permission so neat,
Attestations now flowing, the workflow complete!
One line to declare what the rabbit has blessed,
Permissions unlocked for the merging request.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding the 'attestations: write' permission to enable image provenance attestation functionality in the workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds GitHub Actions permissions to allow the “pr-merged” workflow (reusable workflow invocation) to write artifact attestations when a PR is merged.

Changes:

  • Grant attestations: write permission to the workflow job invoking kubescape/workflows reusable workflow.

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

Comment on lines 37 to 41
packages: write
contents: write
pull-requests: read
attestations: write
uses: kubescape/workflows/.github/workflows/incluster-comp-pr-merged.yaml@main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added an inline comment to make the purpose clear.

Comment thread .github/workflows/pr-merged.yaml Outdated
Comment on lines +37 to +40
packages: write
contents: write
pull-requests: read
attestations: write

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

id-token: write is already present at line 34 in the same permissions block , it was there before this change for keyless cosign signing.

Signed-off-by: Varadraj75 <agrawalvaradraj2007@gmail.com>
@matthyx
matthyx merged commit 8f1c465 into kubescape:main Jun 9, 2026
6 checks passed
@matthyx matthyx moved this to To Archive in KS PRs tracking Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants