github-security-report 0.25.0__tar.gz → 0.26.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. {github_security_report-0.25.0 → github_security_report-0.26.0}/PKG-INFO +399 -58
  2. {github_security_report-0.25.0 → github_security_report-0.26.0}/README.md +394 -53
  3. {github_security_report-0.25.0 → github_security_report-0.26.0}/pyproject.toml +7 -7
  4. {github_security_report-0.25.0 → github_security_report-0.26.0}/scripts/README.md +4 -2
  5. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/_version.py +2 -2
  6. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/categories/keys.py +1 -0
  7. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/categories/signals.py +20 -1
  8. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/classify.py +147 -55
  9. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/app.py +1 -1
  10. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/modes.py +12 -2
  11. github_security_report-0.26.0/src/github_security_report/cli/preflight.py +400 -0
  12. github_security_report-0.26.0/src/github_security_report/cli/preflight_messages.py +163 -0
  13. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/remediation.py +28 -2
  14. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/serialise.py +1 -0
  15. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/analyses.py +76 -19
  16. github_security_report-0.26.0/src/github_security_report/client/bodies.py +67 -0
  17. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/org_reads.py +30 -7
  18. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/paging.py +36 -17
  19. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/parsers.py +4 -2
  20. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/reads.py +29 -26
  21. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/repo_parser.py +14 -0
  22. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/transport.py +25 -11
  23. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/workflow_runs.py +3 -3
  24. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/context.py +3 -0
  25. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/org.py +11 -4
  26. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/protocols.py +5 -4
  27. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/repo.py +8 -5
  28. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/blocks.py +2 -0
  29. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/key_notes.py +3 -0
  30. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/models.py +6 -1
  31. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/order.py +4 -2
  32. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/schema.py +8 -1
  33. github_security_report-0.26.0/src/github_security_report/fuzz.py +36 -0
  34. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/gating.py +2 -1
  35. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/models.py +11 -2
  36. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/ordering.py +1 -1
  37. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/report/aggregate.py +4 -0
  38. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/report/signals.py +7 -2
  39. {github_security_report-0.25.0 → github_security_report-0.26.0}/.gitignore +0 -0
  40. {github_security_report-0.25.0 → github_security_report-0.26.0}/LICENSE +0 -0
  41. {github_security_report-0.25.0 → github_security_report-0.26.0}/LICENSES/Apache-2.0.txt +0 -0
  42. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/__init__.py +0 -0
  43. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/authors.py +0 -0
  44. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/categories/__init__.py +0 -0
  45. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/categories/tables.py +0 -0
  46. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/__init__.py +0 -0
  47. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/__main__.py +0 -0
  48. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/boundary.py +0 -0
  49. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/config_cmd.py +0 -0
  50. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/config_source.py +0 -0
  51. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/options.py +0 -0
  52. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/outputs.py +0 -0
  53. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/progress.py +0 -0
  54. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/publish.py +0 -0
  55. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/cli/summary.py +0 -0
  56. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/__init__.py +0 -0
  57. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/accounting.py +0 -0
  58. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/alerts.py +0 -0
  59. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/batch_errors.py +0 -0
  60. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/codeql_parsers.py +0 -0
  61. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/copilot.py +0 -0
  62. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/endpoints.py +0 -0
  63. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/errors.py +0 -0
  64. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/events.py +0 -0
  65. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/failures.py +0 -0
  66. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/queries.py +0 -0
  67. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/reviews.py +0 -0
  68. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/client/writes.py +0 -0
  69. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/code_quality.py +0 -0
  70. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/codeql/__init__.py +0 -0
  71. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/codeql/cleanup.py +0 -0
  72. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/codeql/facts.py +0 -0
  73. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/codeql/tables.py +0 -0
  74. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/__init__.py +0 -0
  75. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/codeql.py +0 -0
  76. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/exclusions.py +0 -0
  77. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/extras.py +0 -0
  78. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/graph.py +0 -0
  79. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/run_sync.py +0 -0
  80. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/scoping.py +0 -0
  81. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/collect/workflow_runs.py +0 -0
  82. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/__init__.py +0 -0
  83. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/dictionary.py +0 -0
  84. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/errors.py +0 -0
  85. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/loader.py +0 -0
  86. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/config/workflow_runs.py +0 -0
  87. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/gitctx.py +0 -0
  88. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/issue_presentation.py +0 -0
  89. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/issues.py +0 -0
  90. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/layout.py +0 -0
  91. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/malware.py +0 -0
  92. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/matching.py +0 -0
  93. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/posture/__init__.py +0 -0
  94. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/posture/enablement.py +0 -0
  95. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/posture/facts.py +0 -0
  96. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/posture/quality.py +0 -0
  97. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/posture/releases.py +0 -0
  98. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/pulls/__init__.py +0 -0
  99. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/pulls/columns.py +0 -0
  100. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/pulls/counting.py +0 -0
  101. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/pulls/presentation.py +0 -0
  102. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/pulls/table.py +0 -0
  103. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/py.typed +0 -0
  104. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/ranking.py +0 -0
  105. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/remediate/__init__.py +0 -0
  106. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/remediate/codeql.py +0 -0
  107. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/remediate/model.py +0 -0
  108. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/__init__.py +0 -0
  109. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/html.py +0 -0
  110. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/markdown.py +0 -0
  111. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/slack.py +0 -0
  112. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/slack_limits.py +0 -0
  113. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/slack_text.py +0 -0
  114. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/terminal.py +0 -0
  115. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/render/terminal_notices.py +0 -0
  116. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/report/__init__.py +0 -0
  117. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/report/display.py +0 -0
  118. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/report/exclusions.py +0 -0
  119. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/report/tables.py +0 -0
  120. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/rulesets.py +0 -0
  121. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/runner.py +0 -0
  122. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/scope.py +0 -0
  123. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/secret_patterns.py +0 -0
  124. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/severity.py +0 -0
  125. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/summary.py +0 -0
  126. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/templates/index.html.j2 +0 -0
  127. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/templates/report.html.j2 +0 -0
  128. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/workflow_runs/__init__.py +0 -0
  129. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/workflow_runs/aggregate.py +0 -0
  130. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/workflow_runs/models.py +0 -0
  131. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/workflow_runs/store.py +0 -0
  132. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/workflow_runs/store_codec.py +0 -0
  133. {github_security_report-0.25.0 → github_security_report-0.26.0}/src/github_security_report/workflow_runs/tables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: github-security-report
3
- Version: 0.25.0
3
+ Version: 0.26.0
4
4
  Summary: Security and quality reporting across GitHub organisations
5
5
  Project-URL: Homepage, https://github.com/lfreleng-actions/github-security-report-action
6
6
  Project-URL: Repository, https://github.com/lfreleng-actions/github-security-report-action
