Skip to content

fix: fix zizmor security findings in CI workflow files#1550

Merged
mkulke merged 1 commit into
confidential-containers:mainfrom
siddu-os:fix/zizmor-security-findings
Jul 15, 2026
Merged

fix: fix zizmor security findings in CI workflow files#1550
mkulke merged 1 commit into
confidential-containers:mainfrom
siddu-os:fix/zizmor-security-findings

Conversation

@siddu-os

@siddu-os siddu-os commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Ran zizmor v1.25.2 locally against .github/workflows/ and fixed all findings.

Changes

artipacked — Low severity

Added persist-credentials: false to all actions/checkout steps across 18 workflow
files. This prevents the GitHub token from being persisted in the local git config after
checkout, reducing the risk of credential exposure via artifacts.

excessive-permissions — Medium severity

Added explicit permissions: contents: read to all jobs that were using broad default
permissions. Exception: vendor_release.yml uses permissions: contents: write since it
uploads release assets via gh release upload.

archived-uses — Medium severity

Replaced the abandoned actions-rs/toolchain and actions-rs/cargo actions in
aa_sev_kbc.yml with actions-rust-lang/setup-rust-toolchain (already used consistently
across all other workflows in this repo) and an inline run: step respectively.
The actions-rs organisation is archived and no longer receives security updates.

template-injection — Medium severity

In publish-artifacts.yml, replaced ${{ env.RUST_TARGET }} and ${{ env.IMAGE_NAME }}
template expressions inside run: blocks with their shell variable equivalents
$RUST_TARGET / $IMAGE_NAME. Both variables are already defined at the job-level env:
block and are automatically available as shell variables — no step-level redeclaration needed.

cache-poisoning — High severity

In coco-extension-image.yml (new upstream file), added cache: false to the
actions-rust-lang/setup-rust-toolchain step. This workflow triggers on pull_request
and publishes runtime artifacts, making it vulnerable to cache poisoning without this flag.

Verification

zizmor .github/workflows/
# No findings to report. Good job! (88 suppressed)

@siddu-os
siddu-os requested a review from a team as a code owner July 13, 2026 09:16

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

what is the rationale behind re-setting the env with the same value? is this a readabiity measure? if yes then it probably makes sense to remove the job-level envs?

        RUST_TARGET: ${{ env.RUST_TARGET }}
        IMAGE_NAME: ${{ env.IMAGE_NAME }}

@fitzthum fitzthum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@siddu-os
siddu-os force-pushed the fix/zizmor-security-findings branch from 86af87a to fe9f89a Compare July 14, 2026 06:05
@siddu-os

siddu-os commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

what is the rationale behind re-setting the env with the same value? is this a readabiity measure? if yes then it probably makes sense to remove the job-level envs?

        RUST_TARGET: ${{ env.RUST_TARGET }}
        IMAGE_NAME: ${{ env.IMAGE_NAME }}

Thanks for the review, You're right - RUST_TARGET and IMAGE_NAME are already defined at the job-level env: block and are automatically available as shell variables in all run: steps. The step-level re-declarations were redundant. Fixed - removed all the unnecessary env: re-assignments. The template-injection fix is achieved simply by using $ RUST_TARGET / $ IMAGE_NAME (shell variables) instead of $ {{ env.RUST_TARGET }} / $ {{ env.IMAGE_NAME }} (template expressions) directly in the run: blocks.

Ran zizmor v1.25.2 locally against .github/workflows/ and fixed
all 39 findings:

- Add persist-credentials: false to all actions/checkout steps
  (artipacked - 20 findings across 17 files)
- Add explicit permissions: contents: read to all jobs missing it
  (excessive-permissions - 10 findings)
- Replace archived actions-rs/toolchain with actions-rust-lang/setup-rust-toolchain
  and actions-rs/cargo with inline run: step in aa_sev_kbc.yml
  (archived-uses - 2 findings)
- Fix template-injection in publish-artifacts.yml by assigning
  env.RUST_TARGET and env.IMAGE_NAME to step-level env vars
  and referencing via $VAR in shell
  (template-injection - 7 findings)

Signed-off-by: siddaram-sonnagi <siddaram.sonnagi@ibm.com>
@siddu-os
siddu-os force-pushed the fix/zizmor-security-findings branch from fe9f89a to 09c6476 Compare July 14, 2026 06:14
@siddu-os
siddu-os requested a review from mkulke July 14, 2026 06:17
@mkulke
mkulke merged commit 21d643b into confidential-containers:main Jul 15, 2026
36 of 37 checks passed
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.

3 participants