craevidence 3.6.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 (134) hide show
  1. craevidence-3.6.0/LICENSE +21 -0
  2. craevidence-3.6.0/PKG-INFO +246 -0
  3. craevidence-3.6.0/README.md +206 -0
  4. craevidence-3.6.0/cra_evidence_cli/__init__.py +10 -0
  5. craevidence-3.6.0/cra_evidence_cli/__main__.py +8 -0
  6. craevidence-3.6.0/cra_evidence_cli/assessment/__init__.py +7 -0
  7. craevidence-3.6.0/cra_evidence_cli/assessment/config.py +217 -0
  8. craevidence-3.6.0/cra_evidence_cli/assessment/detect.py +62 -0
  9. craevidence-3.6.0/cra_evidence_cli/assessment/gate.py +183 -0
  10. craevidence-3.6.0/cra_evidence_cli/assessment/matrix.py +292 -0
  11. craevidence-3.6.0/cra_evidence_cli/assessment/requirements.py +133 -0
  12. craevidence-3.6.0/cra_evidence_cli/assessment/select.py +93 -0
  13. craevidence-3.6.0/cra_evidence_cli/assessment/templates/consumer-iot.yaml +95 -0
  14. craevidence-3.6.0/cra_evidence_cli/assessment/templates/library-sdk.yaml +126 -0
  15. craevidence-3.6.0/cra_evidence_cli/assessment/templates/microcontroller.yaml +124 -0
  16. craevidence-3.6.0/cra_evidence_cli/assessment/templates/operating-system.yaml +122 -0
  17. craevidence-3.6.0/cra_evidence_cli/assessment/templates/router-gateway.yaml +115 -0
  18. craevidence-3.6.0/cra_evidence_cli/assessment/templates/saas-service.yaml +122 -0
  19. craevidence-3.6.0/cra_evidence_cli/assessment/templates/vpn.yaml +118 -0
  20. craevidence-3.6.0/cra_evidence_cli/assessment/templates.py +338 -0
  21. craevidence-3.6.0/cra_evidence_cli/ci_detect.py +330 -0
  22. craevidence-3.6.0/cra_evidence_cli/cli.py +201 -0
  23. craevidence-3.6.0/cra_evidence_cli/client.py +1912 -0
  24. craevidence-3.6.0/cra_evidence_cli/commands/__init__.py +25 -0
  25. craevidence-3.6.0/cra_evidence_cli/commands/assessment.py +298 -0
  26. craevidence-3.6.0/cra_evidence_cli/commands/check.py +690 -0
  27. craevidence-3.6.0/cra_evidence_cli/commands/compare.py +176 -0
  28. craevidence-3.6.0/cra_evidence_cli/commands/components.py +170 -0
  29. craevidence-3.6.0/cra_evidence_cli/commands/config_check.py +170 -0
  30. craevidence-3.6.0/cra_evidence_cli/commands/db.py +228 -0
  31. craevidence-3.6.0/cra_evidence_cli/commands/diagram.py +215 -0
  32. craevidence-3.6.0/cra_evidence_cli/commands/distributor.py +546 -0
  33. craevidence-3.6.0/cra_evidence_cli/commands/draft.py +897 -0
  34. craevidence-3.6.0/cra_evidence_cli/commands/egress.py +287 -0
  35. craevidence-3.6.0/cra_evidence_cli/commands/eol.py +264 -0
  36. craevidence-3.6.0/cra_evidence_cli/commands/evidence.py +436 -0
  37. craevidence-3.6.0/cra_evidence_cli/commands/export.py +118 -0
  38. craevidence-3.6.0/cra_evidence_cli/commands/gemara.py +968 -0
  39. craevidence-3.6.0/cra_evidence_cli/commands/maturity.py +112 -0
  40. craevidence-3.6.0/cra_evidence_cli/commands/profile.py +532 -0
  41. craevidence-3.6.0/cra_evidence_cli/commands/release.py +117 -0
  42. craevidence-3.6.0/cra_evidence_cli/commands/scan.py +278 -0
  43. craevidence-3.6.0/cra_evidence_cli/commands/secrets.py +198 -0
  44. craevidence-3.6.0/cra_evidence_cli/commands/status.py +568 -0
  45. craevidence-3.6.0/cra_evidence_cli/commands/upload.py +2372 -0
  46. craevidence-3.6.0/cra_evidence_cli/commands/validate.py +84 -0
  47. craevidence-3.6.0/cra_evidence_cli/commands/verify.py +243 -0
  48. craevidence-3.6.0/cra_evidence_cli/config.py +248 -0
  49. craevidence-3.6.0/cra_evidence_cli/display.py +105 -0
  50. craevidence-3.6.0/cra_evidence_cli/evidence_checker/__init__.py +5 -0
  51. craevidence-3.6.0/cra_evidence_cli/evidence_checker/engine.py +507 -0
  52. craevidence-3.6.0/cra_evidence_cli/exceptions.py +162 -0
  53. craevidence-3.6.0/cra_evidence_cli/ikconfig.py +33 -0
  54. craevidence-3.6.0/cra_evidence_cli/local/__init__.py +2 -0
  55. craevidence-3.6.0/cra_evidence_cli/local/annotations.py +203 -0
  56. craevidence-3.6.0/cra_evidence_cli/local/config_audit.py +268 -0
  57. craevidence-3.6.0/cra_evidence_cli/local/csaf.py +175 -0
  58. craevidence-3.6.0/cra_evidence_cli/local/dbcache.py +64 -0
  59. craevidence-3.6.0/cra_evidence_cli/local/disclaimer.py +24 -0
  60. craevidence-3.6.0/cra_evidence_cli/local/egress.py +476 -0
  61. craevidence-3.6.0/cra_evidence_cli/local/enrich.py +96 -0
  62. craevidence-3.6.0/cra_evidence_cli/local/eol.py +339 -0
  63. craevidence-3.6.0/cra_evidence_cli/local/mermaid.py +524 -0
  64. craevidence-3.6.0/cra_evidence_cli/local/models.py +184 -0
  65. craevidence-3.6.0/cra_evidence_cli/local/osv.py +331 -0
  66. craevidence-3.6.0/cra_evidence_cli/local/policy.py +258 -0
  67. craevidence-3.6.0/cra_evidence_cli/local/report.py +384 -0
  68. craevidence-3.6.0/cra_evidence_cli/local/sbom.py +83 -0
  69. craevidence-3.6.0/cra_evidence_cli/local/scanner.py +204 -0
  70. craevidence-3.6.0/cra_evidence_cli/local/secrets.py +372 -0
  71. craevidence-3.6.0/cra_evidence_cli/local/securitytxt.py +225 -0
  72. craevidence-3.6.0/cra_evidence_cli/local/signal.py +132 -0
  73. craevidence-3.6.0/cra_evidence_cli/local/vex.py +382 -0
  74. craevidence-3.6.0/cra_evidence_cli/repo_config.py +417 -0
  75. craevidence-3.6.0/cra_evidence_cli/sbom_generator.py +411 -0
  76. craevidence-3.6.0/cra_evidence_cli/sbom_signer.py +216 -0
  77. craevidence-3.6.0/cra_evidence_cli/sbomqs_check.py +153 -0
  78. craevidence-3.6.0/cra_evidence_cli/styles.py +56 -0
  79. craevidence-3.6.0/craevidence.egg-info/PKG-INFO +246 -0
  80. craevidence-3.6.0/craevidence.egg-info/SOURCES.txt +132 -0
  81. craevidence-3.6.0/craevidence.egg-info/dependency_links.txt +1 -0
  82. craevidence-3.6.0/craevidence.egg-info/entry_points.txt +2 -0
  83. craevidence-3.6.0/craevidence.egg-info/requires.txt +16 -0
  84. craevidence-3.6.0/craevidence.egg-info/top_level.txt +1 -0
  85. craevidence-3.6.0/pyproject.toml +97 -0
  86. craevidence-3.6.0/setup.cfg +4 -0
  87. craevidence-3.6.0/tests/test_assessment.py +447 -0
  88. craevidence-3.6.0/tests/test_check_multi_output.py +184 -0
  89. craevidence-3.6.0/tests/test_ci_detect.py +493 -0
  90. craevidence-3.6.0/tests/test_ci_wrappers.py +76 -0
  91. craevidence-3.6.0/tests/test_client.py +510 -0
  92. craevidence-3.6.0/tests/test_client_retry.py +209 -0
  93. craevidence-3.6.0/tests/test_compare_command.py +168 -0
  94. craevidence-3.6.0/tests/test_components_command.py +214 -0
  95. craevidence-3.6.0/tests/test_config.py +247 -0
  96. craevidence-3.6.0/tests/test_config_check_command.py +126 -0
  97. craevidence-3.6.0/tests/test_csaf_schema.py +92 -0
  98. craevidence-3.6.0/tests/test_db_update.py +227 -0
  99. craevidence-3.6.0/tests/test_diagram_command.py +223 -0
  100. craevidence-3.6.0/tests/test_disclaimer.py +57 -0
  101. craevidence-3.6.0/tests/test_doc_type_parity.py +51 -0
  102. craevidence-3.6.0/tests/test_draft_command.py +748 -0
  103. craevidence-3.6.0/tests/test_draft_scaffolds.py +230 -0
  104. craevidence-3.6.0/tests/test_draft_threat_diagram.py +96 -0
  105. craevidence-3.6.0/tests/test_egress_command.py +321 -0
  106. craevidence-3.6.0/tests/test_eol_command.py +469 -0
  107. craevidence-3.6.0/tests/test_evidence_checker.py +154 -0
  108. craevidence-3.6.0/tests/test_evidence_command.py +163 -0
  109. craevidence-3.6.0/tests/test_exceptions.py +291 -0
  110. craevidence-3.6.0/tests/test_gemara_template_offline.py +146 -0
  111. craevidence-3.6.0/tests/test_local_annotations.py +219 -0
  112. craevidence-3.6.0/tests/test_local_check.py +909 -0
  113. craevidence-3.6.0/tests/test_local_config_audit.py +160 -0
  114. craevidence-3.6.0/tests/test_local_egress.py +202 -0
  115. craevidence-3.6.0/tests/test_local_eol.py +356 -0
  116. craevidence-3.6.0/tests/test_local_mermaid.py +364 -0
  117. craevidence-3.6.0/tests/test_local_policy.py +164 -0
  118. craevidence-3.6.0/tests/test_local_secrets.py +212 -0
  119. craevidence-3.6.0/tests/test_local_securitytxt.py +171 -0
  120. craevidence-3.6.0/tests/test_local_vex.py +486 -0
  121. craevidence-3.6.0/tests/test_osv_fallback.py +292 -0
  122. craevidence-3.6.0/tests/test_output_parent.py +57 -0
  123. craevidence-3.6.0/tests/test_release_command.py +142 -0
  124. craevidence-3.6.0/tests/test_repo_config.py +445 -0
  125. craevidence-3.6.0/tests/test_report.py +274 -0
  126. craevidence-3.6.0/tests/test_sarif_command.py +114 -0
  127. craevidence-3.6.0/tests/test_sbom_signer.py +68 -0
  128. craevidence-3.6.0/tests/test_sbomqs_check.py +160 -0
  129. craevidence-3.6.0/tests/test_scan_command.py +334 -0
  130. craevidence-3.6.0/tests/test_secrets_command.py +172 -0
  131. craevidence-3.6.0/tests/test_status_command.py +537 -0
  132. craevidence-3.6.0/tests/test_upload_command.py +2401 -0
  133. craevidence-3.6.0/tests/test_upload_defaults.py +189 -0
  134. craevidence-3.6.0/tests/test_upload_hbom_csv.py +93 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CRA Evidence
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.4
2
+ Name: craevidence
3
+ Version: 3.6.0
4
+ Summary: CLI tool for CI/CD integration with CRA Evidence
5
+ Author-email: CRA Evidence <support@craevidence.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://craevidence.com
8
+ Project-URL: Documentation, https://docs.craevidence.com/cli
9
+ Project-URL: Repository, https://github.com/craevidence/cli
10
+ Project-URL: Bug Tracker, https://github.com/craevidence/cli/issues
11
+ Project-URL: Changelog, https://github.com/craevidence/cli/blob/main/CHANGELOG.md
12
+ Keywords: sbom,cra,cybersecurity,compliance,cicd
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: Security
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.1.0
25
+ Requires-Dist: httpx>=0.27.0
26
+ Requires-Dist: pyyaml>=6.0
27
+ Requires-Dist: rich>=13.0.0
28
+ Requires-Dist: pydantic>=2.0.0
29
+ Requires-Dist: sigstore<5.0.0,>=4.0.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
33
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
34
+ Requires-Dist: black>=23.0; extra == "dev"
35
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
36
+ Requires-Dist: mypy>=1.0; extra == "dev"
37
+ Requires-Dist: types-PyYAML; extra == "dev"
38
+ Requires-Dist: jsonschema[format]>=4.18; extra == "dev"
39
+ Dynamic: license-file
40
+
41
+ # CRA Evidence CLI
42
+
43
+ [![CI](https://github.com/craevidence/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/craevidence/cli/actions/workflows/ci.yml)
44
+ [![License: MIT](https://img.shields.io/github/license/craevidence/cli)](https://github.com/craevidence/cli/blob/main/LICENSE)
45
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](https://github.com/craevidence/cli/blob/main/docs/installation.md)
46
+ [![Docker pulls](https://img.shields.io/docker/pulls/craevidence/cli)](https://hub.docker.com/r/craevidence/cli)
47
+
48
+ Command-line tools for CRA Evidence workflows and local software supply-chain checks.
49
+
50
+ ![craevidence check scans an SBOM and gates CI on known-exploited vulnerabilities](https://raw.githubusercontent.com/craevidence/cli/main/docs/demo.gif)
51
+
52
+ The CLI has two modes:
53
+
54
+ - Local commands that run without a CRA Evidence account or API key.
55
+ - Account commands that upload evidence or read release state from CRA Evidence.
56
+
57
+ This page covers the public command basics. The full reference lives in
58
+ [docs/](https://github.com/craevidence/cli/blob/main/docs/README.md).
59
+ Registered CRA Evidence users can also sign in to view the command
60
+ documentation at https://docs.craevidence.com/cli.
61
+
62
+ The local checks are review aids and CI gates. They are not an audit, and
63
+ exit 0 does not prove compliance.
64
+
65
+ ## Install
66
+
67
+ ```bash
68
+ pip install craevidence
69
+ pipx install craevidence
70
+ ```
71
+
72
+ `pipx` is a good fit for command-line tools because it installs the package in
73
+ an isolated environment.
74
+
75
+ The installed command is:
76
+
77
+ ```bash
78
+ craevidence --help
79
+ ```
80
+
81
+ Python 3.12 or newer is required. Docker images and other install options are
82
+ covered in the [installation guide](https://github.com/craevidence/cli/blob/main/docs/installation.md).
83
+
84
+ ## Documentation
85
+
86
+ | Page | Contents |
87
+ |---|---|
88
+ | [Local commands](https://github.com/craevidence/cli/blob/main/docs/local-commands.md) | `check`, `eol-check`, `egress-check`, `secrets-check`, `config-check`, `draft`, `assessment`, `db`, and the offline template scaffold. |
89
+ | [Account commands](https://github.com/craevidence/cli/blob/main/docs/account-commands.md) | Uploads, scan, status, release lifecycle, distributor, profiles, validation, and verification. |
90
+ | [CI/CD integration](https://github.com/craevidence/cli/blob/main/docs/ci-cd.md) | GitHub Action, GitLab Component, Docker, Jenkins, OpenSSF Scorecard, and complyctl. |
91
+ | [Installation](https://github.com/craevidence/cli/blob/main/docs/installation.md) | PyPI, Docker, container registries, and from source. |
92
+ | [Troubleshooting](https://github.com/craevidence/cli/blob/main/docs/troubleshooting.md) | Common errors and fixes. |
93
+
94
+ ## Local Check
95
+
96
+ `craevidence check` scans a directory, container image, or existing SBOM and
97
+ reports known vulnerability signals that can block CI when a threshold is met.
98
+ It does not require an account and does not upload your project to CRA Evidence.
99
+
100
+ ```bash
101
+ craevidence check .
102
+ craevidence check --image ghcr.io/acme/app:1.4.2
103
+ craevidence check --sbom sbom.cdx.json
104
+ craevidence check . --fail-on known-exploited
105
+ ```
106
+
107
+ By default, `check` uses network data sources. It uses Grype when installed
108
+ and working, falls back to OSV.dev when Grype is absent or fails, and consults
109
+ CISA KEV plus FIRST EPSS for enrichment. For a network-restricted run, provide
110
+ an SBOM with `--sbom` and run where Grype has a local database; CISA KEV and
111
+ FIRST EPSS enrichment are reported as unavailable if they cannot be reached.
112
+
113
+ Verbose output includes a section named **What this local snapshot cannot tell
114
+ you**. The JSON output keeps the same review context in machine-readable form.
115
+
116
+ ## Free Commands
117
+
118
+ These commands do not need `CRA_EVIDENCE_API_KEY`:
119
+
120
+ | Command | Purpose |
121
+ |---|---|
122
+ | `check` | Scan a directory, image, or SBOM and gate CI with `--fail-on`. |
123
+ | `eol-check` | Flag end-of-life and support status from local SBOM components. |
124
+ | `egress-check` | Inventory external interfaces and data-egress indicators. |
125
+ | `secrets-check` | Scan the working tree for candidate hard-coded secrets. |
126
+ | `config-check` | Audit Dockerfile, Terraform, and Kubernetes files for insecure defaults. |
127
+ | `draft` | Scaffold VEX, security.txt, advisory, risk-assessment, and threat-model drafts for review. |
128
+ | `compliance-as-code template --offline` | Create starter YAML from local input without an API key. |
129
+ | `assessment` | Scaffold an Annex I applicability matrix and gate CI on structured gaps. |
130
+ | `db update` / `db status` | Manage and inspect the local Grype vulnerability database cache. |
131
+
132
+ ## CI Examples
133
+
134
+ GitHub Actions:
135
+
136
+ ```yaml
137
+ jobs:
138
+ cra-check:
139
+ runs-on: ubuntu-latest
140
+ steps:
141
+ - uses: actions/checkout@v4
142
+ - run: pipx install craevidence
143
+ - run: craevidence check . --fail-on known-exploited
144
+ ```
145
+
146
+ GitLab CI:
147
+
148
+ ```yaml
149
+ cra-check:
150
+ image: python:3.12-slim
151
+ script:
152
+ - pip install craevidence
153
+ - craevidence check . --fail-on known-exploited
154
+ ```
155
+
156
+ ## Account Commands
157
+
158
+ Commands that upload evidence or read CRA Evidence release state need an API key:
159
+
160
+ ```bash
161
+ export CRA_EVIDENCE_API_KEY=...
162
+ craevidence upload-sbom --product my-product --version 1.0.0 --file sbom.cdx.json
163
+ craevidence status --product my-product --version 1.0.0
164
+ ```
165
+
166
+ The default API URL is:
167
+
168
+ ```text
169
+ https://api.craevidence.com
170
+ ```
171
+
172
+ You can override it with:
173
+
174
+ ```bash
175
+ export CRA_EVIDENCE_URL=https://api.craevidence.com
176
+ ```
177
+
178
+ ## Environment Variables
179
+
180
+ | Variable | Purpose |
181
+ |---|---|
182
+ | `CRA_EVIDENCE_API_KEY` | API key for account commands. |
183
+ | `CRA_EVIDENCE_URL` | CRA Evidence API URL. Defaults to `https://api.craevidence.com`. |
184
+ | `CRA_EVIDENCE_ORG` | Default organization slug. |
185
+ | `CRA_EVIDENCE_PRODUCT` | Default product slug for upload commands. |
186
+ | `CRA_EVIDENCE_VERSION` | Default product version for upload commands. |
187
+ | `CRA_EVIDENCE_COMPONENT` | Default component slug for component-aware uploads. |
188
+ | `CRA_EVIDENCE_COMPONENT_VERSION` | Default component release version. |
189
+ | `CRA_EVIDENCE_TIMEOUT` | HTTP request timeout in seconds for account commands. Defaults to `60`. |
190
+ | `CRA_NO_WARN` | Set to any value to suppress API URL configuration warnings. |
191
+
192
+ Credentials can also be stored in `~/.cra-evidence/config.yaml`. Keep that file
193
+ private, for example with `chmod 600 ~/.cra-evidence/config.yaml`.
194
+
195
+ ## Exit Codes
196
+
197
+ | Code | Meaning |
198
+ |---|---|
199
+ | 0 | Success. For local gates, no configured blocking finding was present in this local snapshot. |
200
+ | 1 | General error. |
201
+ | 2 | Authentication error. |
202
+ | 3 | API error. |
203
+ | 4 | Validation error. |
204
+ | 5 | File not found. |
205
+ | 6 | Configuration error. |
206
+ | 7 | security.txt validation failed. |
207
+ | 10 | Critical vulnerabilities found. |
208
+ | 11 | High vulnerabilities found. |
209
+ | 12 | Medium vulnerabilities found. |
210
+ | 13 | Low vulnerabilities found. |
211
+ | 14 | SBOM quality score below the configured threshold. |
212
+ | 15 | Local scan engine unavailable. |
213
+ | 16 | License policy threshold exceeded. |
214
+ | 17 | Known-exploited vulnerabilities found. |
215
+ | 18 | Candidate secrets found. |
216
+ | 19 | Insecure-default config findings found. |
217
+ | 20 | CRA status is not ready when a status gate is enabled. |
218
+ | 21 | Structured evidence mapping was required but was not populated. |
219
+ | 22 | SBOM signature trust was required but verification was not trusted. |
220
+ | 23 | SBOM signing failed or no Sigstore OIDC identity was available. |
221
+ | 24 | CRA legal floor is met but the configured release policy is not. |
222
+ | 25 | Mandatory Annex I requirement is not addressed. |
223
+ | 26 | Annex I Part I(2) requirement is marked not-applicable without a justification. |
224
+
225
+ Exit 0 != compliance. Local output is a snapshot for review and CI policy, not
226
+ a legal conclusion.
227
+
228
+ ## Data Sources
229
+
230
+ | Source | Use |
231
+ |---|---|
232
+ | FIRST EPSS | Exploit-probability enrichment. |
233
+ | CISA KEV | Known-exploited vulnerability enrichment. |
234
+ | OSV.dev | Open source vulnerability data when the OSV path is used. |
235
+ | Anchore Grype | Local vulnerability matching when installed. |
236
+ | Anchore Syft | SBOM generation from directories and images when installed or included in the Docker image. |
237
+ | endoflife.date | End-of-life and support-cycle data for `eol-check`. |
238
+
239
+ ## Support
240
+
241
+ - Website: https://craevidence.com
242
+ - Email: support@craevidence.com
243
+
244
+ ## License
245
+
246
+ MIT License. See the package license file for details.
@@ -0,0 +1,206 @@
1
+ # CRA Evidence CLI
2
+
3
+ [![CI](https://github.com/craevidence/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/craevidence/cli/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/github/license/craevidence/cli)](https://github.com/craevidence/cli/blob/main/LICENSE)
5
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](https://github.com/craevidence/cli/blob/main/docs/installation.md)
6
+ [![Docker pulls](https://img.shields.io/docker/pulls/craevidence/cli)](https://hub.docker.com/r/craevidence/cli)
7
+
8
+ Command-line tools for CRA Evidence workflows and local software supply-chain checks.
9
+
10
+ ![craevidence check scans an SBOM and gates CI on known-exploited vulnerabilities](https://raw.githubusercontent.com/craevidence/cli/main/docs/demo.gif)
11
+
12
+ The CLI has two modes:
13
+
14
+ - Local commands that run without a CRA Evidence account or API key.
15
+ - Account commands that upload evidence or read release state from CRA Evidence.
16
+
17
+ This page covers the public command basics. The full reference lives in
18
+ [docs/](https://github.com/craevidence/cli/blob/main/docs/README.md).
19
+ Registered CRA Evidence users can also sign in to view the command
20
+ documentation at https://docs.craevidence.com/cli.
21
+
22
+ The local checks are review aids and CI gates. They are not an audit, and
23
+ exit 0 does not prove compliance.
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ pip install craevidence
29
+ pipx install craevidence
30
+ ```
31
+
32
+ `pipx` is a good fit for command-line tools because it installs the package in
33
+ an isolated environment.
34
+
35
+ The installed command is:
36
+
37
+ ```bash
38
+ craevidence --help
39
+ ```
40
+
41
+ Python 3.12 or newer is required. Docker images and other install options are
42
+ covered in the [installation guide](https://github.com/craevidence/cli/blob/main/docs/installation.md).
43
+
44
+ ## Documentation
45
+
46
+ | Page | Contents |
47
+ |---|---|
48
+ | [Local commands](https://github.com/craevidence/cli/blob/main/docs/local-commands.md) | `check`, `eol-check`, `egress-check`, `secrets-check`, `config-check`, `draft`, `assessment`, `db`, and the offline template scaffold. |
49
+ | [Account commands](https://github.com/craevidence/cli/blob/main/docs/account-commands.md) | Uploads, scan, status, release lifecycle, distributor, profiles, validation, and verification. |
50
+ | [CI/CD integration](https://github.com/craevidence/cli/blob/main/docs/ci-cd.md) | GitHub Action, GitLab Component, Docker, Jenkins, OpenSSF Scorecard, and complyctl. |
51
+ | [Installation](https://github.com/craevidence/cli/blob/main/docs/installation.md) | PyPI, Docker, container registries, and from source. |
52
+ | [Troubleshooting](https://github.com/craevidence/cli/blob/main/docs/troubleshooting.md) | Common errors and fixes. |
53
+
54
+ ## Local Check
55
+
56
+ `craevidence check` scans a directory, container image, or existing SBOM and
57
+ reports known vulnerability signals that can block CI when a threshold is met.
58
+ It does not require an account and does not upload your project to CRA Evidence.
59
+
60
+ ```bash
61
+ craevidence check .
62
+ craevidence check --image ghcr.io/acme/app:1.4.2
63
+ craevidence check --sbom sbom.cdx.json
64
+ craevidence check . --fail-on known-exploited
65
+ ```
66
+
67
+ By default, `check` uses network data sources. It uses Grype when installed
68
+ and working, falls back to OSV.dev when Grype is absent or fails, and consults
69
+ CISA KEV plus FIRST EPSS for enrichment. For a network-restricted run, provide
70
+ an SBOM with `--sbom` and run where Grype has a local database; CISA KEV and
71
+ FIRST EPSS enrichment are reported as unavailable if they cannot be reached.
72
+
73
+ Verbose output includes a section named **What this local snapshot cannot tell
74
+ you**. The JSON output keeps the same review context in machine-readable form.
75
+
76
+ ## Free Commands
77
+
78
+ These commands do not need `CRA_EVIDENCE_API_KEY`:
79
+
80
+ | Command | Purpose |
81
+ |---|---|
82
+ | `check` | Scan a directory, image, or SBOM and gate CI with `--fail-on`. |
83
+ | `eol-check` | Flag end-of-life and support status from local SBOM components. |
84
+ | `egress-check` | Inventory external interfaces and data-egress indicators. |
85
+ | `secrets-check` | Scan the working tree for candidate hard-coded secrets. |
86
+ | `config-check` | Audit Dockerfile, Terraform, and Kubernetes files for insecure defaults. |
87
+ | `draft` | Scaffold VEX, security.txt, advisory, risk-assessment, and threat-model drafts for review. |
88
+ | `compliance-as-code template --offline` | Create starter YAML from local input without an API key. |
89
+ | `assessment` | Scaffold an Annex I applicability matrix and gate CI on structured gaps. |
90
+ | `db update` / `db status` | Manage and inspect the local Grype vulnerability database cache. |
91
+
92
+ ## CI Examples
93
+
94
+ GitHub Actions:
95
+
96
+ ```yaml
97
+ jobs:
98
+ cra-check:
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+ - run: pipx install craevidence
103
+ - run: craevidence check . --fail-on known-exploited
104
+ ```
105
+
106
+ GitLab CI:
107
+
108
+ ```yaml
109
+ cra-check:
110
+ image: python:3.12-slim
111
+ script:
112
+ - pip install craevidence
113
+ - craevidence check . --fail-on known-exploited
114
+ ```
115
+
116
+ ## Account Commands
117
+
118
+ Commands that upload evidence or read CRA Evidence release state need an API key:
119
+
120
+ ```bash
121
+ export CRA_EVIDENCE_API_KEY=...
122
+ craevidence upload-sbom --product my-product --version 1.0.0 --file sbom.cdx.json
123
+ craevidence status --product my-product --version 1.0.0
124
+ ```
125
+
126
+ The default API URL is:
127
+
128
+ ```text
129
+ https://api.craevidence.com
130
+ ```
131
+
132
+ You can override it with:
133
+
134
+ ```bash
135
+ export CRA_EVIDENCE_URL=https://api.craevidence.com
136
+ ```
137
+
138
+ ## Environment Variables
139
+
140
+ | Variable | Purpose |
141
+ |---|---|
142
+ | `CRA_EVIDENCE_API_KEY` | API key for account commands. |
143
+ | `CRA_EVIDENCE_URL` | CRA Evidence API URL. Defaults to `https://api.craevidence.com`. |
144
+ | `CRA_EVIDENCE_ORG` | Default organization slug. |
145
+ | `CRA_EVIDENCE_PRODUCT` | Default product slug for upload commands. |
146
+ | `CRA_EVIDENCE_VERSION` | Default product version for upload commands. |
147
+ | `CRA_EVIDENCE_COMPONENT` | Default component slug for component-aware uploads. |
148
+ | `CRA_EVIDENCE_COMPONENT_VERSION` | Default component release version. |
149
+ | `CRA_EVIDENCE_TIMEOUT` | HTTP request timeout in seconds for account commands. Defaults to `60`. |
150
+ | `CRA_NO_WARN` | Set to any value to suppress API URL configuration warnings. |
151
+
152
+ Credentials can also be stored in `~/.cra-evidence/config.yaml`. Keep that file
153
+ private, for example with `chmod 600 ~/.cra-evidence/config.yaml`.
154
+
155
+ ## Exit Codes
156
+
157
+ | Code | Meaning |
158
+ |---|---|
159
+ | 0 | Success. For local gates, no configured blocking finding was present in this local snapshot. |
160
+ | 1 | General error. |
161
+ | 2 | Authentication error. |
162
+ | 3 | API error. |
163
+ | 4 | Validation error. |
164
+ | 5 | File not found. |
165
+ | 6 | Configuration error. |
166
+ | 7 | security.txt validation failed. |
167
+ | 10 | Critical vulnerabilities found. |
168
+ | 11 | High vulnerabilities found. |
169
+ | 12 | Medium vulnerabilities found. |
170
+ | 13 | Low vulnerabilities found. |
171
+ | 14 | SBOM quality score below the configured threshold. |
172
+ | 15 | Local scan engine unavailable. |
173
+ | 16 | License policy threshold exceeded. |
174
+ | 17 | Known-exploited vulnerabilities found. |
175
+ | 18 | Candidate secrets found. |
176
+ | 19 | Insecure-default config findings found. |
177
+ | 20 | CRA status is not ready when a status gate is enabled. |
178
+ | 21 | Structured evidence mapping was required but was not populated. |
179
+ | 22 | SBOM signature trust was required but verification was not trusted. |
180
+ | 23 | SBOM signing failed or no Sigstore OIDC identity was available. |
181
+ | 24 | CRA legal floor is met but the configured release policy is not. |
182
+ | 25 | Mandatory Annex I requirement is not addressed. |
183
+ | 26 | Annex I Part I(2) requirement is marked not-applicable without a justification. |
184
+
185
+ Exit 0 != compliance. Local output is a snapshot for review and CI policy, not
186
+ a legal conclusion.
187
+
188
+ ## Data Sources
189
+
190
+ | Source | Use |
191
+ |---|---|
192
+ | FIRST EPSS | Exploit-probability enrichment. |
193
+ | CISA KEV | Known-exploited vulnerability enrichment. |
194
+ | OSV.dev | Open source vulnerability data when the OSV path is used. |
195
+ | Anchore Grype | Local vulnerability matching when installed. |
196
+ | Anchore Syft | SBOM generation from directories and images when installed or included in the Docker image. |
197
+ | endoflife.date | End-of-life and support-cycle data for `eol-check`. |
198
+
199
+ ## Support
200
+
201
+ - Website: https://craevidence.com
202
+ - Email: support@craevidence.com
203
+
204
+ ## License
205
+
206
+ MIT License. See the package license file for details.
@@ -0,0 +1,10 @@
1
+ """
2
+ CRA Evidence CLI - Command-line tool for CI/CD integration with CRA Evidence.
3
+
4
+ This package provides tools for uploading SBOMs, HBOMs, and VEX documents
5
+ to CRA Evidence as part of EU Cyber Resilience Act compliance workflows.
6
+ """
7
+
8
+ __version__ = "3.6.0"
9
+ __author__ = "CRA Evidence"
10
+ __email__ = "support@craevidence.com"
@@ -0,0 +1,8 @@
1
+ """
2
+ Entry point for running the CLI as a module: python -m cra_evidence_cli
3
+ """
4
+
5
+ from cra_evidence_cli.cli import main
6
+
7
+ if __name__ == "__main__":
8
+ main()
@@ -0,0 +1,7 @@
1
+ """Local CRA Annex I assessment applicability: canonical requirements, the
2
+ versioned matrix file, starter templates, and the CI gate.
3
+
4
+ Everything here runs client-side with no API key and never contacts a server.
5
+ The matrix is a starter the developer completes; passing the gate does not by
6
+ itself establish conformity.
7
+ """