-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ci: Run zizmor for GHA security analysis #11392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.github/workflows/zizmor.yaml
Outdated
jobs: | ||
zizmor: | ||
runs-on: ubuntu-22.04 | ||
permissions: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need the job-level explicit permissions block as well as the top-level, but it doesn't do any harm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly this might be the reason that the report isn't showing up in fact given the copilot review which says it need more permissions to report?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the workflow should still show up. I think Copilot is confused - per zizmor's docs, we only need security-events: write
when Advanced Security is enabled. I had disabled it because I thought it'd would fail on our repo, but I just tried enabling it again - let's see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok - thanks!
Do you know the reason for this as when I've added |
@stevenhorsman Hmm good point, I'm not exactly sure. Maybe because you had [1] https://github.com/orgs/community/discussions/25746 |
a8294ba
to
1f3607f
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
051b052
to
e278bab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new GitHub Actions workflow to run Zizmor security analysis on pull requests that change workflow files.
- Introduces
.github/workflows/zizmor.yaml
to trigger on PR changes to workflow definitions - Configures scoped permissions and concurrency for the Zizmor job
- Adds steps to check out the repo and invoke the
zizmor-action
Comments suppressed due to low confidence (2)
.github/workflows/zizmor.yaml:1
- [nitpick] The workflow name is generic; consider renaming to something like
Zizmor Security Analysis
for clearer identification in the Actions UI.
name: GHA security analysis
.github/workflows/zizmor.yaml:23
- [nitpick] Pinning to a commit SHA is stable but hampers readability and upgrades. Consider using a semver tag such as
actions/checkout@v4
or the specificv4.2.2
tag instead.
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Is there anyway we can flag this as failing if there is any issues, or even better if there are issues above a certain threshold, so we can spot issues in PRs before they are merged? |
Yes! That will be my next step - see the second Important block here: https://github.com/zizmorcore/zizmor-action?tab=readme-ov-file#usage-with-github-advanced-security-recommended |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks! It will be good to see if we can get the ruleset to give us more value as we work to squash these problems and stop them coming back.
cf81127
to
9b2d50f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks @sprt !
7951570
to
f372955
Compare
This runs the zizmor security lint [1] on our GH Actions. The initial workflow uses [2] as a base. [1] https://docs.zizmor.sh/ [2] https://docs.zizmor.sh/usage/#use-in-github-actions Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
f372955
to
34c8cd8
Compare
I think my suggestion in the AC meeting was actually wrong - I thought that we using |
That looks fine to me 😕 |
Ok, I'm confused now as I realized that this workflow is running: https://github.com/kata-containers/kata-containers/actions/runs/15898700799/job/44836322438?pr=11392. What was the problem you were facing @sprt as I guess I misunderstood? |
@stevenhorsman No worries we but misunderstood each other, was early for me! My issue is there's a bunch of required tests that are just not running (and not pending on anything either): |
So maybe indeed those aren't running because the gatekeeper is seeing a workflow-only change? |
Yeah, that's right. Gatekeeper is green: https://github.com/kata-containers/kata-containers/actions/runs/15898700802/job/44836322457?pr=11392, so I say use admin rights to merge it 😄 |
Force-merged as discussed above. |
This runs the zizmor security lint [1] on our GH Actions.
The initial workflow uses [2] as a base.
[1] https://docs.zizmor.sh/
[2] https://docs.zizmor.sh/usage/#use-in-github-actions