quantumsafe-scan 0.2.0__tar.gz → 0.3.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.
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/PKG-INFO +303 -19
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/README.md +302 -18
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/__init__.py +1 -1
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/callgraph.py +1 -1
- quantumsafe_scan-0.3.0/cli/certchain.py +400 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/cli.py +88 -6
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/dependencies.py +0 -3
- quantumsafe_scan-0.3.0/cli/diff.py +171 -0
- quantumsafe_scan-0.3.0/cli/horizon.py +281 -0
- quantumsafe_scan-0.3.0/cli/origins.py +263 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/recommender.py +29 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/remediation.py +18 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/reporter.py +221 -10
- quantumsafe_scan-0.3.0/cli/tlsscan.py +425 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/pyproject.toml +1 -1
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/quantumsafe_scan.egg-info/PKG-INFO +303 -19
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/quantumsafe_scan.egg-info/SOURCES.txt +13 -1
- quantumsafe_scan-0.3.0/tests/test_certchain.py +423 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_conformance.py +76 -0
- quantumsafe_scan-0.3.0/tests/test_cors.py +123 -0
- quantumsafe_scan-0.3.0/tests/test_diff.py +328 -0
- quantumsafe_scan-0.3.0/tests/test_horizon.py +348 -0
- quantumsafe_scan-0.3.0/tests/test_origins.py +284 -0
- quantumsafe_scan-0.3.0/tests/test_remediation.py +149 -0
- quantumsafe_scan-0.3.0/tests/test_tlsscan.py +436 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/LICENSE +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/reachability.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/scanner.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/scorer.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/cli/taint.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/quantumsafe_scan.egg-info/dependency_links.txt +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/quantumsafe_scan.egg-info/entry_points.txt +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/quantumsafe_scan.egg-info/requires.txt +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/quantumsafe_scan.egg-info/top_level.txt +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/setup.cfg +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_api.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_benchmark.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_callgraph.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_features.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_pqc.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_quantum.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_scanner.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_schema.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_scorer.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_seeded.py +0 -0
- {quantumsafe_scan-0.2.0 → quantumsafe_scan-0.3.0}/tests/test_taint.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quantumsafe-scan
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Scan codebases and dependencies for quantum-vulnerable cryptography and generate a NIST-aligned migration plan (SARIF + CycloneDX CBOM).
|
|
5
5
|
Author: QuantumSafe
|
|
6
6
|
License: MIT
|
|
@@ -37,13 +37,13 @@ Dynamic: license-file
|
|
|
37
37
|
<p>
|
|
38
38
|
<a href="https://pypi.org/project/quantumsafe-scan/"><img src="https://img.shields.io/pypi/v/quantumsafe-scan?style=flat-square&logo=pypi&logoColor=white&color=5b73e8" alt="PyPI version"></a>
|
|
39
39
|
<img src="https://img.shields.io/pypi/pyversions/quantumsafe-scan?style=flat-square&logo=python&logoColor=white" alt="Python versions">
|
|
40
|
-
<a href="https://github.com/Danny-397/Quantum-Safe/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Danny-397/Quantum-Safe/ci.yml?branch=main&style=flat-square&logo=githubactions&logoColor=white&label=CI" alt="CI status"></a>
|
|
41
|
-
<a href="https://github.com/Danny-397/Quantum-Safe/tags"><img src="https://img.shields.io/github/v/tag/Danny-397/Quantum-Safe?style=flat-square&logo=github&label=version&color=5b73e8" alt="Latest version"></a>
|
|
42
|
-
<a href="https://github.com/Danny-397/Quantum-Safe/stargazers"><img src="https://img.shields.io/github/stars/Danny-397/Quantum-Safe?style=flat-square&logo=github" alt="Stars"></a>
|
|
43
|
-
<img src="https://img.shields.io/github/last-commit/Danny-397/Quantum-Safe?style=flat-square&color=555" alt="Last commit">
|
|
44
|
-
<img src="https://img.shields.io/github/license/Danny-397/Quantum-Safe?style=flat-square&color=3fb950" alt="License: MIT">
|
|
40
|
+
<a href="https://github.com/Danny-397/Quantum-Safe-Scan/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Danny-397/Quantum-Safe-Scan/ci.yml?branch=main&style=flat-square&logo=githubactions&logoColor=white&label=CI" alt="CI status"></a>
|
|
41
|
+
<a href="https://github.com/Danny-397/Quantum-Safe-Scan/tags"><img src="https://img.shields.io/github/v/tag/Danny-397/Quantum-Safe-Scan?style=flat-square&logo=github&label=version&color=5b73e8" alt="Latest version"></a>
|
|
42
|
+
<a href="https://github.com/Danny-397/Quantum-Safe-Scan/stargazers"><img src="https://img.shields.io/github/stars/Danny-397/Quantum-Safe-Scan?style=flat-square&logo=github" alt="Stars"></a>
|
|
43
|
+
<img src="https://img.shields.io/github/last-commit/Danny-397/Quantum-Safe-Scan?style=flat-square&color=555" alt="Last commit">
|
|
44
|
+
<img src="https://img.shields.io/github/license/Danny-397/Quantum-Safe-Scan?style=flat-square&color=3fb950" alt="License: MIT">
|
|
45
45
|
<br>
|
|
46
|
-
<img src="https://img.shields.io/badge/tests-
|
|
46
|
+
<img src="https://img.shields.io/badge/tests-545%20passing-3fb950?style=flat-square&logo=pytest&logoColor=white" alt="545 tests passing">
|
|
47
47
|
<img src="https://img.shields.io/badge/benchmark-100%25%20precision-3fb950?style=flat-square" alt="100% precision on benchmark">
|
|
48
48
|
<img src="https://img.shields.io/badge/SARIF%202.1.0-schema--validated-3fb950?style=flat-square" alt="SARIF schema-validated">
|
|
49
49
|
<img src="https://img.shields.io/badge/NIST-FIPS%20203%2F204%2F205-5b73e8?style=flat-square" alt="NIST FIPS 203/204/205">
|
|
@@ -58,7 +58,7 @@ Dynamic: license-file
|
|
|
58
58
|
<a href="https://pypi.org/project/quantumsafe-scan/"><b>Install</b></a> ·
|
|
59
59
|
<a href="docs/WHITEPAPER.md"><b>Documentation</b></a> ·
|
|
60
60
|
<a href="#the-three-layers"><b>How it works</b></a> ·
|
|
61
|
-
<a href="https://github.com/Danny-397/Quantum-Safe/issues"><b>Report a bug</b></a>
|
|
61
|
+
<a href="https://github.com/Danny-397/Quantum-Safe-Scan/issues"><b>Report a bug</b></a>
|
|
62
62
|
|
|
63
63
|
</div>
|
|
64
64
|
|
|
@@ -210,6 +210,239 @@ score = min(100, 15*HIGH + 5*MEDIUM + 1*LOW)
|
|
|
210
210
|
|
|
211
211
|
---
|
|
212
212
|
|
|
213
|
+
## Scanning a live website (`--url`)
|
|
214
|
+
|
|
215
|
+
A website's quantum exposure is not in its source code — it is in the TLS
|
|
216
|
+
handshake, and almost all of it sits in two brief public-key steps:
|
|
217
|
+
|
|
218
|
+
- the **key exchange**, which Shor's algorithm breaks to recover the session
|
|
219
|
+
key. This is harvest-now-decrypt-later: traffic recorded today becomes
|
|
220
|
+
readable when a quantum computer exists, so it is *retroactive* and cannot be
|
|
221
|
+
fixed afterwards.
|
|
222
|
+
- the **certificate signature**, which Shor also breaks — but only to forge
|
|
223
|
+
*future* certificates, and those rotate every ~90 days anyway.
|
|
224
|
+
|
|
225
|
+
Symmetric cryptography is not the problem: Grover's algorithm square-roots a
|
|
226
|
+
brute-force search, so AES-128 drops to ~2⁶⁴ work and AES-256 is comfortable.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
quantumsafe scan --url github.com
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
TLS handshake github.com:443 (140.82.112.4)
|
|
234
|
+
Key exchange : X25519 (classical)
|
|
235
|
+
Protocol : TLSv1.3
|
|
236
|
+
Cipher : TLS_AES_128_GCM_SHA256 (128-bit symmetric)
|
|
237
|
+
Certificate : github.com issued by Sectigo Limited, expires Nov 29 2026
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
| Host | Key exchange | |
|
|
241
|
+
|---|---|---|
|
|
242
|
+
| `cloudflare.com` | `X25519MLKEM768` | post-quantum |
|
|
243
|
+
| `google.com` | `X25519MLKEM768` | post-quantum |
|
|
244
|
+
| `github.com` | `X25519` | classical |
|
|
245
|
+
|
|
246
|
+
**Why this needs a hand-built ClientHello.** In TLS 1.2 the cipher suite named
|
|
247
|
+
the key exchange (`ECDHE_RSA_WITH_AES_128_GCM_SHA256`). TLS 1.3 removed it —
|
|
248
|
+
every modern site reports only `TLS_AES_128_GCM_SHA256`, which says nothing
|
|
249
|
+
about key exchange. The group lives in the `key_share` extension, and Python's
|
|
250
|
+
`ssl` cannot read it: `SSLContext.set_groups` and `SSLObject.group_used` need
|
|
251
|
+
OpenSSL 3.5+ and Python 3.14, and ML-KEM groups need OpenSSL 3.5 at all. On
|
|
252
|
+
OpenSSL 3.0 the most important fact about the connection is invisible.
|
|
253
|
+
|
|
254
|
+
So the scanner speaks the handshake directly: it offers the hybrid groups in
|
|
255
|
+
`supported_groups` but a `key_share` for X25519 only. A server preferring a
|
|
256
|
+
hybrid must then reply with a HelloRetryRequest naming it (RFC 8446 §4.1.3).
|
|
257
|
+
The server states its choice, and no ML-KEM implementation is needed to ask.
|
|
258
|
+
No new dependencies.
|
|
259
|
+
|
|
260
|
+
**What it measures.** The group the server *selects from what we offer* — the
|
|
261
|
+
same answer a browser offering that set would get. Not proof of everything the
|
|
262
|
+
server could support, which is why findings say "negotiated", not "supports".
|
|
263
|
+
|
|
264
|
+
### The whole certificate chain, not just the leaf
|
|
265
|
+
|
|
266
|
+
A chain is only as strong as its weakest signature, and the weak link is
|
|
267
|
+
usually not the server certificate. Real output:
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
Certificate chain (a chain is only as strong as its weakest signature)
|
|
271
|
+
leaf sig=ECDSA with SHA-256 key=EC P-256
|
|
272
|
+
intermediate sig=ECDSA with SHA-384 key=EC P-256
|
|
273
|
+
intermediate sig=SHA-256 with RSA key=EC P-384
|
|
274
|
+
root sig=SHA-1 with RSA key=RSA-2048 (trust-store anchored)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Cloudflare's leaf is modern ECDSA — but an intermediate above it is signed
|
|
278
|
+
**SHA-256 with RSA**. Forging that signature mints a leaf for any name under
|
|
279
|
+
it, and a checker that reads only the server certificate reports "ECDSA,
|
|
280
|
+
modern" and never sees it.
|
|
281
|
+
|
|
282
|
+
Two deliberate distinctions:
|
|
283
|
+
|
|
284
|
+
- **Certificate signatures are a forgery risk, not a retroactive one.** Shor
|
|
285
|
+
breaks them, but that forges *future* certificates — it does not decrypt
|
|
286
|
+
traffic already recorded, and certificates rotate every ~90 days, so this
|
|
287
|
+
largely follows the CA ecosystem's own migration. The key exchange above is
|
|
288
|
+
the urgent one. The findings say so rather than implying equal urgency.
|
|
289
|
+
- **A root's own signature is not a finding.** A root is trusted because it is
|
|
290
|
+
in the client's trust store, not because of its self-signature, so forging
|
|
291
|
+
that signature gains an attacker nothing. Roots are shown for completeness
|
|
292
|
+
and excluded from the score — otherwise every chain carries an unactionable
|
|
293
|
+
HIGH, as the SHA-1 root above would.
|
|
294
|
+
|
|
295
|
+
The signature algorithm and public key are the only two certificate fields
|
|
296
|
+
that matter here, and they are the two `ssl.getpeercert()` does not return.
|
|
297
|
+
Rather than take on `cryptography` as a runtime dependency, the handful of
|
|
298
|
+
fields needed are walked out of the DER directly — a minimal tag-length-value
|
|
299
|
+
reader that parses structure and OIDs and verifies nothing, since `ssl` has
|
|
300
|
+
already validated the chain by the time it arrives.
|
|
301
|
+
|
|
302
|
+
### The origins a page actually depends on (`--origins`)
|
|
303
|
+
|
|
304
|
+
A site can negotiate a hybrid on its own domain and still pull scripts, fonts
|
|
305
|
+
and analytics from a dozen other origins over classical key exchange — and the
|
|
306
|
+
author chose every one of them.
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
quantumsafe scan --url github.com --origins
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
Third-party origins 2 post-quantum, 3 classical of 5 scanned
|
|
314
|
+
github.githubassets.com X25519
|
|
315
|
+
avatars.githubusercontent.com X25519
|
|
316
|
+
github-cloud.s3.amazonaws.com X25519MLKEM768
|
|
317
|
+
user-images.githubusercontent.com X25519
|
|
318
|
+
images.ctfassets.net X25519MLKEM768
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
One aggregate finding, not one per origin — a dozen separate HIGHs for other
|
|
322
|
+
people's servers would bury the findings you can act on. It is MEDIUM rather
|
|
323
|
+
than HIGH when your own key exchange is fine, because a third-party server is
|
|
324
|
+
not yours to fix: the action is to drop the dependency or press the vendor.
|
|
325
|
+
|
|
326
|
+
**A page is attacker-controlled input**, so the SSRF guard runs on every
|
|
327
|
+
*discovered* origin, not once on the entry URL. Anyone can publish markup whose
|
|
328
|
+
script tags point at `169.254.169.254`, and a sweep that followed what it found
|
|
329
|
+
would be an SSRF with extra steps. The page read, the origin count and each
|
|
330
|
+
handshake are all bounded.
|
|
331
|
+
|
|
332
|
+
**Scanning someone else's server.** This is exactly one TLS handshake, which is
|
|
333
|
+
what a browser does on every visit: passive and non-intrusive. It is not port
|
|
334
|
+
scanning or vulnerability probing, and stays that way deliberately. The target
|
|
335
|
+
must resolve *entirely* to public addresses on port 443/8443, and the
|
|
336
|
+
connection goes to the address that was checked — private ranges, loopback,
|
|
337
|
+
link-local (including cloud metadata at `169.254.169.254`), carrier-grade NAT
|
|
338
|
+
and IPv4-mapped IPv6 forms of all of those are refused.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Scan diffing: a ratchet for CI
|
|
343
|
+
|
|
344
|
+
A single scan is a snapshot, and a snapshot is a poor gate. A repository with
|
|
345
|
+
forty known findings cannot adopt `--fail-on-high` without failing every build
|
|
346
|
+
from day one — so in practice the check gets removed and nothing is enforced.
|
|
347
|
+
What a team *can* adopt is a ratchet: tolerate the backlog, fail only when it
|
|
348
|
+
grows.
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
quantumsafe scan --path . --output baseline.json # once, committed
|
|
352
|
+
quantumsafe scan --path . --baseline baseline.json --fail-on-new
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
Since baseline REGRESSED
|
|
357
|
+
0 fixed 2 new 19 unchanged score 100 -> 100 (+0)
|
|
358
|
+
NEW newly_added.py:1 DSA [HIGH]
|
|
359
|
+
NEW newly_added.py:2 DSA [HIGH]
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
| | exit code |
|
|
363
|
+
|---|---|
|
|
364
|
+
| regression, `--fail-on-new` | **1** |
|
|
365
|
+
| no regression, `--fail-on-new` | **0** — the 19-finding backlog is tolerated |
|
|
366
|
+
| same scan, `--fail-on-high` | **1** — fails on the backlog |
|
|
367
|
+
|
|
368
|
+
Note `score 100 -> 100 (+0)` above. The risk score caps at 100, so a codebase
|
|
369
|
+
already at the cap can acquire new HIGH findings with the number unmoved. The
|
|
370
|
+
verdict is therefore driven by new findings, never by the score delta — a
|
|
371
|
+
score-driven gate would have waved that DSA file straight through.
|
|
372
|
+
|
|
373
|
+
**Findings are identified without their line number.** Line numbers move when
|
|
374
|
+
an import is added or a file is reformatted, and keying on them turns a no-op
|
|
375
|
+
edit into one "fixed" plus one "new". A diff that cries wolf gets ignored,
|
|
376
|
+
which is worse than no diff. Identity is `(file_path, family, algorithm)`, and
|
|
377
|
+
because several findings of one kind can share a key, counts are tracked per
|
|
378
|
+
key: three RSA call sites in a file becoming five is two new findings.
|
|
379
|
+
|
|
380
|
+
**What a diff cannot tell you**, and says so in its output: a finding that is
|
|
381
|
+
gone was not necessarily fixed — the file may have been deleted, excluded or
|
|
382
|
+
renamed, and a rename appears as one fixed plus one new.
|
|
383
|
+
|
|
384
|
+
Two saved scans can also be compared through the dashboard:
|
|
385
|
+
|
|
386
|
+
```http
|
|
387
|
+
GET /api/v1/scans/{id}/diff?against={other_id} (JWT)
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Both scans are looked up scoped to the caller, so one account cannot diff
|
|
391
|
+
against another's history; omit `against` to compare with the previous scan.
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Migration horizon (Mosca's inequality)
|
|
396
|
+
|
|
397
|
+
The risk score says *how much* vulnerable cryptography you have. It cannot say
|
|
398
|
+
whether you will finish migrating in time, which is the question the threat
|
|
399
|
+
model actually poses. One RSA key exchange protecting data that must stay
|
|
400
|
+
secret for fifty years is worse than forty MD5 checksums.
|
|
401
|
+
|
|
402
|
+
Michele Mosca's formulation:
|
|
403
|
+
|
|
404
|
+
```
|
|
405
|
+
X how long the data must stay confidential
|
|
406
|
+
Y how long the migration takes
|
|
407
|
+
Z how long until a quantum computer can break it
|
|
408
|
+
|
|
409
|
+
X + Y > Z -> data sent today is already exposed
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The reason is harvest-now-decrypt-later: an adversary records ciphertext today
|
|
413
|
+
and decrypts it when Z arrives. Migration has to *finish* by `Z - X`, not at Z.
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
quantumsafe scan --path . --secrecy-years 10 --crqc-years 12
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
Migration horizon (Mosca's inequality)
|
|
421
|
+
Data must stay confidential (X) : 10 years
|
|
422
|
+
Estimated migration (Y) : 2.77-8.66 years
|
|
423
|
+
Assumed quantum threat (Z) : 12 years
|
|
424
|
+
Break-even year : 2038-2044
|
|
425
|
+
ALREADY LATE Already too late: even on the optimistic estimate, data sent
|
|
426
|
+
today that must stay confidential for this long will still be sensitive when
|
|
427
|
+
the migration finishes.
|
|
428
|
+
Design changes needed : dsa, ecc, rsa
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
**What this will not claim.** Z is unknowable, so there is no default for it —
|
|
432
|
+
`--crqc-years` is yours to choose, and omitting it gives no verdict rather than
|
|
433
|
+
a guess. What is always computed is the **break-even year**: the latest a
|
|
434
|
+
quantum computer could arrive while still leaving time to migrate. That is a
|
|
435
|
+
property of your code and your data, not a forecast.
|
|
436
|
+
|
|
437
|
+
Y is an engineering estimate, so it is reported as a range, counted per
|
|
438
|
+
cryptographic *family* rather than per call site (five hundred RSA call sites
|
|
439
|
+
are not five hundred migrations), and every coefficient is printed in the JSON
|
|
440
|
+
report under `horizon.assumptions` so you can disagree with a specific number
|
|
441
|
+
rather than with the whole figure. Replace them with measurements from your own
|
|
442
|
+
migration if you have them — that is strictly better.
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
213
446
|
## Evaluation (does the detector actually work?)
|
|
214
447
|
|
|
215
448
|
The scanner is measured against a labeled [benchmark](benchmark/) of 18 files
|
|
@@ -412,12 +645,18 @@ quantumsafe version
|
|
|
412
645
|
|------|-------------|
|
|
413
646
|
| `--path` | Local directory or file to scan |
|
|
414
647
|
| `--repo` | Public `https://github.com/<org>/<repo>` URL |
|
|
648
|
+
| `--url` | Live HTTPS host — scans the TLS handshake and certificate chain |
|
|
649
|
+
| `--origins` | With `--url`, also scan every third-party origin the page loads from |
|
|
415
650
|
| `--output` | Write to `.json`, `.cbom.json` (CycloneDX CBOM), `.html`, `.sarif`, or `.svg` (risk badge); terminal summary still printed |
|
|
416
651
|
| `--exclude` | Glob of paths to skip (repeatable) |
|
|
417
652
|
| `--taint` | Also run interprocedural data-flow analysis (Python): flag quantum-vulnerable crypto reached through wrapper functions, **across files** (whole-program call graph with import resolution), not just direct calls |
|
|
418
653
|
| `--no-deps` | Skip dependency scanning (on by default): parses manifests **and lockfiles** (`requirements.txt`, `pyproject.toml`, `package.json`, `go.mod`, `pom.xml`, `Gemfile`, `package-lock.json`, `poetry.lock`, `Pipfile.lock`, `Gemfile.lock`, `yarn.lock`, `go.sum`) and flags known quantum-vulnerable crypto libraries (with purl + direct/transitive scope) in the CBOM |
|
|
419
654
|
| `--no-rank` | Skip reachability ranking (on by default): labels each source finding `reachable` / `test-example` / `unreferenced` so exploitable findings sort above dead or example code |
|
|
420
655
|
| `--fail-on-high` | Exit non-zero on any HIGH finding (CI gate) |
|
|
656
|
+
| `--baseline` | Compare against a saved JSON report: fixed / new / unchanged |
|
|
657
|
+
| `--fail-on-new` | With `--baseline`, exit non-zero only on NEW findings (the ratchet) |
|
|
658
|
+
| `--secrecy-years` | How long the data must stay confidential — enables the migration horizon |
|
|
659
|
+
| `--crqc-years` | The quantum-threat year you want to reason about (no default: nobody knows it) |
|
|
421
660
|
| `--no-sync` | Don't upload the result to your linked dashboard |
|
|
422
661
|
|
|
423
662
|
After `quantumsafe auth --key <key> --api-url <your-api>`, every `quantumsafe scan`
|
|
@@ -429,17 +668,53 @@ line.
|
|
|
429
668
|
|
|
430
669
|
### Use in CI (GitHub Action)
|
|
431
670
|
|
|
671
|
+
Drop this in `.github/workflows/quantumsafe.yml`. Findings land in the repo's
|
|
672
|
+
**Security → Code scanning** tab, annotated on the exact file and line.
|
|
673
|
+
|
|
432
674
|
```yaml
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
675
|
+
name: QuantumSafe
|
|
676
|
+
|
|
677
|
+
on: [push, pull_request]
|
|
678
|
+
|
|
679
|
+
permissions:
|
|
680
|
+
contents: read
|
|
681
|
+
security-events: write # required for upload-sarif
|
|
682
|
+
|
|
683
|
+
jobs:
|
|
684
|
+
quantumsafe:
|
|
685
|
+
runs-on: ubuntu-latest
|
|
686
|
+
steps:
|
|
687
|
+
- uses: actions/checkout@v4
|
|
688
|
+
|
|
689
|
+
- uses: Danny-397/Quantum-Safe-Scan@main
|
|
690
|
+
with:
|
|
691
|
+
path: .
|
|
692
|
+
exclude: tests/*,vendor/*
|
|
693
|
+
fail-on-high: "true" # fail the build on any HIGH finding
|
|
694
|
+
|
|
695
|
+
# Or ratchet instead of gating on absolutes: tolerate the existing
|
|
696
|
+
# backlog and fail only when it grows. A missing baseline warns and
|
|
697
|
+
# skips the comparison, so the first run still works.
|
|
698
|
+
# baseline: quantumsafe-baseline.json
|
|
699
|
+
# fail-on-new: "true"
|
|
700
|
+
|
|
701
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
702
|
+
with:
|
|
703
|
+
sarif_file: quantumsafe.sarif
|
|
704
|
+
category: quantumsafe
|
|
441
705
|
```
|
|
442
706
|
|
|
707
|
+
| Input | Default | Meaning |
|
|
708
|
+
|---|---|---|
|
|
709
|
+
| `path` | `.` | Directory to scan |
|
|
710
|
+
| `output` | `quantumsafe.sarif` | Where to write the SARIF report |
|
|
711
|
+
| `exclude` | *(none)* | Comma-separated globs to skip |
|
|
712
|
+
| `fail-on-high` | `"false"` | Exit non-zero if any HIGH finding is present |
|
|
713
|
+
| `version` | *(latest)* | Pin `quantumsafe-scan`, e.g. `0.2.0` |
|
|
714
|
+
|
|
715
|
+
Pin to a released tag rather than `@main` once one exists — `@main` moves under
|
|
716
|
+
you, which is the same class of problem as an unpinned linter.
|
|
717
|
+
|
|
443
718
|
---
|
|
444
719
|
|
|
445
720
|
## API documentation
|
|
@@ -472,10 +747,19 @@ POST /api/v1/scan/import (X-API-Key) # used by the CLI to upload result
|
|
|
472
747
|
POST /api/v1/demo-scan (public, rate-limited) # landing-page live demo
|
|
473
748
|
{ "code": "..." } -> { report } # runs the real engine, stores nothing
|
|
474
749
|
|
|
750
|
+
POST /api/v1/scan-url (public, 10/hour) # live TLS endpoint scan
|
|
751
|
+
{ "url": "example.com" } -> { report } # one handshake, stores nothing
|
|
752
|
+
|
|
753
|
+
POST /api/v1/horizon (public, 120/hour) # Mosca's inequality
|
|
754
|
+
{ "findings": [{"family": "rsa"}], "secrecy_years": 10 } -> { horizon }
|
|
755
|
+
# only the family is read; the dashboard fetches Y once and moves its
|
|
756
|
+
# sliders locally, since X + Y > Z is arithmetic
|
|
757
|
+
|
|
475
758
|
GET /api/v1/scans?page=1&per_page=20 (JWT) -> paginated list
|
|
476
759
|
GET /api/v1/scans/{id} (JWT) -> scan + findings
|
|
477
760
|
GET /api/v1/scans/{id}/export?format=json|html|csv|sarif|cbom|svg (JWT)
|
|
478
761
|
GET /api/v1/scans/{id}/migration (JWT) -> grouped migration plan
|
|
762
|
+
GET /api/v1/scans/{id}/diff?against={id} (JWT) -> fixed / new / unchanged
|
|
479
763
|
GET /api/v1/overview (JWT) -> dashboard stats + trend
|
|
480
764
|
```
|
|
481
765
|
|
|
@@ -527,7 +811,7 @@ window.QUANTUMSAFE_API = "https://quantumsafe-api.onrender.com";
|
|
|
527
811
|
Requires Python 3.9+.
|
|
528
812
|
|
|
529
813
|
```bash
|
|
530
|
-
git clone https://github.com/Danny-397/Quantum-Safe
|
|
814
|
+
git clone https://github.com/Danny-397/Quantum-Safe-Scan
|
|
531
815
|
cd Quantum-Safe
|
|
532
816
|
|
|
533
817
|
# 1) Install the shared scanner package (CLI) in editable mode
|
|
@@ -559,7 +843,7 @@ docker compose up --build
|
|
|
559
843
|
|
|
560
844
|
```bash
|
|
561
845
|
pip install -r requirements-dev.txt
|
|
562
|
-
pytest -q #
|
|
846
|
+
pytest -q # 545 tests; in-memory DB, no setup
|
|
563
847
|
```
|
|
564
848
|
|
|
565
849
|
Seed a demo account so the dashboard is populated:
|
|
@@ -594,7 +878,7 @@ See [`.env.example`](.env.example).
|
|
|
594
878
|
|
|
595
879
|
## Deployment
|
|
596
880
|
|
|
597
|
-
[](https://render.com/deploy?repo=https://github.com/Danny-397/Quantum-Safe)
|
|
881
|
+
[](https://render.com/deploy?repo=https://github.com/Danny-397/Quantum-Safe-Scan)
|
|
598
882
|
|
|
599
883
|
See **[DEPLOYMENT.md](DEPLOYMENT.md)** for the full walkthrough. In short:
|
|
600
884
|
|