Skip to content

Harden CI workflow security#1599

Open
Alb3e3 wants to merge 1 commit into
axboe:masterfrom
Alb3e3:harden-ci-workflow-security
Open

Harden CI workflow security#1599
Alb3e3 wants to merge 1 commit into
axboe:masterfrom
Alb3e3:harden-ci-workflow-security

Conversation

@Alb3e3

@Alb3e3 Alb3e3 commented Jun 11, 2026

Copy link
Copy Markdown

This tightens the CI workflow security posture without changing the build matrix itself.

  • set the workflow token to read-only repository contents access
  • avoid direct GitHub context interpolation inside the shell command that builds the commit list
  • pass generated matrix commit values through environment variables and quote them before checkout

I verified the workflow YAML still parses, git diff --check passes, and zizmor no longer reports the previous excessive-permissions or template-injection findings for this workflow. The remaining zizmor findings are action pinning warnings, which I left out of this focused change.

@ammarfaizi2 ammarfaizi2 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.

I am okay with the changes, but as always, please follow the pull request guidelines.

  1. The explanation should be included in the commit message and word-wrapped at 72 characters.
  2. The commit must contain a Signed-off-by tag.

Limit the workflow token for the CI workflow to read-only contents
access. The job only needs repository reads, so the default write-capable
token is broader than necessary.

Also avoid direct GitHub expression interpolation in the shell command
that builds the commit list. The generated matrix values are passed
through environment variables and quoted before checkout so the shell does
not evaluate attacker-controlled pull request metadata.

Signed-off-by: Alb3e3 <74142887+Alb3e3@users.noreply.github.com>
@Alb3e3 Alb3e3 force-pushed the harden-ci-workflow-security branch from c1f6eeb to 500c7b4 Compare June 11, 2026 12:24
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