-
Notifications
You must be signed in to change notification settings - Fork 312
pre-commit: Add zizmor #465
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||||||||||
| rules: | ||||||||||||||
| excessive-permissions: | ||||||||||||||
| disable: true | ||||||||||||||
|
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- zizmor.yml ---'
cat -n zizmor.yml
printf '%s\n' '--- zizmor hook ---'
sed -n '65,90p' .pre-commit-config.yaml
printf '%s\n' '--- local zizmor references ---'
rg -n -i 'excessive-permissions|zizmor' . --glob '!node_modules' --glob '!dist' --glob '!build' | head -200Repository: cpplint/cpplint Length of output: 687 🌐 Web query:
💡 Result: In zizmor v1.29.0, you can disable the excessive-permissions audit by modifying your zizmor configuration file (typically zizmor.yml) to set the disable property to true for that specific rule [1][2]. To disable the audit, add the following to your configuration file: rules: excessive-permissions: disable: true The zizmor documentation emphasizes that disabling audits should be used as a measure of last resort, as disabled rules will not appear in ignored or suppressed finding counts, which may lead to missing important future findings [1][2]. Before disabling the audit entirely, the developers recommend considering these alternatives [1][2]: 1. Ignoring specific findings using the rules..ignore configuration [1][2]. 2. Adjusting your persona (e.g., removing --persona=pedantic or --persona=auditor) if you are currently using a more sensitive persona [1][2]. Configuration files can be placed where zizmor discovers them automatically or passed explicitly using the --config flag or the ZIZMOR_CONFIG environment variable [3][4]. Citations:
Keep the
🤖 Prompt for AI Agents
Comment on lines
+2
to
+3
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. —so this is the only change I ask for.
Suggested change
It's not as precise as I'd want it to be (allow v6 but not v6.1.0), but it'll do. |
||||||||||||||
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: cpplint/cpplint
Length of output: 153
🏁 Script executed:
Repository: cpplint/cpplint
Length of output: 884
🌐 Web query:
zizmor v1.29.0 supported file types .pre-commit-config.yaml💡 Result:
In zizmor v1.29.0, experimental support was added for auditing pre-commit inputs, specifically including.pre-commit-config.yaml files and hook definitions [1][2]. When running zizmor, it can automatically infer the input type—such as a workflow, action, Dependabot configuration, or a pre-commit configuration—when reading from standard input [3]. For local directories or repositories, zizmor identifies and collects these auditable inputs automatically, and users can explicitly target or filter these inputs using the --collect=pre-commit option [3]. It is important to distinguish between using zizmor to audit a.pre-commit-config.yaml file and using zizmor itself as a hook within a.pre-commit-config.yaml file. The former refers to zizmor's new ability to analyze the security of pre-commit configurations [1][2], while the latter is a well-established integration where zizmor is installed as a hook in a repository's.pre-commit-config.yaml to run security audits on GitHub Actions workflows [4][5].
Citations:
🏁 Script executed:
Repository: cpplint/cpplint
Length of output: 2941
Include
.pre-commit-config.yamlin the hook file scope.The
v1.29.0hook manifest excludes.pre-commit-config.yaml, so pre-commit skips it.zizmor v1.29.0supports auditing pre-commit configurations. Add a localfilesoverride if this PR must audit that configuration.🤖 Prompt for AI Agents