Skip to content

security: pin kubescape/github-action to a full commit SHA#253

Open
kobihikri wants to merge 1 commit into
ory:masterfrom
kobihikri:security/pin-kubescape-action
Open

security: pin kubescape/github-action to a full commit SHA#253
kobihikri wants to merge 1 commit into
ory:masterfrom
kobihikri:security/pin-kubescape-action

Conversation

@kobihikri

@kobihikri kobihikri commented Jul 14, 2026

Copy link
Copy Markdown

What

Pin kubescape/github-action in the cve-scan.yaml server template to a full commit SHA instead of the mutable @main branch.

-        uses: kubescape/github-action@main
+        uses: kubescape/github-action@7d90c1f159f02df1e3c79f839eeabe42ea30d4e3 # pins @main as of 2026-06-01

Why

In the Docker Image Scanners job, the runner logs in to ghcr.io with ${{ secrets.GITHUB_TOKEN }} before the scanners run. Every subsequent step — including kubescape/github-action — therefore executes with a credentialed Docker session on the runner. Because that action is referenced by the moving @main branch, the exact code that runs in that credentialed context can change at any time without any change in this repository.

This is the same class of risk, in the same workflow, that #247 addressed for trivy-action after master briefly pointed to a malicious version (CVE-2026-33634). kubescape/github-action@main is the one third-party action here still on a branch ref, so this applies the same known-good hardening to it.

Behaviour

7d90c1f159f02df1e3c79f839eeabe42ea30d4e3 is the commit @main resolves to today (2026-06-01), so this pins to exactly what already runs — nothing about current behaviour changes, the ref is just fixed in place.

I deliberately did not pin to the latest release tag: v3.0.21 is from 2024-11 and main is ~18 months ahead of it, so pinning to the tag would silently roll those changes back. Pinning to current @main HEAD keeps behaviour identical. If you'd rather track a release, v3.0.21 = c9749b84d138c0cbbb702b258774954f5463b82e — happy to switch to whichever you prefer.

Because this is the template, regenerating propagates the pin to the downstream server repos (kratos, hydra, keto, …).

Notes

I used AI assistance to review the workflow and draft this change; I read and verified every line myself and take responsibility for it. I understand this needs the Ory CLA and will sign it. Thank you for maintaining Ory — glad to adjust or close if you'd prefer a different approach.

Summary by CodeRabbit

  • Chores
    • Improved the reliability and consistency of automated security vulnerability scanning by pinning the scanning tool to a specific version.

The Docker Image Scanners workflow logs in to ghcr.io with GITHUB_TOKEN
before running the image scanners, so any action in this job runs with a
credentialed Docker session. kubescape/github-action is still referenced
by the mutable `@main` branch, which means the exact code that runs in
that credentialed context can change without any change to this template.

This is the same hardening applied to trivy-action in ory#247 (after master
briefly pointed to a malicious version, CVE-2026-33634). Pinning to a full
commit SHA closes the same class of risk for kubescape.

7d90c1f159f02df1e3c79f839eeabe42ea30d4e3 is the commit `@main` resolves to
today (2026-06-01), so behaviour is unchanged — the ref is just fixed in
place. Regenerating the downstream repos propagates the pin to kratos,
hydra, keto and the other server repos.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: edf7c7e2-7b43-4ce0-b4aa-7525d44be181

📥 Commits

Reviewing files that changed from the base of the PR and between fe7e8f7 and 8a7a43d.

📒 Files selected for processing (1)
  • templates/repository/server/.github/workflows/cve-scan.yaml

📝 Walkthrough

Walkthrough

The CVE scanning workflow updates the Kubescape GitHub Action reference from the main branch to a specific commit SHA. No other workflow behavior changes.

Changes

CVE scan workflow

Layer / File(s) Summary
Pin Kubescape action
templates/repository/server/.github/workflows/cve-scan.yaml
The Kubescape scanner step now uses a commit-pinned action reference while preserving its existing configuration.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 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 states the main change: pinning kubescape/github-action to a full commit SHA for security hardening.
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.
✨ 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.

@CLAassistant

CLAassistant commented Jul 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kobihikri

Copy link
Copy Markdown
Author

recheck

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