Conversation
Reviewer's GuideAdds a new GitHub Actions workflow to run the zizmor security analysis on GitHub Actions configurations for pushes to main and all pull requests, using a hardened runner and pinned action SHAs. Flow diagram for the Zizmor security analysis workflow executionflowchart TD
A[Push to main branch or any pull request] --> B[Trigger zizmor workflow]
B --> C[Start job zizmor on ubuntu_latest]
C --> D[Set job permissions<br>security_events write<br>contents read<br>actions read]
D --> E[Run Harden_Runner using step_security_harden_runner]
E --> F[Checkout repository using actions_checkout<br>persist_credentials false]
F --> G[Run Zizmor security analysis using zizmorcore_zizmor_action]
G --> H[Report security events to GitHub security_events]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #383 +/- ##
=======================================
Coverage 94.01% 94.01%
=======================================
Files 2 2
Lines 167 167
Branches 37 37
=======================================
Hits 157 157
Misses 4 4
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The
Harden Runnerstep appears to have incorrect YAML indentation (usesandwithshould be aligned under the- nameline), which will prevent this workflow from parsing correctly. - Consider whether
pull_requestneeds thebranches: ["**"]filter at all—removing it will make the workflow run on PRs targeting any branch by default and avoids an unusual pattern that may confuse readers.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `Harden Runner` step appears to have incorrect YAML indentation (`uses` and `with` should be aligned under the `- name` line), which will prevent this workflow from parsing correctly.
- Consider whether `pull_request` needs the `branches: ["**"]` filter at all—removing it will make the workflow run on PRs targeting any branch by default and avoids an unusual pattern that may confuse readers.
## Individual Comments
### Comment 1
<location path=".github/workflows/zizmor.yml" line_range="19-22" />
<code_context>
+ contents: read # only needed for private or internal repos
+ actions: read # only needed for private or internal repos
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout repository
</code_context>
<issue_to_address>
**issue (bug_risk):** Fix step indentation so the workflow is valid YAML and GitHub Actions can parse the step correctly.
`uses:` and `with:` need to be indented to align under the `- name:` step, and `egress-policy` must be nested under `with:`, not aligned with it. For example:
```yaml
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594
with:
egress-policy: audit
```
The current indentation will cause YAML parsing or runner interpretation problems.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
a109aa9 to
1afd586
Compare
|
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:
For more information about GitHub Code Scanning, check out the documentation. |
| - name: Harden Runner | ||
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | ||
| with: | ||
| egress-policy: audit |
There was a problem hiding this comment.
Should this be changed to block now?
There was a problem hiding this comment.
Do you mean change audit to block? I'm not sure. Audit was recommended by StepSecurity, but that was when I hardened these jobs years ago. Can you share any additional details I may be missing?
There was a problem hiding this comment.
Audit will record what requests are made. Block prevents requests that aren't on a allowlist. Example.
Type: Task
Description
Related Issues/PRs
Closes #382.
Motivation
Implementation Details
Screenshots/Recordings
Testing
Documentation
Summary by Sourcery
CI: