github-security-report 0.1.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.
- github_security_report-0.1.0/.gitignore +66 -0
- github_security_report-0.1.0/LICENSE +1 -0
- github_security_report-0.1.0/LICENSES/Apache-2.0.txt +201 -0
- github_security_report-0.1.0/PKG-INFO +318 -0
- github_security_report-0.1.0/README.md +274 -0
- github_security_report-0.1.0/pyproject.toml +198 -0
- github_security_report-0.1.0/scripts/README.md +73 -0
- github_security_report-0.1.0/src/github_security_report/__init__.py +13 -0
- github_security_report-0.1.0/src/github_security_report/_version.py +24 -0
- github_security_report-0.1.0/src/github_security_report/classify.py +208 -0
- github_security_report-0.1.0/src/github_security_report/cli.py +448 -0
- github_security_report-0.1.0/src/github_security_report/client.py +493 -0
- github_security_report-0.1.0/src/github_security_report/collect.py +376 -0
- github_security_report-0.1.0/src/github_security_report/config.py +343 -0
- github_security_report-0.1.0/src/github_security_report/gitctx.py +66 -0
- github_security_report-0.1.0/src/github_security_report/models.py +172 -0
- github_security_report-0.1.0/src/github_security_report/posture.py +264 -0
- github_security_report-0.1.0/src/github_security_report/py.typed +1 -0
- github_security_report-0.1.0/src/github_security_report/render/__init__.py +3 -0
- github_security_report-0.1.0/src/github_security_report/render/html.py +142 -0
- github_security_report-0.1.0/src/github_security_report/render/markdown.py +172 -0
- github_security_report-0.1.0/src/github_security_report/render/slack.py +215 -0
- github_security_report-0.1.0/src/github_security_report/render/terminal.py +163 -0
- github_security_report-0.1.0/src/github_security_report/report.py +173 -0
- github_security_report-0.1.0/src/github_security_report/rulesets.py +137 -0
- github_security_report-0.1.0/src/github_security_report/runner.py +147 -0
- github_security_report-0.1.0/src/github_security_report/scope.py +97 -0
- github_security_report-0.1.0/src/github_security_report/severity.py +83 -0
- github_security_report-0.1.0/src/github_security_report/templates/index.html.j2 +57 -0
- github_security_report-0.1.0/src/github_security_report/templates/report.html.j2 +162 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 The Linux Foundation
|
|
3
|
+
|
|
4
|
+
# Temporary and binary files
|
|
5
|
+
*~
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*.so
|
|
8
|
+
*.cfg
|
|
9
|
+
!.isort.cfg
|
|
10
|
+
!setup.cfg
|
|
11
|
+
*.orig
|
|
12
|
+
*.log
|
|
13
|
+
*.pot
|
|
14
|
+
__pycache__/*
|
|
15
|
+
.cache/*
|
|
16
|
+
.*.swp
|
|
17
|
+
*/.ipynb_checkpoints/*
|
|
18
|
+
.DS_Store
|
|
19
|
+
|
|
20
|
+
# Project files
|
|
21
|
+
.ropeproject
|
|
22
|
+
.project
|
|
23
|
+
.pydevproject
|
|
24
|
+
.settings
|
|
25
|
+
.idea
|
|
26
|
+
.vscode
|
|
27
|
+
tags
|
|
28
|
+
|
|
29
|
+
# Package files
|
|
30
|
+
*.egg
|
|
31
|
+
*.eggs/
|
|
32
|
+
.installed.cfg
|
|
33
|
+
*.egg-info
|
|
34
|
+
|
|
35
|
+
# Unittest and coverage
|
|
36
|
+
htmlcov/*
|
|
37
|
+
.coverage
|
|
38
|
+
.coverage.*
|
|
39
|
+
.tox
|
|
40
|
+
junit*.xml
|
|
41
|
+
coverage.xml
|
|
42
|
+
.pytest_cache/
|
|
43
|
+
|
|
44
|
+
# Build and docs folder/files
|
|
45
|
+
build/*
|
|
46
|
+
dist/*
|
|
47
|
+
sdist/*
|
|
48
|
+
docs/api/*
|
|
49
|
+
docs/_rst/*
|
|
50
|
+
docs/_build/*
|
|
51
|
+
cover/*
|
|
52
|
+
MANIFEST
|
|
53
|
+
|
|
54
|
+
# Per-project virtualenvs
|
|
55
|
+
.venv*/
|
|
56
|
+
.conda*/
|
|
57
|
+
.python-version
|
|
58
|
+
|
|
59
|
+
# Node
|
|
60
|
+
node_modules/*
|
|
61
|
+
|
|
62
|
+
# Phase 0 capability spike: captured live API data (review/scrub before use)
|
|
63
|
+
phase0-output/
|
|
64
|
+
|
|
65
|
+
# Generated by hatch-vcs at build time
|
|
66
|
+
src/github_security_report/_version.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LICENSES/Apache-2.0.txt
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: github-security-report
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Security and quality reporting across GitHub organisations
|
|
5
|
+
Project-URL: Homepage, https://github.com/lfreleng-actions/github-security-report-action
|
|
6
|
+
Project-URL: Repository, https://github.com/lfreleng-actions/github-security-report-action
|
|
7
|
+
Project-URL: Issues, https://github.com/lfreleng-actions/github-security-report-action/issues
|
|
8
|
+
Author-email: The Linux Foundation <mwatkins@linuxfoundation.org>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: codeql,dependabot,github,github-actions,linux-foundation,reporting,scorecard,secret-scanning,security,zizmor
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Requires-Dist: httpx[http2]==0.28.1
|
|
28
|
+
Requires-Dist: jinja2==3.1.6
|
|
29
|
+
Requires-Dist: jsonschema==4.26.0
|
|
30
|
+
Requires-Dist: pyyaml==6.0.3
|
|
31
|
+
Requires-Dist: rich==15.0.0
|
|
32
|
+
Requires-Dist: typer==0.26.7
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: mypy==2.1.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest-asyncio==1.4.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest-cov==7.1.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest==9.0.3; extra == 'dev'
|
|
38
|
+
Requires-Dist: respx==0.23.1; extra == 'dev'
|
|
39
|
+
Requires-Dist: ruff==0.15.16; extra == 'dev'
|
|
40
|
+
Requires-Dist: syrupy==5.3.2; extra == 'dev'
|
|
41
|
+
Requires-Dist: types-jsonschema==4.26.0.20260518; extra == 'dev'
|
|
42
|
+
Requires-Dist: types-pyyaml==6.0.12.20250915; extra == 'dev'
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
|
|
45
|
+
<!--
|
|
46
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
47
|
+
# SPDX-FileCopyrightText: 2026 The Linux Foundation
|
|
48
|
+
-->
|
|
49
|
+
|
|
50
|
+
# 🔐 GitHub Security Report
|
|
51
|
+
|
|
52
|
+
<!-- prettier-ignore-start -->
|
|
53
|
+
<!-- markdownlint-disable-next-line MD013 -->
|
|
54
|
+
[](https://linuxfoundation.org/) [](https://github.com/lfreleng-actions/github-security-report-action) [](https://opensource.org/licenses/Apache-2.0)
|
|
55
|
+
<!-- prettier-ignore-end -->
|
|
56
|
+
|
|
57
|
+
> Security and quality **reporting** (not scanning) across GitHub
|
|
58
|
+
> organisations. Aggregates existing signals — CodeQL, OpenSSF Scorecard,
|
|
59
|
+
> zizmor, Dependabot, and secret scanning — and ranks the worst offenders so
|
|
60
|
+
> remediation effort goes where it is needed.
|
|
61
|
+
|
|
62
|
+
## 🗒️ Published reports
|
|
63
|
+
|
|
64
|
+
<https://lfreleng-actions.github.io/github-security-report-action/>
|
|
65
|
+
|
|
66
|
+
## What it does
|
|
67
|
+
|
|
68
|
+
For each in-scope repository, every signal is classified into one of four
|
|
69
|
+
states and rendered worst-first:
|
|
70
|
+
|
|
71
|
+
- **Offenders** — enabled with open findings (a ranked table row).
|
|
72
|
+
- **Clean** — enabled with zero findings (a count beneath the table).
|
|
73
|
+
- **Not enabled** — supported but switched off (a nag list prompting you to
|
|
74
|
+
enable it).
|
|
75
|
+
- **Unknown** — indeterminate (insufficient permission), footnoted separately.
|
|
76
|
+
|
|
77
|
+
The single GitHub code-scanning feed is partitioned by `tool.name` into CodeQL,
|
|
78
|
+
Scorecard, and zizmor; Scorecard prefers the external aggregate score and falls
|
|
79
|
+
back to code-scanning findings. See [`docs/BRIEF.md`](docs/BRIEF.md) and
|
|
80
|
+
[`docs/phase0-findings.md`](docs/phase0-findings.md) for the full design and the
|
|
81
|
+
API research it is built on.
|
|
82
|
+
|
|
83
|
+
Two further sections report **configuration posture** and **freshness** as plain
|
|
84
|
+
tables (org mode):
|
|
85
|
+
|
|
86
|
+
- **Dependabot** — three tables: repositories with vulnerability **alerts not
|
|
87
|
+
enabled**, repositories with **security updates not enabled**, and ecosystems
|
|
88
|
+
with no update `cooldown` configured (mandatory; any value passes).
|
|
89
|
+
- **Releases / Tagging** — repositories overdue a release or tag, ranked by a
|
|
90
|
+
hidden compound staleness score. Repositories younger than
|
|
91
|
+
`release_min_age_days` (default 28; `0` includes all) and those in
|
|
92
|
+
`releases_exclude` are omitted.
|
|
93
|
+
|
|
94
|
+
## Operating modes
|
|
95
|
+
|
|
96
|
+
| Mode | Token | Scope | Output |
|
|
97
|
+
| ---- | ----- | ----- | ------ |
|
|
98
|
+
| `org` | fine-grained PAT (single org) or classic PAT (multiple orgs) | one or more organisations | GitHub Pages + Slack + terminal |
|
|
99
|
+
| `repo` | `GITHUB_TOKEN` | the current repository only | job summary + outputs + optional PR gate |
|
|
100
|
+
|
|
101
|
+
`scope: auto` resolves to org mode when configuration is supplied, otherwise
|
|
102
|
+
repo mode for the detected repository. The ephemeral `GITHUB_TOKEN` cannot read
|
|
103
|
+
org-wide security data, so org mode requires a PAT — see
|
|
104
|
+
[Token permissions](#token-permissions) for the exact scopes.
|
|
105
|
+
|
|
106
|
+
## Token permissions
|
|
107
|
+
|
|
108
|
+
Repo mode needs nothing beyond the workflow's ephemeral `GITHUB_TOKEN`. Org mode
|
|
109
|
+
needs a Personal Access Token; choose **one** of the two options below depending
|
|
110
|
+
on how many organisations the report covers.
|
|
111
|
+
|
|
112
|
+
All required access is **read-only**. The tool degrades any read it is not
|
|
113
|
+
permitted to make to an "unknown" status rather than reporting a repository as
|
|
114
|
+
clean, so an under-scoped token surfaces as unknowns in the report instead of
|
|
115
|
+
silently wrong results — start minimal and widen if you see unknowns.
|
|
116
|
+
|
|
117
|
+
### Single organisation — fine-grained PAT
|
|
118
|
+
|
|
119
|
+
A fine-grained PAT is bound to one resource owner, so it works for a report
|
|
120
|
+
covering a **single** organisation. Create it with **Resource owner** set to the
|
|
121
|
+
organisation and **Repository access** set to *All repositories*, then grant:
|
|
122
|
+
|
|
123
|
+
**Repository permissions** (all Read-only):
|
|
124
|
+
|
|
125
|
+
| Permission | Used for |
|
|
126
|
+
| ---------- | -------- |
|
|
127
|
+
| Metadata | Mandatory baseline; listing organisation repositories |
|
|
128
|
+
| Contents | `.github/dependabot.yml`, latest release, and tag dates |
|
|
129
|
+
| Dependabot alerts | Open Dependabot vulnerability alerts |
|
|
130
|
+
| Code scanning alerts | CodeQL / Scorecard / zizmor findings |
|
|
131
|
+
| Secret scanning alerts | Open secret-scanning alerts |
|
|
132
|
+
| Administration | Dependabot enablement + security-updates status, and effective branch rules |
|
|
133
|
+
|
|
134
|
+
**Organization permissions** (Read-only):
|
|
135
|
+
|
|
136
|
+
| Permission | Used for |
|
|
137
|
+
| ---------- | -------- |
|
|
138
|
+
| Administration | Organisation rulesets (detect tools enabled via a required workflow) |
|
|
139
|
+
|
|
140
|
+
> A fine-grained token cannot span organisations. For a report covering more
|
|
141
|
+
> than one org, use a classic PAT (below).
|
|
142
|
+
|
|
143
|
+
### Multiple organisations — classic PAT
|
|
144
|
+
|
|
145
|
+
A classic PAT is authorised across every organisation its creator can access
|
|
146
|
+
(subject to SSO authorisation), so a single token can report on **multiple**
|
|
147
|
+
organisations. Grant these scopes:
|
|
148
|
+
|
|
149
|
+
| Scope | Used for |
|
|
150
|
+
| ----- | -------- |
|
|
151
|
+
| `repo` | Repository data, including private repositories |
|
|
152
|
+
| `security_events` | Code scanning, secret scanning, and Dependabot alerts (org-bulk and per-repo) |
|
|
153
|
+
| `read:org` | Listing organisation repositories and reading organisation rulesets |
|
|
154
|
+
|
|
155
|
+
> For organisations that enforce SSO, the PAT must be **SSO-authorised** for
|
|
156
|
+
> each target organisation, or the org-level endpoints return `403` (reported as
|
|
157
|
+
> unknown). Store the token as a secret (e.g. `SECURITY_REPORT_PAT`) and
|
|
158
|
+
> reference it by env-var name via `token_env`; never embed it in the config.
|
|
159
|
+
|
|
160
|
+
## Usage
|
|
161
|
+
|
|
162
|
+
### Org mode (scheduled report)
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
- name: "Security report"
|
|
166
|
+
id: report
|
|
167
|
+
uses: lfreleng-actions/github-security-report-action@v0.1.0
|
|
168
|
+
with:
|
|
169
|
+
scope: "org"
|
|
170
|
+
config: "${{ secrets.GSR_CONFIG || vars.GSR_CONFIG }}"
|
|
171
|
+
token: "${{ secrets.SECURITY_REPORT_PAT }}"
|
|
172
|
+
output_dir: "site"
|
|
173
|
+
pages_url: "https://lfreleng-actions.github.io/github-security-report-action/"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
A ready-to-use scheduled workflow lives in
|
|
177
|
+
[`.github/workflows/reporting.yaml`](.github/workflows/reporting.yaml): it runs
|
|
178
|
+
daily at 09:00 UTC, publishes to GitHub Pages every day, and posts a Slack
|
|
179
|
+
digest only on the configured `report_day` (default Tuesday).
|
|
180
|
+
|
|
181
|
+
### Repo mode (PR gate)
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
- name: "Security report"
|
|
185
|
+
uses: lfreleng-actions/github-security-report-action@v0.1.0
|
|
186
|
+
with:
|
|
187
|
+
scope: "repo"
|
|
188
|
+
token: "${{ github.token }}"
|
|
189
|
+
fail_threshold: "high" # fail the job on any open high/critical finding
|
|
190
|
+
# requires: permissions: { security-events: read }
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Configuration
|
|
194
|
+
|
|
195
|
+
Configuration is JSON, supplied as a plain `vars.` entry or base64-encoded in a
|
|
196
|
+
`secrets.` entry (base64 only to stop JSON braces tripping GitHub's log
|
|
197
|
+
redaction — it is encoding, not encryption). Tokens are referenced by
|
|
198
|
+
environment-variable name, never embedded.
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"slack": { "channel": "releng-scm", "report_day": "tuesday" },
|
|
203
|
+
"report": {
|
|
204
|
+
"top_n": 10,
|
|
205
|
+
"top_n_report": 10,
|
|
206
|
+
"top_n_cli": 10,
|
|
207
|
+
"top_n_slack": 10,
|
|
208
|
+
"include_archived": false,
|
|
209
|
+
"include_test": false,
|
|
210
|
+
"release_min_age_days": 28
|
|
211
|
+
},
|
|
212
|
+
"organizations": [
|
|
213
|
+
{
|
|
214
|
+
"name": "lfreleng-actions",
|
|
215
|
+
"token_env": "GITHUB_TOKEN",
|
|
216
|
+
"exclude": ["actions-template"],
|
|
217
|
+
"releases_exclude": ["internal-only-repo"]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
`report_day` accepts a single weekday, a list of weekdays, `"never"`, or
|
|
224
|
+
`"always"`.
|
|
225
|
+
|
|
226
|
+
`top_n` controls how many offenders are shown per signal. It is the shared
|
|
227
|
+
default for all three outputs; set any of `top_n_report` (GitHub Pages),
|
|
228
|
+
`top_n_cli` (terminal), or `top_n_slack` (Slack digest) to override an
|
|
229
|
+
individual output. Each can also be set at the CLI with `--top-n`,
|
|
230
|
+
`--top-n-report`, `--top-n-cli`, and `--top-n-slack`.
|
|
231
|
+
|
|
232
|
+
`report.release_min_age_days` (default `28`, `0` = include all) and the per-org
|
|
233
|
+
`releases_exclude` tune the Releases / Tagging section; they can be overridden
|
|
234
|
+
locally with `--release-min-age-days` and the repeatable `--releases-exclude`.
|
|
235
|
+
|
|
236
|
+
The per-org `exclude` list removes repositories from analysis entirely; they are
|
|
237
|
+
reported as **excluded** (distinct from "not enabled"), so an intentional
|
|
238
|
+
exclusion is visible rather than silently dropped.
|
|
239
|
+
|
|
240
|
+
`slack.channel` is optional. The action's `slack_channel` input (wired to the
|
|
241
|
+
`SLACK_CHANNEL_ID` variable in `reporting.yaml`) overrides it, so the channel
|
|
242
|
+
can live as an org/repo variable rather than in the config JSON. It must be the
|
|
243
|
+
channel **ID** (`C0…`), not the name.
|
|
244
|
+
|
|
245
|
+
### Config file location
|
|
246
|
+
|
|
247
|
+
For local use you can drop the same JSON at a conventional per-user path and run
|
|
248
|
+
with no flags — it is picked up automatically when no `--config`,
|
|
249
|
+
`--config-data`, or `--org` is given (instead of erroring):
|
|
250
|
+
|
|
251
|
+
```text
|
|
252
|
+
$XDG_CONFIG_HOME/github-security-report/config.json
|
|
253
|
+
# or, when XDG_CONFIG_HOME is unset:
|
|
254
|
+
~/.config/github-security-report/config.json
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
An explicit `--config`, `--config-data`, or `--org` always takes precedence, and
|
|
258
|
+
the action itself never reads this path (it is supplied configuration directly).
|
|
259
|
+
Secrets stay out of the file: reference the token by environment-variable name
|
|
260
|
+
via `token_env` (e.g. `SECURITY_REPORT_PAT`, exported in your shell or sourced
|
|
261
|
+
from a secrets file) — the channel ID is the only Slack value the file holds,
|
|
262
|
+
and the Slack **bot token** is consumed by the workflow, not the CLI.
|
|
263
|
+
|
|
264
|
+
## Inputs
|
|
265
|
+
|
|
266
|
+
<!-- markdownlint-disable MD013 -->
|
|
267
|
+
|
|
268
|
+
| Name | Required | Default | Description |
|
|
269
|
+
| ---- | -------- | ------- | ----------- |
|
|
270
|
+
| `scope` | No | `auto` | `auto`, `org`, or `repo` |
|
|
271
|
+
| `config` | No | — | JSON config (raw or base64) |
|
|
272
|
+
| `org` | No | — | Single organisation (shorthand for org mode) |
|
|
273
|
+
| `repo` | No | detected | `owner/name` for repo mode |
|
|
274
|
+
| `token` | No | `${{ github.token }}` | PAT (org mode) or `GITHUB_TOKEN` (repo mode) |
|
|
275
|
+
| `token_env` | No | `GITHUB_TOKEN` | Env var name the tool reads the token from |
|
|
276
|
+
| `output_dir` | No | — | Directory for Pages output (org mode) |
|
|
277
|
+
| `pages_url` | No | — | Published Pages URL (used in the Slack link) |
|
|
278
|
+
| `slack_channel` | No | — | Slack channel ID; overrides the config `slack.channel` (e.g. the `SLACK_CHANNEL_ID` variable) |
|
|
279
|
+
| `top_n` | No | `10` | Offenders per signal across all outputs (shared default) |
|
|
280
|
+
| `top_n_report` | No | — | Offenders per signal in the GitHub Pages output (overrides `top_n`) |
|
|
281
|
+
| `top_n_cli` | No | — | Offenders per signal in the terminal output (overrides `top_n`) |
|
|
282
|
+
| `top_n_slack` | No | — | Offenders per signal in the Slack digest (overrides `top_n`) |
|
|
283
|
+
| `fail_threshold` | No | `none` | `none`/`low`/`medium`/`high`/`critical`/`any` (repo mode) |
|
|
284
|
+
| `force_notify` | No | `false` | Post to Slack regardless of `report_day` |
|
|
285
|
+
| `tool_version` | No | `0.1.0` | Published PyPI version (ignored on pull requests) |
|
|
286
|
+
| `use_local_source` | No | `false` | Run from the checked-out source instead of PyPI (for testing unreleased code from any event) |
|
|
287
|
+
|
|
288
|
+
<!-- markdownlint-enable MD013 -->
|
|
289
|
+
|
|
290
|
+
## Outputs
|
|
291
|
+
|
|
292
|
+
| Name | Description |
|
|
293
|
+
| ---- | ----------- |
|
|
294
|
+
| `should_notify` | Whether today is a Slack notification day |
|
|
295
|
+
| `slack_payload` | Prebuilt Slack `chat.postMessage` payload (JSON) |
|
|
296
|
+
| `failed` | Whether the repo-mode fail threshold was met |
|
|
297
|
+
|
|
298
|
+
## Running locally
|
|
299
|
+
|
|
300
|
+
The tool is published to PyPI and runs with `uvx`. Inside a Git checkout with a
|
|
301
|
+
`GITHUB_TOKEN` exported, it auto-detects the repository (preferring the
|
|
302
|
+
`upstream` remote, then `origin`) and prints a Rich table report:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
export GITHUB_TOKEN=ghp_your_token
|
|
306
|
+
uvx github-security-report report
|
|
307
|
+
|
|
308
|
+
# Or org mode locally with a PAT:
|
|
309
|
+
uvx github-security-report report --org lfreleng-actions
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Development
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
uv sync --extra dev
|
|
316
|
+
uv run pytest
|
|
317
|
+
uv run ruff check src/ tests/
|
|
318
|
+
```
|