@@ -29,15 +29,15 @@ Requires-Dist: jinja2==3.1.6
29
29
  Requires-Dist: jsonschema==4.26.0
30
30
  Requires-Dist: pyyaml==6.0.3
31
31
  Requires-Dist: rich==15.0.0
32
- Requires-Dist: typer==0.27.3
32
+ Requires-Dist: typer==0.29.1
33
33
  Provides-Extra: dev
34
34
  Requires-Dist: mypy==2.4.1; extra == 'dev'
35
- Requires-Dist: pytest-asyncio==1.4.1.post1; extra == 'dev'
35
+ Requires-Dist: pytest-asyncio==1.5.0; extra == 'dev'
36
36
  Requires-Dist: pytest-cov==7.1.0; extra == 'dev'
37
37
  Requires-Dist: pytest==9.2.0; extra == 'dev'
38
38
  Requires-Dist: respx==0.23.1; extra == 'dev'
39
- Requires-Dist: ruff==0.17.3; extra == 'dev'
40
- Requires-Dist: syrupy==6.1.1; extra == 'dev'
39
+ Requires-Dist: ruff==0.17.5; extra == 'dev'
40
+ Requires-Dist: syrupy==7.0.1; extra == 'dev'
41
41
  Requires-Dist: types-jsonschema==4.26.0.20261006; extra == 'dev'
42
42
  Requires-Dist: types-pyyaml==6.0.12.20250915; extra == 'dev'
43
43
  Description-Content-Type: text/markdown
@@ -56,8 +56,8 @@ Description-Content-Type: text/markdown
56
56
 
57
57
  > Security and quality **reporting** (not scanning) across GitHub
58
58
  > organisations. Aggregates existing signals — CodeQL, OpenSSF Scorecard,
59
- > zizmor, aislop (AI slop), Dependabot, and secret scanning — and ranks the
60
- > worst offenders so remediation effort goes where it is needed.
59
+ > zizmor, aislop (AI slop), fuzzing, Dependabot, and secret scanning — and
60
+ > ranks the worst offenders so remediation effort goes where it is needed.
61
61
 
62
62
  ## 🗒️ Published reports
63
63
 
@@ -85,14 +85,18 @@ stay brevity-first; the explanatory per-category description and documentation
85
85
  link are shown only on the richer Markdown and HTML (GitHub Pages) outputs.
86
86
 
87
87
  The single GitHub code-scanning feed is partitioned by `tool.name` into CodeQL,
88
- Scorecard, zizmor, and aislop; Scorecard prefers the external aggregate score
89
- and falls back to code-scanning findings. See [`docs/BRIEF.md`](docs/BRIEF.md)
88
+ Scorecard, zizmor, aislop, and fuzz; Scorecard prefers the external aggregate
89
+ score and falls back to code-scanning findings. **Fuzzing** reports the
90
+ failures the organisation's daily fuzz job uploads, and counts a repository
91
+ holding none of the `report.fuzz_languages` Linguist languages (default
92
+ `["Python", "Go"]`) as **Not applicable** rather than not enabled; see
93
+ [ADR-0009](docs/adr/0009-fuzzing.md). See [`docs/BRIEF.md`](docs/BRIEF.md)
90
94
  and [`docs/phase0-findings.md`](docs/phase0-findings.md) for the full design and
91
95
  the API research it is built on.
92
96
 
93
- The workflow-driven signals (OpenSSF Scorecard, zizmor, aislop) only produce
94
- data when an organisation has deployed supporting workflows. The tool checks
95
- for that support cheaply before collecting (**feature gating**): an
97
+ The workflow-driven signals (OpenSSF Scorecard, zizmor, aislop, fuzz) only
98
+ produce data when an organisation has deployed supporting workflows. The tool
99
+ checks for that support cheaply before collecting (**feature gating**): an
96
100
  organisation with no evidence of a tool — no ruleset requiring its workflow,
97
101
  no alerts, no analyses on a sample of repositories — gets a single
98
102
  `⏩ Skipping feature: organisation support missing` line for that section
@@ -255,7 +259,7 @@ known list is shorter — see
255
259
 
256
260
  | Mode | Token | Scope | Output |
257
261
  | ---- | ----- | ----- | ------ |
258
- | `org` | fine-grained PAT (single org) or classic PAT (multiple orgs) | one or more organisations | GitHub Pages + Slack + terminal |
262
+ | `org` | fine-grained PAT per org, or one classic PAT for several | one or more organisations | GitHub Pages + Slack + terminal |
259
263
  | `repo` | `GITHUB_TOKEN` | the current repository only | job summary + outputs + optional PR gate |
260
264
 
261
265
  `scope: auto` resolves to org mode when configuration is supplied, otherwise
@@ -265,15 +269,33 @@ org-wide security data, so org mode requires a PAT — see
265
269
 
266
270
  ## Token permissions
267
271
 
