Skip to content

Ci/zizmor security fixes#1612

Open
ab-ghosh wants to merge 3 commits intotektoncd:mainfrom
ab-ghosh:ci/zizmor-security-fixes
Open

Ci/zizmor security fixes#1612
ab-ghosh wants to merge 3 commits intotektoncd:mainfrom
ab-ghosh:ci/zizmor-security-fixes

Conversation

@ab-ghosh
Copy link
Copy Markdown
Member

@ab-ghosh ab-ghosh commented Apr 4, 2026

Changes

Run zizmor v1.23.1, a static analysis tool for GitHub Actions, to identify and fix security issues in this repository's workflows, and add it as a CI check.

Fixes #1599

Commit 1: Auto-fix findings (zizmor --fix=all)

  • Set persist-credentials: false on all actions/checkout steps to prevent credential leakage via artifacts
    (artipacked)
  • Move ${{ }} expressions out of run: blocks into env: mappings to prevent template injection
    (template-injection)
  • Disable default caching on setup-go in goclean.yml since it runs on a schedule trigger
    (cache-poisoning)

Commit 2: Add zizmor CI workflow

  • New .github/workflows/zizmor.yaml runs on pushes to main and PRs
  • Uploads SARIF results to GitHub Advanced Security

Commit 3: Manually fix remaining findings

  • Move checks: write from workflow-level to the linting job in ci.yaml — only job that needs it for golangci-lint annotations
    (excessive-permissions)
  • Add explicit permissions: contents: read to goclean.yml and both jobs in kind-e2e.yaml
    (excessive-permissions)

Findings summary:

Before After
High 2 0
Medium 16 3
Low 1 0
Info 4 0

Remaining findings (require follow-up issues):

Rule File(s) Why it can't be fixed here
secrets-inherit chatops_retest.yaml, slash.yml These call tektoncd/plumbing reusable workflows — needs cross-repo coordination
secrets-outside-env go-coverage.yml Requires GitHub Environment configuration by repo admins

/kind cleanup

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

ab-ghosh added 3 commits April 4, 2026 15:12
Run zizmor --fix=all to auto-fix security findings:
- Add persist-credentials: false to all actions/checkout steps (artipacked)
- Replace ${{ }} in run: blocks with shell env vars (template-injection)
- Disable setup-go cache on schedule-triggered workflow (cache-poisoning)
Add zizmor workflow that runs on pushes to main and PRs,
uploading SARIF results to GitHub Advanced Security.
Scope permissions to job level instead of workflow level:
- Move checks: write from workflow level to linting job in ci.yaml
- Add permissions: contents: read to goclean.yml
- Add permissions: contents: read to kind-e2e.yaml jobs
@tekton-robot tekton-robot requested review from jkhelil and wlynch April 4, 2026 09:50
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 4, 2026
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@jkhelil
Copy link
Copy Markdown
Member

jkhelil commented Apr 7, 2026

/approve

@tekton-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkhelil

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: Run zizmor on GitHub Actions and fix security findings

4 participants