Skip to content

Fix zizmor security issues in GitHub Actions workflows#1328

Merged
jezdez merged 4 commits into
mainfrom
fix/zizmor-security-issues
May 11, 2026
Merged

Fix zizmor security issues in GitHub Actions workflows#1328
jezdez merged 4 commits into
mainfrom
fix/zizmor-security-issues

Conversation

@jezdez
Copy link
Copy Markdown
Member

@jezdez jezdez commented May 8, 2026

Audited all workflow files with zizmor v1.24.1 and fixed the findings. These are the upstream source workflows that get synced to other conda repos via update.yml, so fixing them here propagates the improvements everywhere.

What changed

Dependabot cooldowns (dependabot.yml)

  • Added 7-day cooldown to the github-actions ecosystem entry.

Explicit permissions (all workflows)

  • Added permissions: blocks to cla.yml, issues.yml, labels.yml, project.yml, update.yml, init.yml following the principle of least privilege.
  • Workflow-level permissions: contents: read with job-level escalation where write access is needed.

Credential persistence (init.yml, labels.yml)

  • Added persist-credentials: false to actions/checkout steps that don't need git credentials after checkout.
  • update.yml intentionally keeps credentials for the git push --force-with-lease step (suppressed in zizmor.yml).

Template injection (init.yml, update.yml)

  • init.yml: Replaced ${{ github.event.inputs.org/repo }} in sed command with env vars.
  • update.yml: Replaced ${{ github.event.issue.pull_request.url }} in curl commands with env var.

Suppressions (zizmor.yml)

  • cla.yml and project.yml dangerous-triggers: pull_request_target is used safely (no code checkout).
  • stale.yml template-injection: Low confidence, outputs are not attacker-controlled.
  • update.yml artipacked: Credentials needed for bot push.

Pre-commit hooks (.pre-commit-config.yaml)

  • Added zizmor (v1.24.1) and actionlint (v1.7.12) hooks.
  • actionlint excludes stale.yml due to a known expression type mismatch.

Audit result

zizmor v1.24.1: No findings to report. Good job! (4 ignored, 50 suppressed)

Downstream impact

Once merged and synced, the corresponding suppressions in conda/actions PR #361 (zizmor.yml) can be removed since the source workflows will already be fixed.

jezdez added 4 commits May 8, 2026 19:45
Adds 7-day cooldown period to the github-actions package ecosystem
entry to prevent excessive update frequency.

Applied by: zizmor v1.24.1 --fix (dependabot-cooldown rule)
- Add explicit permissions blocks to all workflows (least privilege)
- Add persist-credentials: false to checkout steps in init.yml,
  labels.yml
- Fix template injection in init.yml (sed command) and update.yml
  (curl commands) by using environment variables
- Add job-level permissions where write access is needed

Detected by: zizmor v1.24.1 (excessive-permissions, artipacked,
template-injection rules)
low-risk template-injection findings

cla.yml and project.yml use pull_request_target safely (no code
checkout). stale.yml echoes action outputs (not attacker input).
Catches GitHub Actions security and syntax issues before they
reach CI. Excludes stale.yml from actionlint due to a known
expression type mismatch in the stale action outputs.
@jezdez jezdez requested a review from a team as a code owner May 8, 2026 17:48
@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review May 8, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label May 8, 2026
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Approved in 🔎 Review May 8, 2026
@jezdez jezdez requested a review from kenodegard May 8, 2026 22:45
@jezdez jezdez merged commit 959d74a into main May 11, 2026
4 checks passed
@jezdez jezdez deleted the fix/zizmor-security-issues branch May 11, 2026 09:56
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🏁 Done in 🔎 Review May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🏁 Done

Development

Successfully merging this pull request may close these issues.

4 participants