268
- Repo mode needs nothing beyond the workflow's ephemeral `GITHUB_TOKEN`. Org mode
269
- needs a Personal Access Token; choose **one** of the two options below depending
270
- on how many organisations the report covers.
272
+ Repo mode runs on the workflow's ephemeral `GITHUB_TOKEN`, with the job
273
+ permissions in [Repo mode: the job token](#repo-mode-the-job-token). Org mode
274
+ needs a Personal Access Token: a fine-grained PAT per organisation, or one
275
+ classic PAT for every organisation the report covers (see the two options
276
+ below). The `remediate` subcommand needs write access on top of most of the
277
+ report's reads, and one token for its whole run; see
278
+ [The `remediate` subcommand](#the-remediate-subcommand).
271
279
 
272
280
  Almost all required access is **read-only**. The tool degrades any read it is
273
281
  not permitted to make to an "unknown" status rather than reporting a repository
274
282
  as clean, so an under-scoped token surfaces as unknowns in the report instead of
275
283
  silently wrong results — start minimal and widen if you see unknowns.
276
284
 
285
+ Before collecting anything, org-mode `report` checks every organisation's own
286
+ `token_env` token: each must be set, each distinct token's rate limit must not
287
+ be spent, and each organisation's repository listing must be readable, or the
288
+ run stops with the codes in [Exit codes](#exit-codes). `remediate` ignores the
289
+ per-organisation `token_env` values and checks only its one `--token-env`
290
+ token (default `GITHUB_TOKEN`): its rate limit, and its read of every
291
+ organisation's listing. For a classic PAT the same check warns about a missing
292
+ scope from the table below and about a token that expires within seven days.
293
+ The rate-limit, scope and expiry checks are best effort: when `GET /rate_limit`
294
+ times out, fails to connect, answers anything but `200` or `401`, or sends a
295
+ body the tool cannot read, they are skipped for that token (logged at DEBUG)
296
+ and the run goes on to the listing checks. A passing pre-flight therefore does
297
+ not prove that every token's budget was checked.
298
+
277
299
  The **one** exception is organisation-ruleset coverage. GitHub gates the
278
300
  org-rulesets endpoint behind an org-admin permission (classic `admin:org` scope,
279
301
  or fine-grained Administration **write**), even though the tool only reads it.
@@ -303,6 +325,152 @@ repository is covered *solely* by a required-workflow ruleset whose workflow has
303
325
  never run. A genuinely unexpected failure to read the rulesets (for example a
304
326
  `5xx`) is still logged as a warning.
305
327
 
328
+ Org mode also depends on the account behind the token. It reads each
329
+ organisation's code-scanning, Dependabot and secret-scanning alerts through
330
+ GitHub's organisation-wide alert endpoints, which GitHub serves only to an
331
+ organisation owner or security manager (for secret scanning, an owner,
332
+ administrator or security manager), whatever scopes or permissions the token
333
+ carries. This holds for both PAT types, and is separate from the optional
334
+ `admin:org` scope. A token from any other account has those reads refused.
335
+ Most affected signals then read as unknown, but not all: a repository with
336
+ an external Scorecard score is classified from that score alone, so a perfect
337
+ score reads clean even though no code-scanning alert was read. Check the
338
+ account's role rather than relying on unknown counts to expose it.
339
+
340
+ ### Repo mode: the job token
341
+
342
+ Repo mode reads one repository. Its only organisation-level request is the
343
+ best-effort check of the secret-scanning pattern names against GitHub's
344
+ inventory (see
345
+ [Secret scanning covers three pattern categories](#secret-scanning-covers-three-pattern-categories)),
346
+ made before the secret-scanning reads. The job token cannot make it, nor can a
347
+ token without the organisation access that section names, or any token when
348
+ the repository belongs to a user account. The check is then skipped without
349
+ comment and the generic pattern names are used unverified, so a pattern GitHub
350
+ renames would go unnoticed. The job's `GITHUB_TOKEN` covers the other reads
351
+ once the job grants the map below, with two exceptions described after it: it
352
+ cannot read secret-scanning alerts, and whether it can make the Dependabot
353
+ enablement read is untested:
354
+
355
+ ```yaml
356
+ permissions:
357
+ actions: read # workflow run history (Workflow Failures tables)
358
+ security-events: read # code-scanning analyses and alerts
359
+ vulnerability-alerts: read # Dependabot alerts
360
+ ```
361
+
362
+ A `permissions` map sets every permission it leaves out to `none`. The action
363
+ itself needs no more than the map above: the repository and its effective
364
+ branch rules need only the metadata access every job token carries. A job that
365
+ also runs `actions/checkout` with this token on a private repository must add
366
+ `contents: read`.
367
+
368
+ Repo mode finds its repository from the action's `repo` input or, when that is
369
+ empty, from the `upstream` then `origin` git remote of the job's workspace; it
370
+ does not read `GITHUB_REPOSITORY`. A job without a checkout has no remote, so
371
+ it stops before reading anything unless it sets
372
+ `repo: "${{ github.repository }}"`. With `repo` set, the job needs no checkout
373
+ and no `contents` permission.
374
+
375
+ `vulnerability-alerts: read` is the permission GitHub requires before the job
376
+ token can read Dependabot alerts. It does not by itself make the Dependabot
377
+ signal readable: repo mode reads the alerts only after a GraphQL read
378
+ (`hasVulnerabilityAlertsEnabled`) reports Dependabot alerts on, and whether
379
+ the job token can make that read has not been tested. Where it cannot, the
380
+ Dependabot signal reads as unknown when the response carries no repository,
381
+ but as **disabled** when it carries the repository without that field's value
382
+ (see the Dependabot bullet below); neither fails the gate.
383
+
384
+ No job permission covers secret-scanning alerts: GitHub serves them only to a
385
+ GitHub App or a personal access token, and `security-events` covers code
386
+ scanning. With the job token, secret scanning therefore never gates a pull
387
+ request; it reads as unknown or disabled. To gate on leaked secrets, pass a
388
+ token that can read them through the action's `token` input, and grant it
389
+ the repository permissions for every signal repo mode reads (see the
390
+ [fine-grained table](#single-organisation--fine-grained-pat)). GitHub also
391
+ requires the account behind a personal access token to be an administrator
392
+ of the repository or of its organisation; otherwise the read is refused
393
+ whatever the token's permissions.
394
+
395
+ Leaked secrets count as **high** findings, so they fail the gate at
396
+ `fail_threshold` `any`, `low`, `medium` or `high`, but not at `critical` or
397
+ the default `none`.
398
+
399
+ On a `pull_request` run from a fork, GitHub withholds repository secrets by
400
+ default, so a token passed from `secrets` is empty and the action falls back
401
+ to the job token: secret scanning then does not gate that run, and the job
402
+ can pass. A workflow that must not pass without the token should fail in an
403
+ earlier step when the secret is empty. Do not switch to `pull_request_target`
404
+ to obtain the secret: a job that then checks out the pull request's code
405
+ exposes the token to it. For the same reason, do not enable a private or
406
+ internal repository's **Send secrets to workflows from pull requests**
407
+ setting where untrusted contributors can open fork pull requests: with it on,
408
+ the token is passed to workflow code the fork controls instead of falling
409
+ back to the job token.
410
+
411
+ Repo mode reads the repository's code-scanning, secret-scanning and Dependabot
412
+ alerts. A read the token cannot make does not always surface as unknown. A
413
+ `200` whose body is not valid JSON, or whose top-level JSON type is not the
414
+ one the read expects (an array or an object), counts as a failed read. The
415
+ client checks no deeper: a well-formed body with missing fields is read as
416
+ it stands, so an analyses page of `[{}]` names no tool, and the tools then
417
+ read as not enabled rather than unknown.
418
+
419
+ - CodeQL, zizmor and aislop: when the analyses read fails with anything but
420
+ `404`, or the filtered probe for a tool missing from the newest 100
421
+ analyses answers with invalid JSON or a non-array body, each is unknown,
422
+ except one a ruleset enforces, whose alert read is then skipped so that it
423
+ reads as clean. A `404` reads as code scanning **disabled**, and a tool missing from
424
+ the analyses reads **not enabled**, as it does when its filtered probe fails
425
+ with an HTTP error.
426
+ Neither applies to a tool a ruleset enforces: it counts as enabled, and
427
+ after a `404` its alert read is skipped, so it reads as clean rather than
428
+ disabled. For a tool detected in the analyses or enforced by a ruleset,
429
+ an alert at or above the category's cutoff makes the repository an
430
+ offender even when the alert read did not finish; otherwise an unfinished
431
+ alert read is **unknown**, never clean. A tool left undetected, such as by
432
+ a failed probe, reads **not enabled** whatever alerts were collected, so
433
+ its alerts do not fail the gate.
434
+ - Scorecard prefers its external score from scorecard.dev, read without the
435
+ token, so it can be classified, clean included, while the analyses are
436
+ unreadable. Without that score it falls back to its code-scanning alerts
437
+ only when Scorecard is detected in the analyses, under the same rule for an
438
+ unfinished alert read; a ruleset does not stand in for detection here, and
439
+ an undetected Scorecard's alerts do not fail the gate.
440
+ - Secret scanning makes two reads (see
441
+ [Secret scanning covers three pattern categories](#secret-scanning-covers-three-pattern-categories)).
442
+ An alert from either makes the repository an offender. Otherwise it reads
443
+ as **disabled** only when neither read succeeded and the unfiltered one
444
+ returned `404`, the answer GitHub gives when secret scanning is off. It is
445
+ unknown when neither succeeded for another reason, a `403` included, and
446
+ when one read succeeded but the other failed.
447
+ - Dependabot alerts are unknown when the enablement read returns no
448
+ repository: a failed request, a malformed body, or an error on the
449
+ repository itself. A response that returns the repository with
450
+ `hasVulnerabilityAlertsEnabled` null or missing, as a partial response with
451
+ an error on that field can, reads as Dependabot alerts **disabled**: the
452
+ alerts are not read, so the signal adds no unknown count and cannot fail the
453
+ gate. An alert at or above the category's cutoff (`medium` by default)
454
+ makes the repository an offender even when the alert read did not finish;
455
+ otherwise an unfinished alert read is **unknown**, never clean.
456
+
457
+ Repo mode classifies every category against its default cutoff (see
458
+ [Pass/fail severity cutoff](#passfail-severity-cutoff)) and ignores
459
+ `report.categories.<key>.fail_severity`. CodeQL, Scorecard findings and
460
+ Dependabot use `medium`, aislop `low` and zizmor `informational`, so a
461
+ repository whose only CodeQL alerts are `low` reads clean and passes even at
462
+ `fail_threshold` `any` or `low`.
463
+
464
+ Classification and the gate are separate, and the gate acts only on offenders.
465
+ `fail_threshold: any` fails the job on every offender, a sub-10 Scorecard
466
+ score with no findings included. A severity threshold fails it only on an
467
+ offender with a finding at or above that severity. An unknown or disabled
468
+ signal never fails the gate, so a token missing a permission can pass it:
469
+ check each category's footer for its `❓` unknown count.
470
+
471
+ Repo mode reads no issues, pull requests or organisation membership, so it
472
+ needs no permission for them.
473
+
306
474
  ### Single organisation — fine-grained PAT
307
475
 
308
476
  A fine-grained PAT is bound to one resource owner, so it works for a report
@@ -316,9 +484,10 @@ organisation and **Repository access** set to *All repositories*, then grant:
316
484
  | Metadata | Mandatory baseline; listing organisation repositories |
317
485
  | Contents | `.github/dependabot.yml`, latest release, and tag dates |
318
486
  | Dependabot alerts | Open Dependabot vulnerability alerts |
319
- | Code scanning alerts | CodeQL / Scorecard / zizmor / aislop findings |
487
+ | Code scanning alerts | CodeQL / Scorecard / zizmor / aislop / fuzz findings |
320
488
  | Secret scanning alerts | Open secret-scanning alerts, across every GitHub pattern category |
321
489
  | Issues | Open issues and their labels (GitHub Issues table) |
490
+ | Pull requests | Open pull requests, their reviews and review requests (Pull Requests tables) |
322
491
  | Administration | Dependabot enablement + security-updates status, and effective branch rules. *Optional* **write** reads the Code Quality setup, which GitHub gates behind write |
323
492
  | Actions | Workflow state behind a stale CodeQL configuration, and the workflow run history behind the Workflow Failures tables (the run listing, single-run re-reads, and the GraphQL read of a failed run's check suite) |
324
493
 
@@ -326,11 +495,23 @@ organisation and **Repository access** set to *All repositories*, then grant:
326
495
 
327
496
  | Permission | Access | Used for |
328
497
  | ---------- | ------ | -------- |
329
- | Administration | Read (write for rulesets) | *Optional*, and the only permission here with a write variant. **Read** keeps the token read-only and unlocks GitHub's secret-scanning pattern inventory (see below). **Write** additionally unlocks organisation rulesets (detecting tools enforced through an org ruleset), which GitHub gates behind Administration write. Omit the permission entirely to skip both; everything else is unaffected. |
330
-
331
- > Read-only is enough for everything except the optional ruleset coverage
332
- > and the Code Quality setup read above. A fine-grained token cannot span organisations. For a report covering
333
- > more than one org, use a classic PAT (below).
498
+ | Members | Read | Organisation membership behind the `Ext` columns of the GitHub Issues and Pull Requests tables. Without it `Ext` is a lower bound and the terminal report prints a warning (see [Inside or outside the organisation](#inside-or-outside-the-organisation)) |
499
+ | Administration | Read (write for rulesets) | *Optional*. **Read** keeps the token read-only and unlocks GitHub's secret-scanning pattern inventory (see below). **Write** additionally unlocks organisation rulesets (detecting tools enforced through an org ruleset), which GitHub gates behind Administration write. Omit the permission entirely to skip both; everything else is unaffected. |
500
+
501
+ > Every permission in both tables is read-only, except the two optional
502
+ > Administration **write** grants: organisation rulesets and the Code Quality
503
+ > setup read. A fine-grained token cannot span organisations, but a report
504
+ > resolves each organisation's own `token_env`, so a multi-organisation report
505
+ > can give each organisation its own fine-grained PAT. Set each organisation's
506
+ > `token_env` to a distinct custom variable, not `GITHUB_TOKEN`, and export
507
+ > each PAT under it (in the action, through the step's `env`). Leave the
508
+ > `token_env` input and `--token-env` unset, since either overrides every
509
+ > organisation's. Org mode in the action still requires a non-empty `token`
510
+ > input, so pass one of those PATs there too. With the `token_env` input unset,
511
+ > the action exports `token` as `GITHUB_TOKEN`, replacing any `GITHUB_TOKEN`
512
+ > the step sets; an organisation without its own `token_env` reads that one.
513
+ > Otherwise use one classic PAT (below). `remediate` runs on a single token
514
+ > (see [The `remediate` subcommand](#the-remediate-subcommand)).
334
515
 
335
516
  ### Multiple organisations — classic PAT
336
517
 
@@ -340,14 +521,15 @@ organisations. Grant these scopes:
340
521
 
341
522
  | Scope | Used for |
342
523
  | ----- | -------- |
343
- | `repo` | Repository data, including private repositories, and the workflow run history behind the Workflow Failures tables |
524
+ | `repo` | Repository data, including private repositories; open issues and pull requests (GitHub Issues and Pull Requests tables); and the workflow run history behind the Workflow Failures tables |
344
525
  | `security_events` | Code scanning, secret scanning, and Dependabot alerts (org-bulk and per-repo) |
345
- | `read:org` | Listing organisation repositories, and GitHub's secret-scanning pattern inventory (see below) |
526
+ | `read:org` | Listing organisation repositories, organisation membership behind the `Ext` columns, and GitHub's secret-scanning pattern inventory (see below) |
346
527
  | `admin:org` | *Optional* — reading organisation rulesets for ruleset-based tool coverage. GitHub gates `GET /orgs/{org}/rulesets` behind the full `admin:org` scope; `read:org` and `write:org` return 404. Omit it to skip that one signal; everything else is unaffected. |
347
528
 
348
529
  > For organisations that enforce SSO, the PAT must be **SSO-authorised** for
349
- > each target organisation, or the org-level endpoints return `403` (reported as
350
- > unknown). Store the token as a secret (e.g. `LFRELENG_ACTIONS_REPORT_PAT`) and
530
+ > each target organisation, or the org-level endpoints return `403`: the
531
+ > repository listing then stops the run with exit code `5`, rather than being
532
+ > reported as unknown. Store the token as a secret (e.g. `LFRELENG_ACTIONS_REPORT_PAT`) and
351
533
  > reference it by env-var name via `token_env`; never embed it in the config.
352
534
 
353
535
  ### Secret scanning covers three pattern categories
@@ -377,6 +559,108 @@ cannot read it, the check is skipped without comment and the sweep proceeds
377
559
  unchanged. The AI-detected patterns are absent from that inventory and so go
378
560
  unverified.
379
561
 
562
+ ### The `remediate` subcommand
563
+
564
+ [`remediate`](#remediation) runs the report's own collection before it writes,
565
+ so its token needs the report's reads, plus write access. It skips building
566
+ the GitHub Issues, Pull Requests and Assigned to Me tables and the Workflow
567
+ Failures tables, because no remediation acts on them, and with them the
568
+ membership and workflow-run reads behind them. The shared per-repository read
569
+ still asks for open issues and pull requests. Unlike the report, which reads
570
+ each organisation's own `token_env`, `remediate` drives the run across every
571
+ configured organisation with the one token in `--token-env` (default
572
+ `GITHUB_TOKEN`), so a run covering more than one organisation needs a classic
573
+ PAT. Admin access to each repository it changes is sufficient for every
574
+ category, though not always required: GitHub's reference for updating a
575
+ repository also lets an organisation owner or security manager change
576
+ `security_and_analysis`, the `secret_scanning` write. The organisation owner
577
+ or security manager role (see [Token permissions](#token-permissions)) is
578
+ needed only for the organisation-wide alert reads, which feed the report's
579
+ alert counts. No category chooses its targets from them: each reads the
580
+ repository's own code-scanning analyses, secret scanning state, shared
581
+ GraphQL read or settings. Without the role those alert reads are refused and
582
+ their counts read as unknown, but each category still finds its targets among
583
+ the repositories the run lists.
584
+
585
+ That listing holds only the repositories both the account and the token can
586
+ see. GitHub leaves a private repository either one cannot access out of a
587
+ successful listing, with no error, so an unrestricted run can finish cleanly
588
+ having missed it. When you know which repositories a run should change, name
589
+ them with `--repos owner/name`: a name that matches no listed repository
590
+ stops the run (see [Remediation](#remediation)).
591
+
592
+ **Classic PAT:** `repo`, `security_events` and `read:org`. `repo` also covers
593
+ every write, provided the token's account holds the access described above.
594
+ `admin:org` stays optional, exactly as for the report, except as
595
+ the `codeql` caveat below describes.
596
+
597
+ **Fine-grained PAT, reads:** the repository permissions Metadata, Contents,
598
+ Dependabot alerts, Code scanning alerts, Secret scanning alerts, Issues,
599
+ Administration and Actions from the report's table. Keep Issues: a failed issue
600
+ read fails the repository's whole shared GraphQL read, which also carries
601
+ Dependabot alerts enablement, the auto-merge setting, the languages Code
602
+ Quality depends on, and the branch head the stale-CodeQL check measures
603
+ against. Those categories then read as unknown for that repository and get no
604
+ write, while CodeQL, secret scanning, security updates and private
605
+ vulnerability reporting, read separately, can still be written. Actions read covers the workflow state behind a stale
606
+ CodeQL configuration. Pull requests and the organisation Members permission
607
+ may be left out: a failed pull-request read affects only the pull-request data,
608
+ which `remediate` does not use, and it makes no membership read. The
609
+ organisation Administration permission stays optional, as for the report,
610
+ except as the `codeql` caveat below describes.
611
+
612
+ **Caveat for `codeql`:** a repository reads as CodeQL enabled only when it
613
+ has a CodeQL analysis, or when a required workflow that `ruleset_workflows`
614
+ maps to `codeql` covers it. The analysis check reads analyses on every branch,
615
+ not only the default branch, so a repository whose only CodeQL analysis came
616
+ from a feature branch reads as enabled and is not a target, though its default
617
+ branch has none. The check reads the newest 100 analyses, and when CodeQL is
618
+ not among them, a probe filtered to CodeQL; if that probe fails with an HTTP
619
+ error, CodeQL goes undetected for the run, so a repository whose CodeQL
620
+ analyses are all older becomes a target. Any other CodeQL pipeline that has
621
+ not yet uploaded an analysis leaves the repository a `codeql` target: a
622
+ repository-local workflow, a required workflow the mapping does not name, one
623
+ whose ruleset the token cannot read, or an external pipeline that uploads with
624
+ the CodeQL CLI or the REST API. Enabling default setup there makes GitHub
625
+ reject the CodeQL uploads that pipeline later makes. Ruleset-read access
626
+ (classic `admin:org`, or fine-grained organisation Administration write)
627
+ closes only the unreadable-ruleset case, and only in part: ruleset coverage
628
+ is recognised for a ruleset that targets repositories by name, not for one
629
+ that targets them by repository ID or custom property. So whatever the token,
630
+ check every `codeql` target in the dry run against the repository's existing
631
+ CodeQL workflows and any external CodeQL pipeline before passing `--apply`.
632
+ The dry run names at most `report.top_n_cli` targets per category (default:
633
+ `report.top_n`, else 10) and counts the rest, and `remediate` has no flag to
634
+ change it. Each organisation takes the value from
635
+ its own `report` block, which inherits the global one, so to list every target
636
+ set `top_n_cli` to `0` in the global `report` block and remove or zero any
637
+ organisation's own `top_n_cli`; `--apply` acts on the targets the preview
638
+ counts but does not name. `--apply` does not replay the preview either: it
639
+ collects again and acts on the targets it finds then, so a repository created,
640
+ or newly reading as a `codeql` target, after the preview is changed without
641
+ having been checked. Apply `codeql` only to the repositories you checked, with
642
+ `--category codeql --repos owner/name,...`, and preview again first if their
643
+ state may have changed.
644
+
645
+ **Fine-grained PAT, writes:** each category writes through the endpoints below,
646
+ so a run limited with `--category` needs only the access those take:
647
+
648
+ | `--category` | Write | Fine-grained permission |
649
+ | ------------ | ----- | ----------------------- |
650
+ | `codeql` | `PATCH /repos/{owner}/{repo}/code-scanning/default-setup` | Not yet confirmed |
651
+ | `secret_scanning` | `PATCH /repos/{owner}/{repo}` (`security_and_analysis`) | Not yet confirmed |
652
+ | `dependabot_alerts_enabled` | `PUT /repos/{owner}/{repo}/vulnerability-alerts` | Not yet confirmed |
653
+ | `dependabot_updates_enabled` | `PUT .../vulnerability-alerts`, then `PUT .../automated-security-fixes` | Not yet confirmed |
654
+ | `private_vulnerability_reporting` | `PUT /repos/{owner}/{repo}/private-vulnerability-reporting` | Not yet confirmed |
655
+ | `auto_merge` | `PATCH /repos/{owner}/{repo}` (`allow_auto_merge`) | Not yet confirmed |
656
+ | `code_quality` | `PATCH /repos/{owner}/{repo}/code-quality/setup` | Administration: write |
657
+ | `codeql_stale_configurations` | `DELETE /repos/{owner}/{repo}/code-scanning/analyses/{id}`, and `PUT /repos/{owner}/{repo}/actions/workflows/{file}/enable` | Not yet confirmed |
658
+
659
+ Where the table says *Not yet confirmed*, this README does not yet name the
660
+ fine-grained permission GitHub requires; use a classic PAT for that category.
661
+ A write the token may not make fails for that repository and category only,
662
+ and the run lists it with GitHub's status code.
663
+
380
664
  ## Usage
381
665
 
382
666
  ### Org mode (scheduled report)
@@ -384,7 +668,7 @@ unverified.
384
668
  ```yaml
385
669
  - name: "Security report"
386
670
  id: report
387
- uses: lfreleng-actions/github-security-report-action@v0.1.0
671
+ uses: lfreleng-actions/github-security-report-action@a5ad54423029f7b4923e50625c85a7dace1fd0b4 # v0.25.0
388
672
  with:
389
673
  scope: "org"
390
674
  config: "${{ secrets.GSR_CONFIG || vars.GSR_CONFIG }}"
@@ -405,12 +689,15 @@ digest only on the configured `report_day` (default Tuesday).
405
689
 
406
690
  ```yaml
407
691
  - name: "Security report"
408
- uses: lfreleng-actions/github-security-report-action@v0.1.0
692
+ uses: lfreleng-actions/github-security-report-action@a5ad54423029f7b4923e50625c85a7dace1fd0b4 # v0.25.0
409
693
  with:
410
694
  scope: "repo"
695
+ repo: "${{ github.repository }}" # lets the job run without a checkout
411
696
  token: "${{ github.token }}"
412
697
  fail_threshold: "high" # fail the job on any open high/critical finding
413
- # requires: permissions: { security-events: read }
698
+ # requires: permissions:
699
+ # { actions: read, security-events: read, vulnerability-alerts: read }
700
+ # (see "Repo mode: the job token" under Token permissions)
414
701
  ```
415
702
 
416
703
  Repo mode renders one repository to the terminal and the job summary. It
@@ -460,6 +747,7 @@ lists every key with its type, default and description, and
460
747
  "issue_age_warn_days": 30,
461
748
  "issue_age_error_days": 60,
462
749
  "graph_batch": 10,
750
+ "fuzz_languages": ["Python", "Go"],
463
751
  "concurrency": 9,
464
752
  "workflow_runs": {
465
753
  "windows": { "cli": [7], "report": [7, 30, 90], "slack": [7] }
@@ -587,7 +875,7 @@ The example above hides Zizmor on every surface, and keeps Releases / Tagging
587
875
  out of the terminal and Slack while still publishing it to the Markdown and HTML
588
876
  Pages output. The valid category keys are: `codeql`,
589
877
  `codeql_stale_configurations`, `codeql_language_coverage`, `scorecard`,
590
- `zizmor`, `aislop`, `dependabot_alerts`, `secret_scanning`,
878
+ `zizmor`, `aislop`, `fuzz`, `dependabot_alerts`, `secret_scanning`,
591
879
  `dependabot_alerts_enabled`, `dependabot_updates_enabled`,
592
880
  `dependabot_cooldown`, `releases`, `mutable_releases`,
593
881
  `private_vulnerability_reporting`, `auto_merge`, `malware_findings`,
@@ -817,8 +1105,8 @@ total open issues, then on the oldest issue.
817
1105
  Ordering is resolved once, when the report is built, so every surface and
818
1106
  `report.json` agree. It applies to the generic tables (GitHub Issues, Releases /
819
1107
  Tagging, Mutable Releases, the Dependabot posture tables) **and** to the severity
820
- signal tables (CodeQL, OpenSSF Scorecard, zizmor, AI Slop, Dependabot alerts,
821
- secret scanning).
1108
+ signal tables (CodeQL, OpenSSF Scorecard, zizmor, AI Slop, Fuzzing, Dependabot
1109
+ alerts, secret scanning).
822
1110
 
823
1111
  The signal tables resolve their terms against a fixed vocabulary rather than a
824
1112
  rendered column list, because their columns vary by surface and by data (Slack
@@ -828,7 +1116,7 @@ repository carries note-level findings):
828
1116
  | Signal | Accepted sort names |
829
1117
  | ------ | ------------------- |
830
1118
  | OpenSSF Scorecard | `repository`, `score`, `critical`, `high`, `medium`, `low`, `info`, `total` |
831
- | CodeQL, zizmor, AI Slop, Dependabot alerts | `repository`, `critical`, `high`, `medium`, `low`, `info`, `total` |
1119
+ | CodeQL, zizmor, AI Slop, Fuzzing, Dependabot alerts | `repository`, `critical`, `high`, `medium`, `low`, `info`, `total` |
832
1120
  | Secret Scanning | `repository`, `open` |
833
1121
 
834
1122
  `informational` is accepted for `info`, and `total` for secret scanning's `open`.
@@ -867,7 +1155,7 @@ By default the report sorts its sections into three bands:
867
1155
 
868
1156
  | Band | Contains | Why |
869
1157
  | ---- | -------- | --- |
870
- | **Priority** | Secret Scanning, Dependabot: Malware Findings, Dependabot: Security Alerts, CodeQL, Mutable Releases | Findings worth acting on today |
1158
+ | **Priority** | Secret Scanning, Dependabot: Malware Findings, Dependabot: Security Alerts, CodeQL, Fuzzing, Mutable Releases | Findings worth acting on today |
871
1159
  | **Middle** | Everything else | Neither urgent nor constant |
872
1160
  | **BAU** | OpenSSF Scorecard, GitHub Issues, GitHub Issues: Assigned to Me, Pull Requests, Pull Requests: Assigned to Me | Carry data every run, so none of it is news |
873
1161
 
@@ -1041,7 +1329,8 @@ requests are **not** counted: the GraphQL `issues` connection excludes them.
1041
1329
  classic PAT's `repo` scope already covers it. Without it GitHub serves the query
1042
1330
  with HTTP 200 and this one field null, so affected repositories are reported as
1043
1331
  `❓ Unknown` rather than counted as having no open issues — an unreadable backlog
1044
- is never presented as a clean one.
1332
+ is never presented as a clean one. [Token permissions](#token-permissions) lists
1333
+ every permission the report needs.
1045
1334
 
1046
1335
  #### Issue colours and age thresholds
1047
1336
 
@@ -1409,7 +1698,7 @@ github-security-report report --hide pull_requests_assigned
1409
1698
  The Action exposes the same control through a `hide` input:
1410
1699
 
1411
1700
  ```yaml
1412
- - uses: lfreleng-actions/github-security-report-action@v1
1701
+ - uses: lfreleng-actions/github-security-report-action@a5ad54423029f7b4923e50625c85a7dace1fd0b4 # v0.25.0
1413
1702
  with:
1414
1703
  hide: "pull_requests_assigned" # space- or comma-separated
1415
1704
  ```
@@ -1485,7 +1774,8 @@ stuck one first.
1485
1774
  **Permissions.** A fine-grained PAT needs **Pull requests: read**; a classic
1486
1775
  PAT's `repo` scope already covers it. Without it the connection comes back null
1487
1776
  and affected repositories are reported as `❓ Unknown` rather than as having no
1488
- open pull requests.
1777
+ open pull requests. [Token permissions](#token-permissions) lists every
1778
+ permission the report needs.
1489
1779
 
1490
1780
  ### Inside or outside the organisation
1491
1781
 
@@ -1536,11 +1826,12 @@ The column understates rather than inventing an outsider.
1536
1826
  **Members: read** (fine-grained). Without it the terminal report prints
1537
1827
  `⚠️ Token lacks read/organisation permission; results incomplete for <org>`
1538
1828
  and reports externally-raised counts as a lower bound rather than guessing from
1539
- `authorAssociation` alone.
1829
+ `authorAssociation` alone. [Token permissions](#token-permissions) lists every
1830
+ permission the report needs.
1540
1831
 
1541
1832
  ### Organisation feature gating
1542
1833
 
1543
- The workflow-driven signals (OpenSSF Scorecard, zizmor, aislop) need
1834
+ The workflow-driven signals (OpenSSF Scorecard, zizmor, aislop, fuzz) need
1544
1835
  organisation-deployed workflows before they produce any data (see the
1545
1836
  [organisation scan setup guide](docs/org-scan-setup.md)). By default the tool
1546
1837
  runs a cheap support check per organisation before collecting each of them:
@@ -1846,10 +2137,11 @@ is about 25 MB for a 140-repository organisation.
1846
2137
 
1847
2138
  ### Pass/fail severity cutoff
1848
2139
 
1849
- The severity-ranked signals (CodeQL, Scorecard, Zizmor, aislop, Dependabot
1850
- alerts) use a `fail_severity` cutoff to decide when a repository counts as a
1851
- failure. A repository is flagged as an offender only when it carries a finding
1852
- **at or above** the cutoff; findings below it fold into the clean count.
2140
+ The severity-ranked signals (CodeQL, Scorecard, Zizmor, aislop, fuzz,
2141
+ Dependabot alerts) use a `fail_severity` cutoff to decide when a repository
2142
+ counts as a failure. A repository is flagged as an offender only when it
2143
+ carries a finding **at or above** the cutoff; findings below it fold into the
2144
+ clean count.
1853
2145
  Severities run (lowest to highest) `informational`, `low`, `medium`, `high`,
1854
2146
  `critical` — `informational` being the sub-low rung for SARIF `none` findings
1855
2147
  and unclassifiable alerts. Zizmor's SARIF `note` findings normalise to `low`
@@ -1859,8 +2151,9 @@ SARIF), matching the ruleset-enforced PR gate that blocks on note-and-above.
1859
2151
  aislop populates the same SARIF level axis and normalises identically.
1860
2152
 
1861
2153
  The global default cutoff is `medium`, so `low` and `informational` findings
1862
- pass. Zizmor and aislop default to `low` (only `informational` passes).
1863
- Override the cutoff per category under
2154
+ pass. Zizmor and aislop default to `low` (only `informational` passes). Fuzz
2155
+ keeps `medium`: every fuzz failure arrives at SARIF `error`, which normalises
2156
+ to `high`, so each one already fails. Override the cutoff per category under
1864
2157
  `report.categories.<key>.fail_severity`:
1865
2158
 
1866
2159
  ```json
@@ -2062,17 +2355,59 @@ API in the same way.
2062
2355
  | ---- | ------- |
2063
2356
  | `0` | The report ran. |
2064
2357
  | `1` | Repo mode only: findings met or exceeded `--fail-threshold`. |
2065
- | `2` | Usage or configuration error (bad flag, unreadable config). |
2358
+ | `2` | Usage or configuration error (bad flag, bad config, unset token). |
2066
2359
  | `3` | The GitHub API was unusable after the retry budget (see below). |
2067
2360
  | `4` | GitHub rejected the credentials (HTTP 401). |
2361
+ | `5` | A repository listing answered `403` or `404`, with no rate limit. |
2362
+ | `6` | A token's rate limit stopped the pre-flight (causes below). |
2363
+
2364
+ Code `6` has three causes, and a rate-limited `403` is one of them, not `5`:
2365
+
2366
+ - a core or GraphQL budget already spent when the run started;
2367
+ - a rate-limited listing, including a `403` whose message names a secondary
2368
+ rate limit;
2369
+ - a listing page that spent the last request.
2068
2370
 
2069
- Codes `3` and `4` are **aborts, not reports**: nothing is written and no Pages
2371
+ Codes `3` to `6` are **aborts, not reports**: nothing is written and no Pages
2070
2372
  artifact is produced. That is deliberate. A token that has expired, been revoked
2071
2373
  or been rotated makes every read fail, and a run that degraded instead would
2072
2374
  render a complete, confidently clean report — `0 repositories analysed`, every
2073
2375
  section `No data` or `All Clean` — and a scheduled job would then publish it
2074
2376
  over the last good one. Reporting false data is worse than reporting none, so
2075
- the run stops at the first rejected request.
2377
+ the run stops at the first rejected request. A repository listing the token
2378
+ cannot read, or a rate limit with nothing left, would produce the same report,
2379
+ so they stop the run too.
2380
+
2381
+ For `remediate`, "nothing is written" holds only when the pre-flight stops the
2382
+ run (any `5` or `6`, and a `3` or `4` raised before collection starts). After
2383
+ the pre-flight passes, `remediate` collects and writes one organisation at a
2384
+ time, so a `3` or `4` from a later organisation comes after the earlier ones'
2385
+ writes have been applied. Check what the run printed before re-running; a
2386
+ re-run enables only what it finds still off.
2387
+
2388
+ Org-mode `report` and `remediate` check for these before they collect
2389
+ anything, for every configured organisation before the first. `report` reads
2390
+ each organisation's own `token_env`; `remediate` reads only its one
2391
+ `--token-env` token, never the per-organisation ones. Every token is set (all
2392
+ missing ones are named together, exit `2`); one `GET /rate_limit` per
2393
+ distinct token, which costs no rate limit, finds a spent core or GraphQL
2394
+ budget (exit `6`, naming the resource and when it resets); and one
2395
+ single-repository page of each organisation's listing finds a `403` or `404`
2396
+ (exit `5`). The `/rate_limit` probe is best effort: it is made once with a
2397
+ short timeout, and when it times out, cannot connect, answers anything but
2398
+ `200` or `401`, or sends an unreadable body, its budget, scope and expiry
2399
+ checks are skipped for that token (logged at DEBUG) and the run carries on.
2400
+ The code `5` message names the organisation and what to check:
2401
+ its name, a classic PAT's SSO authorisation for it, or a fine-grained PAT's
2402
+ resource owner and repository access. A listing that is rate limited
2403
+ (including a `403` whose message names a secondary rate limit), or whose page
2404
+ spends the last request, exits `6`. The message gives the later of the
2405
+ `Retry-After` wait and, when the budget is spent, its reset; with neither, it
2406
+ advises waiting at least a minute. One that still fails after the retry
2407
+ budget, or whose page holds an entry that is not a repository, exits `3`. A
2408
+ token GitHub rejects exits `4`, and the message says which token. A run that
2409
+ passes prints nothing new. A listing whose *later* page fails mid-run still
2410
+ produces a report marked incomplete.
2076
2411
 
2077
2412
  Code `3` covers a GitHub API that could not be reached at all, and a GraphQL
2078
2413
  prefetch that failed as a whole: either a size-shaped failure (`502`/`504`
@@ -2097,14 +2432,17 @@ surfaces are acted on — repositories whose state could not be read are counted
2097
2432
  as *unknown* and are never written to, so remediation never blind-writes.
2098
2433
 
2099
2434
  It is **dry run by default** (these are privileged writes); pass `--apply` to
2100
- make changes. A single **write-capable** org-admin token (from `--token-env`,
2101
- default `GITHUB_TOKEN`) drives both the read and the writes across every
2102
- configured organisation, so it bypasses the per-org read-only `token_env` in the
2103
- config.
2435
+ make changes. Each run collects afresh, so `--apply` acts on what it finds
2436
+ then, not on the plan an earlier dry run printed. A single **write-capable**
2437
+ token (from `--token-env`, default `GITHUB_TOKEN`) drives both the read and the
2438
+ writes across every configured organisation, so it bypasses the per-org
2439
+ read-only `token_env` in the config.
2440
+ [The `remediate` subcommand](#the-remediate-subcommand) under Token permissions
2441
+ lists the scopes and permissions it needs, by category.
2104
2442
 
2105
2443
  ```bash
2106
- # An org-admin token is required: a classic PAT with the `repo` scope
2107
- # (administers repository security settings) plus `read:org` to enumerate repos.
2444
+ # Token scopes and permissions: see "The remediate subcommand" under
2445
+ # Token permissions.
2108
2446
  source ~/.secrets.github.classic.god # exports $GITHUB_TOKEN
2109
2447
 
2110
2448
  # Dry run (default): preview every change, touch nothing.
@@ -2194,7 +2532,8 @@ repositories are never written. GitHub provisions the first analysis
2194
2532
  asynchronously. A `409` (an update already in progress), a `403` (an archived
2195
2533
  repository, or Code Quality not allowed for it) or a `422` fails that
2196
2534
  repository only and names the cause. The token needs the classic `repo`
2197
- scope, or a fine-grained token's Administration: write. See
2535
+ scope, or a fine-grained token's Administration: write (see
2536
+ [The `remediate` subcommand](#the-remediate-subcommand)). See
2198
2537
  [ADR-0006](docs/adr/0006-github-code-quality.md) for the reasoning.
2199
2538
 
2200
2539
  ### Cleaning up stale CodeQL configurations
@@ -2256,7 +2595,8 @@ an interrupted run's next pass picks up the remaining analyses. GitHub answers
2256
2595
  requests it will not authorise with `404`, so a deletion's `404` counts as
2257
2596
  already done only once the analysis also reads back as gone; a token that may
2258
2597
  not delete fails instead of reporting a cleanup that never happened. The token
2259
- needs the classic `repo` scope. See
2598
+ needs the classic `repo` scope (see
2599
+ [The `remediate` subcommand](#the-remediate-subcommand)). See
2260
2600
  [ADR-0005](docs/adr/0005-codeql-configuration-cleanup.md) for the reasoning.
2261
2601
 
2262
2602
  ## Bulk Remediation Scripts
@@ -2285,8 +2625,9 @@ the current state of each repository, enables the feature where it is off, and
2285
2625
  verifies the result.
2286
2626
 
2287
2627
  ```bash
2288
- # An org-admin token is required: a classic PAT with the `repo` scope
2289
- # (administers repository security settings) plus `read:org` to enumerate repos.
2628
+ # The token needs the classic `repo` scope from an account with admin access
2629
+ # to each repository, plus `read:org` to enumerate them. See "Token
2630
+ # permissions".
2290
2631
  source ~/.secrets.github.classic.god # exports $GITHUB_TOKEN
2291
2632
 
2292
2633
  # Dry run (default): preview every change, touch nothing.