vexpath-core 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.
- vexpath_core-0.1.0/.gitignore +46 -0
- vexpath_core-0.1.0/LICENSE +201 -0
- vexpath_core-0.1.0/PKG-INFO +56 -0
- vexpath_core-0.1.0/README.md +30 -0
- vexpath_core-0.1.0/pyproject.toml +54 -0
- vexpath_core-0.1.0/src/vexpath_core/__init__.py +20 -0
- vexpath_core-0.1.0/src/vexpath_core/advisory/__init__.py +37 -0
- vexpath_core-0.1.0/src/vexpath_core/advisory/coverage.py +260 -0
- vexpath_core-0.1.0/src/vexpath_core/advisory/enrich.py +377 -0
- vexpath_core-0.1.0/src/vexpath_core/advisory/osv.py +401 -0
- vexpath_core-0.1.0/src/vexpath_core/advisory/source.py +220 -0
- vexpath_core-0.1.0/src/vexpath_core/advisory/sync.py +294 -0
- vexpath_core-0.1.0/src/vexpath_core/attest.py +630 -0
- vexpath_core-0.1.0/src/vexpath_core/cdxvex.py +342 -0
- vexpath_core-0.1.0/src/vexpath_core/cvss.py +179 -0
- vexpath_core-0.1.0/src/vexpath_core/enums.py +428 -0
- vexpath_core-0.1.0/src/vexpath_core/ids.py +79 -0
- vexpath_core-0.1.0/src/vexpath_core/keyformat.py +56 -0
- vexpath_core-0.1.0/src/vexpath_core/models/__init__.py +67 -0
- vexpath_core-0.1.0/src/vexpath_core/models/advisory.py +295 -0
- vexpath_core-0.1.0/src/vexpath_core/models/common.py +50 -0
- vexpath_core-0.1.0/src/vexpath_core/models/finding.py +198 -0
- vexpath_core-0.1.0/src/vexpath_core/models/results.py +147 -0
- vexpath_core-0.1.0/src/vexpath_core/models/sbom.py +90 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/__init__.py +73 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/extract.py +332 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/fetch.py +432 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/layout.py +282 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/pipeline.py +211 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/references.py +216 -0
- vexpath_core-0.1.0/src/vexpath_core/patchdiff/unidiff.py +190 -0
- vexpath_core-0.1.0/src/vexpath_core/policy.py +435 -0
- vexpath_core-0.1.0/src/vexpath_core/protocols.py +96 -0
- vexpath_core-0.1.0/src/vexpath_core/purl.py +123 -0
- vexpath_core-0.1.0/src/vexpath_core/py.typed +0 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/__init__.py +63 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/archives.py +365 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/astutil.py +55 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/cache.py +230 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/dependencies.py +359 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/entrypoints.py +341 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/graph.py +476 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/pybuild.py +998 -0
- vexpath_core-0.1.0/src/vexpath_core/reach/verdict.py +497 -0
- vexpath_core-0.1.0/src/vexpath_core/report.py +567 -0
- vexpath_core-0.1.0/src/vexpath_core/sbom/__init__.py +106 -0
- vexpath_core-0.1.0/src/vexpath_core/sbom/cyclonedx.py +439 -0
- vexpath_core-0.1.0/src/vexpath_core/sbom/generate.py +306 -0
- vexpath_core-0.1.0/src/vexpath_core/sbom/lockfiles.py +747 -0
- vexpath_core-0.1.0/src/vexpath_core/sbom/minimum_elements.py +104 -0
- vexpath_core-0.1.0/src/vexpath_core/sbom/spdx.py +470 -0
- vexpath_core-0.1.0/src/vexpath_core/scan.py +391 -0
- vexpath_core-0.1.0/src/vexpath_core/snapshot.py +238 -0
- vexpath_core-0.1.0/src/vexpath_core/triage.py +373 -0
- vexpath_core-0.1.0/src/vexpath_core/versions.py +280 -0
- vexpath_core-0.1.0/src/vexpath_core/vex.py +377 -0
- vexpath_core-0.1.0/src/vexpath_core/vulnmatch.py +288 -0
- vexpath_core-0.1.0/tests/test_advisory_sync.py +228 -0
- vexpath_core-0.1.0/tests/test_archives.py +427 -0
- vexpath_core-0.1.0/tests/test_attest.py +409 -0
- vexpath_core-0.1.0/tests/test_benchmark_results.py +136 -0
- vexpath_core-0.1.0/tests/test_cdxvex.py +380 -0
- vexpath_core-0.1.0/tests/test_coverage.py +256 -0
- vexpath_core-0.1.0/tests/test_cvss.py +108 -0
- vexpath_core-0.1.0/tests/test_enrich.py +361 -0
- vexpath_core-0.1.0/tests/test_enums.py +116 -0
- vexpath_core-0.1.0/tests/test_fixture_repos.py +141 -0
- vexpath_core-0.1.0/tests/test_ids.py +46 -0
- vexpath_core-0.1.0/tests/test_lockfiles.py +466 -0
- vexpath_core-0.1.0/tests/test_models.py +293 -0
- vexpath_core-0.1.0/tests/test_osv.py +282 -0
- vexpath_core-0.1.0/tests/test_patchdiff.py +887 -0
- vexpath_core-0.1.0/tests/test_policy.py +400 -0
- vexpath_core-0.1.0/tests/test_purl.py +97 -0
- vexpath_core-0.1.0/tests/test_reach_entrypoints.py +311 -0
- vexpath_core-0.1.0/tests/test_reach_environment.py +406 -0
- vexpath_core-0.1.0/tests/test_reach_fixtures.py +259 -0
- vexpath_core-0.1.0/tests/test_reach_graph.py +260 -0
- vexpath_core-0.1.0/tests/test_reach_pybuild.py +651 -0
- vexpath_core-0.1.0/tests/test_reach_verdict.py +459 -0
- vexpath_core-0.1.0/tests/test_report.py +293 -0
- vexpath_core-0.1.0/tests/test_sbom_documents.py +397 -0
- vexpath_core-0.1.0/tests/test_scan.py +217 -0
- vexpath_core-0.1.0/tests/test_snapshot.py +261 -0
- vexpath_core-0.1.0/tests/test_triage.py +356 -0
- vexpath_core-0.1.0/tests/test_versions.py +268 -0
- vexpath_core-0.1.0/tests/test_vex.py +426 -0
- vexpath_core-0.1.0/tests/test_vulnmatch.py +344 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
|
|
11
|
+
# Tooling caches
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
.ruff_cache/
|
|
15
|
+
.coverage
|
|
16
|
+
.coverage.*
|
|
17
|
+
htmlcov/
|
|
18
|
+
coverage.xml
|
|
19
|
+
|
|
20
|
+
# Local environment
|
|
21
|
+
.env
|
|
22
|
+
.env.local
|
|
23
|
+
*.local.yml
|
|
24
|
+
|
|
25
|
+
# Scan artefacts produced while dogfooding
|
|
26
|
+
/sbom.cdx.json
|
|
27
|
+
/openvex.json
|
|
28
|
+
/cdx-vex.json
|
|
29
|
+
/attestation.intoto.jsonl
|
|
30
|
+
/results.json
|
|
31
|
+
.vexpath-cache/
|
|
32
|
+
|
|
33
|
+
# Advisory snapshots downloaded at runtime (the frozen test snapshot IS committed)
|
|
34
|
+
/var/
|
|
35
|
+
/data/
|
|
36
|
+
|
|
37
|
+
# Editors and OS
|
|
38
|
+
.vscode/
|
|
39
|
+
.idea/
|
|
40
|
+
*.swp
|
|
41
|
+
.DS_Store
|
|
42
|
+
Thumbs.db
|
|
43
|
+
|
|
44
|
+
# Tailwind standalone binary (downloaded by `make tailwind-install`, not committed)
|
|
45
|
+
/bin/tailwindcss
|
|
46
|
+
/bin/tailwindcss.exe
|
|
@@ -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 2026 Akmal Khan
|
|
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,56 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: vexpath-core
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Analysis core: SBOM handling, advisory matching, reachability, VEX, attestation and policy.
|
|
5
|
+
Author: Akmal Khan
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: cel-python>=0.1.5
|
|
10
|
+
Requires-Dist: cryptography>=43.0
|
|
11
|
+
Requires-Dist: cyclonedx-python-lib>=8.0
|
|
12
|
+
Requires-Dist: httpx>=0.28
|
|
13
|
+
Requires-Dist: jsonschema>=4.23
|
|
14
|
+
Requires-Dist: msgpack>=1.1
|
|
15
|
+
Requires-Dist: packageurl-python>=0.16
|
|
16
|
+
Requires-Dist: packaging>=24.0
|
|
17
|
+
Requires-Dist: pydantic>=2.9
|
|
18
|
+
Requires-Dist: pyyaml>=6.0
|
|
19
|
+
Requires-Dist: semver>=3.0
|
|
20
|
+
Requires-Dist: structlog>=24.4
|
|
21
|
+
Provides-Extra: sigstore
|
|
22
|
+
Requires-Dist: sigstore>=3.6; extra == 'sigstore'
|
|
23
|
+
Provides-Extra: spdx
|
|
24
|
+
Requires-Dist: spdx-tools>=0.8; extra == 'spdx'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# vexpath-core
|
|
28
|
+
|
|
29
|
+
The analysis core. Everything that decides a verdict lives here, and nothing here imports a web framework or a database driver.
|
|
30
|
+
|
|
31
|
+
The same code runs in three places: the `vexpath` CLI on a developer machine, the GitHub Action in CI, and the platform's sandboxed workers. That is deliberate (see `docs/adr/0010-local-first-analysis.md`): a verdict must not depend on where it was computed.
|
|
32
|
+
|
|
33
|
+
## Sub-packages
|
|
34
|
+
|
|
35
|
+
| Module | Scope | Milestone |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `models` | Pydantic domain models shared by the CLI, API and database | M0 |
|
|
38
|
+
| `ids` | ULID generation | M0 |
|
|
39
|
+
| `purl` | Package URL construction and ecosystem-aware name normalisation | M0 |
|
|
40
|
+
| `enums` | Every closed vocabulary: verdicts, statuses, confidence, justifications | M0 |
|
|
41
|
+
| `protocols` | Interfaces injected into analysis (advisory source, clock, object store) so the core stays deterministic and offline-testable | M0 |
|
|
42
|
+
| `sbom` | Parse, validate, normalise and generate SBOMs | M1 |
|
|
43
|
+
| `advisory` | Advisory ingest, normalisation, snapshots and local cache | M1 |
|
|
44
|
+
| `vulnmatch` | Version-range matching of components against advisories | M1 |
|
|
45
|
+
| `reach` | Call-graph construction and reachability search | M2 |
|
|
46
|
+
| `vex` | OpenVEX and CycloneDX VEX generation | M3 |
|
|
47
|
+
| `attest` | in-toto statements, DSSE, Sigstore signing and verification | M3 |
|
|
48
|
+
| `policy` | CEL policy evaluation | M3 |
|
|
49
|
+
| `report` | Terminal, Markdown, HTML and SARIF rendering | M1, extended later |
|
|
50
|
+
|
|
51
|
+
## Rules this package follows
|
|
52
|
+
|
|
53
|
+
1. **Deterministic.** Time, network and storage arrive through `protocols`. Given the same inputs and the same advisory snapshot, the output is byte-identical.
|
|
54
|
+
2. **No execution of analysed code.** Parsing only, always.
|
|
55
|
+
3. **Strictly typed.** `mypy --strict` passes with no ignores outside the declared third-party overrides.
|
|
56
|
+
4. **No imports from `apps/`.**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# vexpath-core
|
|
2
|
+
|
|
3
|
+
The analysis core. Everything that decides a verdict lives here, and nothing here imports a web framework or a database driver.
|
|
4
|
+
|
|
5
|
+
The same code runs in three places: the `vexpath` CLI on a developer machine, the GitHub Action in CI, and the platform's sandboxed workers. That is deliberate (see `docs/adr/0010-local-first-analysis.md`): a verdict must not depend on where it was computed.
|
|
6
|
+
|
|
7
|
+
## Sub-packages
|
|
8
|
+
|
|
9
|
+
| Module | Scope | Milestone |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `models` | Pydantic domain models shared by the CLI, API and database | M0 |
|
|
12
|
+
| `ids` | ULID generation | M0 |
|
|
13
|
+
| `purl` | Package URL construction and ecosystem-aware name normalisation | M0 |
|
|
14
|
+
| `enums` | Every closed vocabulary: verdicts, statuses, confidence, justifications | M0 |
|
|
15
|
+
| `protocols` | Interfaces injected into analysis (advisory source, clock, object store) so the core stays deterministic and offline-testable | M0 |
|
|
16
|
+
| `sbom` | Parse, validate, normalise and generate SBOMs | M1 |
|
|
17
|
+
| `advisory` | Advisory ingest, normalisation, snapshots and local cache | M1 |
|
|
18
|
+
| `vulnmatch` | Version-range matching of components against advisories | M1 |
|
|
19
|
+
| `reach` | Call-graph construction and reachability search | M2 |
|
|
20
|
+
| `vex` | OpenVEX and CycloneDX VEX generation | M3 |
|
|
21
|
+
| `attest` | in-toto statements, DSSE, Sigstore signing and verification | M3 |
|
|
22
|
+
| `policy` | CEL policy evaluation | M3 |
|
|
23
|
+
| `report` | Terminal, Markdown, HTML and SARIF rendering | M1, extended later |
|
|
24
|
+
|
|
25
|
+
## Rules this package follows
|
|
26
|
+
|
|
27
|
+
1. **Deterministic.** Time, network and storage arrive through `protocols`. Given the same inputs and the same advisory snapshot, the output is byte-identical.
|
|
28
|
+
2. **No execution of analysed code.** Parsing only, always.
|
|
29
|
+
3. **Strictly typed.** `mypy --strict` passes with no ignores outside the declared third-party overrides.
|
|
30
|
+
4. **No imports from `apps/`.**
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "vexpath-core"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Analysis core: SBOM handling, advisory matching, reachability, VEX, attestation and policy."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
# A copy, not a reference to the root. A parent-directory path lands in
|
|
9
|
+
# the source archive as `<name>-<version>/../../LICENSE`, which is a tar
|
|
10
|
+
# member escaping its own root: newer uv refuses to read it outright, and
|
|
11
|
+
# the archive was malformed regardless of which builder tolerated it. A
|
|
12
|
+
# test asserts every copy is byte-identical to the root LICENSE.
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
authors = [{ name = "Akmal Khan" }]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"pydantic>=2.9",
|
|
17
|
+
"packaging>=24.0",
|
|
18
|
+
"semver>=3.0",
|
|
19
|
+
"packageurl-python>=0.16",
|
|
20
|
+
"pyyaml>=6.0",
|
|
21
|
+
"msgpack>=1.1",
|
|
22
|
+
"httpx>=0.28",
|
|
23
|
+
"structlog>=24.4",
|
|
24
|
+
"cyclonedx-python-lib>=8.0",
|
|
25
|
+
"jsonschema>=4.23",
|
|
26
|
+
# CEL for policy evaluation. A real expression language rather than a
|
|
27
|
+
# bespoke matcher, because a policy is a thing people write and share and
|
|
28
|
+
# a home-grown syntax would have to be learned for one tool only.
|
|
29
|
+
"cel-python>=0.1.5",
|
|
30
|
+
# DSSE signing and verification with a static key. Part of the core rather
|
|
31
|
+
# than an extra, because an attestation nobody can verify offline is one
|
|
32
|
+
# an air-gapped reviewer cannot check at all.
|
|
33
|
+
"cryptography>=43.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
# SPDX support is read-mostly and its library is heavy, so it stays optional
|
|
38
|
+
# until the SPDX writer lands.
|
|
39
|
+
spdx = [
|
|
40
|
+
"spdx-tools>=0.8",
|
|
41
|
+
]
|
|
42
|
+
# Keyless signing. Optional because it only happens in CI, where an ambient
|
|
43
|
+
# OIDC credential exists, and because the library pulls in a large
|
|
44
|
+
# transitive tree that an offline verifier does not need.
|
|
45
|
+
sigstore = [
|
|
46
|
+
"sigstore>=3.6",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[build-system]
|
|
50
|
+
requires = ["hatchling"]
|
|
51
|
+
build-backend = "hatchling.build"
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build.targets.wheel]
|
|
54
|
+
packages = ["src/vexpath_core"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Analysis core for the software supply-chain security platform.
|
|
2
|
+
|
|
3
|
+
This package decides verdicts. It is used unchanged by the CLI, the GitHub
|
|
4
|
+
Action and the platform workers, so that where a scan runs never affects what
|
|
5
|
+
it concludes.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
11
|
+
|
|
12
|
+
try: # pragma: no cover - depends on install mode
|
|
13
|
+
__version__ = version("vexpath-core")
|
|
14
|
+
except PackageNotFoundError: # pragma: no cover - running from a source tree
|
|
15
|
+
__version__ = "0.0.0+unknown"
|
|
16
|
+
|
|
17
|
+
#: Version of the ``vexpath.results`` JSON schema this build emits.
|
|
18
|
+
RESULTS_SCHEMA = "vexpath.results/1"
|
|
19
|
+
|
|
20
|
+
__all__ = ["RESULTS_SCHEMA", "__version__"]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Advisory ingest, normalisation and access.
|
|
2
|
+
|
|
3
|
+
The corpus is the product's factual foundation. Everything here exists to make
|
|
4
|
+
it trustworthy: normalised on the way in so matching cannot silently miss,
|
|
5
|
+
indexed so a scan is fast, and versioned as snapshots so a verdict can be
|
|
6
|
+
re-derived rather than merely believed.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from vexpath_core.advisory.coverage import (
|
|
12
|
+
CoverageReport,
|
|
13
|
+
EcosystemCoverage,
|
|
14
|
+
FixReferenceTier,
|
|
15
|
+
classify_fix_reference,
|
|
16
|
+
measure,
|
|
17
|
+
)
|
|
18
|
+
from vexpath_core.advisory.osv import OsvRecordError, normalise, normalise_all
|
|
19
|
+
from vexpath_core.advisory.source import AdvisorySourceError, OsvApiSource, SnapshotSource
|
|
20
|
+
from vexpath_core.advisory.sync import AdvisorySyncError, SyncReport, sync
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"AdvisorySourceError",
|
|
24
|
+
"AdvisorySyncError",
|
|
25
|
+
"CoverageReport",
|
|
26
|
+
"EcosystemCoverage",
|
|
27
|
+
"FixReferenceTier",
|
|
28
|
+
"OsvApiSource",
|
|
29
|
+
"OsvRecordError",
|
|
30
|
+
"SnapshotSource",
|
|
31
|
+
"SyncReport",
|
|
32
|
+
"classify_fix_reference",
|
|
33
|
+
"measure",
|
|
34
|
+
"normalise",
|
|
35
|
+
"normalise_all",
|
|
36
|
+
"sync",
|
|
37
|
+
]
|