post-quantum-check 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.
Files changed (40) hide show
  1. post_quantum_check-0.1.0/.gitignore +42 -0
  2. post_quantum_check-0.1.0/CHANGELOG.md +19 -0
  3. post_quantum_check-0.1.0/CODE_OF_CONDUCT.md +41 -0
  4. post_quantum_check-0.1.0/CONTRIBUTING.md +32 -0
  5. post_quantum_check-0.1.0/LICENSE +21 -0
  6. post_quantum_check-0.1.0/PKG-INFO +132 -0
  7. post_quantum_check-0.1.0/README.md +92 -0
  8. post_quantum_check-0.1.0/SECURITY.md +27 -0
  9. post_quantum_check-0.1.0/post_quantum_check/__init__.py +108 -0
  10. post_quantum_check-0.1.0/post_quantum_check/__main__.py +6 -0
  11. post_quantum_check-0.1.0/post_quantum_check/audit.py +82 -0
  12. post_quantum_check-0.1.0/post_quantum_check/auditors/__init__.py +41 -0
  13. post_quantum_check-0.1.0/post_quantum_check/auditors/codebase.py +879 -0
  14. post_quantum_check-0.1.0/post_quantum_check/auditors/ssh.py +619 -0
  15. post_quantum_check-0.1.0/post_quantum_check/auditors/system.py +630 -0
  16. post_quantum_check-0.1.0/post_quantum_check/auditors/tls.py +609 -0
  17. post_quantum_check-0.1.0/post_quantum_check/cli.py +431 -0
  18. post_quantum_check-0.1.0/post_quantum_check/models.py +247 -0
  19. post_quantum_check-0.1.0/post_quantum_check/policy.py +268 -0
  20. post_quantum_check-0.1.0/post_quantum_check/reporters/__init__.py +51 -0
  21. post_quantum_check-0.1.0/post_quantum_check/reporters/cyclonedx.py +134 -0
  22. post_quantum_check-0.1.0/post_quantum_check/reporters/json_reporter.py +10 -0
  23. post_quantum_check-0.1.0/post_quantum_check/reporters/markdown.py +97 -0
  24. post_quantum_check-0.1.0/post_quantum_check/reporters/sarif.py +107 -0
  25. post_quantum_check-0.1.0/post_quantum_check/reporters/terminal.py +118 -0
  26. post_quantum_check-0.1.0/post_quantum_check/ssh_keygen.py +206 -0
  27. post_quantum_check-0.1.0/pyproject.toml +124 -0
  28. post_quantum_check-0.1.0/scripts/post-quantum-check.ps1 +80 -0
  29. post_quantum_check-0.1.0/scripts/post-quantum-check.sh +86 -0
  30. post_quantum_check-0.1.0/scripts/ssh-upgrade-linux.sh +69 -0
  31. post_quantum_check-0.1.0/scripts/ssh-upgrade-macos.sh +68 -0
  32. post_quantum_check-0.1.0/scripts/ssh-upgrade-windows.ps1 +55 -0
  33. post_quantum_check-0.1.0/tests/integration/test_cli_e2e.py +182 -0
  34. post_quantum_check-0.1.0/tests/unit/test_codebase_auditor.py +159 -0
  35. post_quantum_check-0.1.0/tests/unit/test_invariants.py +179 -0
  36. post_quantum_check-0.1.0/tests/unit/test_models_and_policy.py +165 -0
  37. post_quantum_check-0.1.0/tests/unit/test_reporters.py +230 -0
  38. post_quantum_check-0.1.0/tests/unit/test_ssh_and_keygen.py +294 -0
  39. post_quantum_check-0.1.0/tests/unit/test_system_auditor.py +179 -0
  40. post_quantum_check-0.1.0/tests/unit/test_tls_auditor.py +241 -0
@@ -0,0 +1,42 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ .venv/
7
+ venv/
8
+ dist/
9
+ build/
10
+ .mypy_cache/
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .coverage
14
+ coverage.xml
15
+ htmlcov/
16
+
17
+ # Node.js / JS package
18
+ node_modules/
19
+ packages/js/dist/
20
+ packages/js/coverage/
21
+ packages/js/node_modules/
22
+
23
+ # Docs build
24
+ site/
25
+
26
+ # Secrets & local artifacts
27
+ .env
28
+ .env.*
29
+ *.pem
30
+ *.key
31
+ *.p12
32
+ *.pfx
33
+ *.p8
34
+ *.jks
35
+ *.crt
36
+ *.der
37
+ *.sarif
38
+ cbom.json
39
+
40
+ # OS
41
+ .DS_Store
42
+ Thumbs.db
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to Post-Quantum Check (`post-quantum-check`) are documented in this file.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.0] - 2026-12-03
8
+
9
+ ### Added
10
+
11
+ - Core models (`Finding`, `CryptoAsset`, `AuditReport`), secret redaction utilities, and policy engine supporting `hybrid` (default) and strict `cnsa2` profiles.
12
+ - Local system and runtime auditor (`post-quantum-check system`) covering OpenSSL 3.5+, OpenSSH 10.0+, Python `ssl` and `cryptography`, Node.js 24.7+/26, and Go 1.24+.
13
+ - Live TLS endpoint auditor (`post-quantum-check tls`) checking TLS 1.3, hybrid `X25519MLKEM768` / `SecP384r1MLKEM1024`, and `TLS_AES_256_GCM_SHA384` via OpenSSL 3.5+ with stdlib fallback.
14
+ - SSH key, config, and RFC 4253 remote KEXINIT auditor (`post-quantum-check ssh`), dry-run-first cross-OS SSH keygen helper (`post-quantum-check ssh-keygen`), and standalone macOS, Linux, and Windows PowerShell scripts under `scripts/`.
15
+ - Static codebase, reverse-proxy config, and dependency manifest CBOM scanner (`post-quantum-check scan`) covering `pyproject.toml`, `requirements*.txt`, `package.json`, `go.mod`, `Cargo.toml`, `pom.xml`, and `Dockerfile` with `.pqcignore` and inline suppression support.
16
+ - Five deterministic report renderers: Terminal (ANSI and `--no-color`), JSON, Markdown, CycloneDX 1.6 CBOM JSON, and SARIF 2.1.0 for GitHub Code Scanning.
17
+ - Combined `post-quantum-check audit` command, non-root multi-stage `Dockerfile`, and reusable composite GitHub Action (`action.yml`).
18
+ - Zero-dependency Node.js and TypeScript CLI package (`packages/js/`) with full command and reporter parity tested across Node 22, 24, and 26.
19
+ - MkDocs Material documentation site with migration playbooks and permanent architecture invariant tests.
@@ -0,0 +1,41 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ - Trolling, insulting or derogatory comments, and personal or political attacks
23
+ - Public or private harassment
24
+ - Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they consider inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers through GitHub security advisories or direct maintainer contact. All complaints will be reviewed and investigated promptly and fairly.
38
+
39
+ ## Attribution
40
+
41
+ This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
@@ -0,0 +1,32 @@
1
+ # Contributing to Post-Quantum Check
2
+
3
+ Thank you for contributing to `post-quantum-check`. Every change should preserve zero runtime dependencies in core packages, strict static typing, secret redaction, and clear documentation.
4
+
5
+ ## Development setup
6
+
7
+ ```bash
8
+ python3 -m venv .venv
9
+ source .venv/bin/activate
10
+ pip install -e ".[dev,docs]"
11
+ ```
12
+
13
+ ## Verification before opening a pull request
14
+
15
+ Run all local checks before pushing:
16
+
17
+ ```bash
18
+ ruff check .
19
+ black --check .
20
+ isort --check .
21
+ mypy post_quantum_check/ tests/
22
+ bandit -r post_quantum_check/ -ll
23
+ pytest --cov=post_quantum_check
24
+ mkdocs build --strict
25
+ ```
26
+
27
+ ## Pull request guidelines
28
+
29
+ - Link every pull request to a tracked GitHub issue (`Closes #<number>`).
30
+ - Keep changes focused and add unit tests maintaining at least 90% coverage.
31
+ - Never include real private keys, certificates, or production credentials in tests or fixtures.
32
+ - Update documentation under `docs/` whenever CLI commands, policy profiles, or reporters change.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wesley Kambale
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,132 @@
1
+ Metadata-Version: 2.5
2
+ Name: post-quantum-check
3
+ Version: 0.1.0
4
+ Summary: Post-Quantum Check: readiness auditor, CBOM generator, and hybrid migration toolkit for ML-KEM, ML-DSA, AES-256-GCM, and X25519MLKEM768
5
+ Project-URL: Homepage, https://wkambale.github.io/post-quantum-check/
6
+ Project-URL: Repository, https://github.com/wkambale/post-quantum-check
7
+ Project-URL: Documentation, https://wkambale.github.io/post-quantum-check/
8
+ Project-URL: Changelog, https://github.com/wkambale/post-quantum-check/blob/main/CHANGELOG.md
9
+ Author: Wesley Kambale
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: aes-256-gcm,audit,cbom,cnsa-2,ml-dsa,ml-kem,post-quantum,pqc,security,ssh,tls,x25519mlkem768
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: 3.15
22
+ Classifier: Topic :: Security :: Cryptography
23
+ Requires-Python: >=3.12
24
+ Provides-Extra: dev
25
+ Requires-Dist: bandit>=1.8.0; extra == 'dev'
26
+ Requires-Dist: black>=25.1.0; extra == 'dev'
27
+ Requires-Dist: build<2,>=1.2.0; extra == 'dev'
28
+ Requires-Dist: isort>=6.0.0; extra == 'dev'
29
+ Requires-Dist: mypy>=1.14.0; extra == 'dev'
30
+ Requires-Dist: pip-audit<3,>=2.8.0; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
32
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.9.0; extra == 'dev'
34
+ Provides-Extra: docs
35
+ Requires-Dist: mkdocs-material<10,>=9.6.0; extra == 'docs'
36
+ Provides-Extra: release
37
+ Requires-Dist: build<2,>=1.2.0; extra == 'release'
38
+ Requires-Dist: twine<8,>=6; extra == 'release'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # Post-Quantum Check (`post-quantum-check`)
42
+
43
+ Post-Quantum Check (`post-quantum-check`) is a zero-dependency post-quantum cryptography readiness auditor, Cryptographic Bill of Materials (CBOM) generator, and hybrid migration toolkit for developers and platform teams.
44
+
45
+ It prepares systems, TLS endpoints, SSH infrastructure, and repositories for NIST FIPS 203 (**ML-KEM**), NIST FIPS 204 (**ML-DSA**), and FIPS 197 (**AES-256-GCM**), maintaining hybrid **X25519 + ML-KEM** (`X25519MLKEM768` for TLS 1.3 and `mlkem768x25519-sha256` for OpenSSH) by default for zero-breakage transition, with an opt-in strict **NSA CNSA 2.0** profile (`--profile cnsa2`).
46
+
47
+ Documentation: [https://wkambale.github.io/post-quantum-check/](https://wkambale.github.io/post-quantum-check/)
48
+
49
+ ## Design principles
50
+
51
+ - **Audit first, remediate explicitly**: Core audit commands (`system`, `tls`, `ssh`, `scan`, `audit`) are strictly read-only. Key generation (`ssh-keygen`) runs in dry-run mode by default and refuses to overwrite existing keys without `--force`.
52
+ - **Zero runtime dependencies**: Both the Python package (`post-quantum-check`, Python 3.12+) and the Node.js/TypeScript package (`packages/js/`, Node.js 22+) require zero third-party runtime dependencies.
53
+ - **Hybrid by default, CNSA 2.0 on demand**: Eliminates harvest-now, decrypt-later (HNDL) risk immediately with `X25519MLKEM768` and `mlkem768x25519-sha256` while preserving classical peer interoperability.
54
+ - **No secret leakage**: PEM private keys, passphrases, and secret-bearing metadata fields are redacted automatically before any report or log is emitted.
55
+
56
+ ## Choose your installation method
57
+
58
+ ### Python CLI (Python 3.12+)
59
+
60
+ ```bash
61
+ pip install post-quantum-check
62
+ post-quantum-check audit . --hosts api.example.com --format terminal
63
+ ```
64
+
65
+ ### Node.js / TypeScript CLI (Node.js 22+)
66
+
67
+ ```bash
68
+ npx post-quantum-check audit . --hosts api.example.com --format terminal
69
+ ```
70
+
71
+ ### Standalone OS scripts (zero install)
72
+
73
+ ```bash
74
+ # macOS and Linux
75
+ bash scripts/post-quantum-check.sh --hosts api.example.com
76
+ bash scripts/ssh-upgrade-macos.sh
77
+ bash scripts/ssh-upgrade-linux.sh
78
+ ```
79
+
80
+ ```powershell
81
+ # Windows PowerShell
82
+ pwsh -File scripts/post-quantum-check.ps1 -Hosts api.example.com
83
+ pwsh -File scripts/ssh-upgrade-windows.ps1
84
+ ```
85
+
86
+ ### Docker container (GitHub Packages)
87
+
88
+ ```bash
89
+ docker run --rm -v "$PWD:/workspace:ro" ghcr.io/wkambale/post-quantum-check:0.1.0 scan /workspace --format markdown
90
+ ```
91
+
92
+ ### Reusable GitHub Action
93
+
94
+ ```yaml
95
+ - name: Run Post-Quantum Check
96
+ uses: wkambale/post-quantum-check@v0.1.0
97
+ with:
98
+ command: scan
99
+ path: .
100
+ profile: hybrid
101
+ format: sarif
102
+ output: pqc-report.sarif
103
+ fail-on: high
104
+ ```
105
+
106
+ ## Core commands
107
+
108
+ | Command | Purpose |
109
+ | --- | --- |
110
+ | `post-quantum-check policy` | Display active `hybrid` or `cnsa2` baseline and CNSA 2.0 milestones |
111
+ | `post-quantum-check system` | Audit local OpenSSL, OpenSSH, Python, Node.js, and Go runtimes |
112
+ | `post-quantum-check tls <host...>` | Probe live TLS endpoints for TLS 1.3, `X25519MLKEM768`, and `AES-256-GCM` |
113
+ | `post-quantum-check ssh` | Audit `~/.ssh` public keys, SSH configs, and optional remote SSH host KEX |
114
+ | `post-quantum-check ssh-keygen` | Plan or create hybrid `mldsa44-ed25519` or `ed25519` SSH keys across OSes |
115
+ | `post-quantum-check scan [path]` | Statically scan code, reverse-proxy configs, and manifests for CBOM |
116
+ | `post-quantum-check audit [path]` | Run combined audit across system, SSH, codebase, and optional TLS hosts |
117
+
118
+ All audit commands support `--profile hybrid|cnsa2`, `--format terminal|text|json|markdown|cyclonedx|sarif`, `--output <file>`, `--no-color`, and `--fail-on low|medium|high|critical`.
119
+
120
+ ## Programmatic usage (Python)
121
+
122
+ ```python
123
+ from post_quantum_check import Profile, render_cyclonedx, run_audit
124
+
125
+ report = run_audit(path=".", profile=Profile.HYBRID, include_ssh=False)
126
+ cbom_json = render_cyclonedx(report)
127
+ print(report.readiness_score())
128
+ ```
129
+
130
+ ## License
131
+
132
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,92 @@
1
+ # Post-Quantum Check (`post-quantum-check`)
2
+
3
+ Post-Quantum Check (`post-quantum-check`) is a zero-dependency post-quantum cryptography readiness auditor, Cryptographic Bill of Materials (CBOM) generator, and hybrid migration toolkit for developers and platform teams.
4
+
5
+ It prepares systems, TLS endpoints, SSH infrastructure, and repositories for NIST FIPS 203 (**ML-KEM**), NIST FIPS 204 (**ML-DSA**), and FIPS 197 (**AES-256-GCM**), maintaining hybrid **X25519 + ML-KEM** (`X25519MLKEM768` for TLS 1.3 and `mlkem768x25519-sha256` for OpenSSH) by default for zero-breakage transition, with an opt-in strict **NSA CNSA 2.0** profile (`--profile cnsa2`).
6
+
7
+ Documentation: [https://wkambale.github.io/post-quantum-check/](https://wkambale.github.io/post-quantum-check/)
8
+
9
+ ## Design principles
10
+
11
+ - **Audit first, remediate explicitly**: Core audit commands (`system`, `tls`, `ssh`, `scan`, `audit`) are strictly read-only. Key generation (`ssh-keygen`) runs in dry-run mode by default and refuses to overwrite existing keys without `--force`.
12
+ - **Zero runtime dependencies**: Both the Python package (`post-quantum-check`, Python 3.12+) and the Node.js/TypeScript package (`packages/js/`, Node.js 22+) require zero third-party runtime dependencies.
13
+ - **Hybrid by default, CNSA 2.0 on demand**: Eliminates harvest-now, decrypt-later (HNDL) risk immediately with `X25519MLKEM768` and `mlkem768x25519-sha256` while preserving classical peer interoperability.
14
+ - **No secret leakage**: PEM private keys, passphrases, and secret-bearing metadata fields are redacted automatically before any report or log is emitted.
15
+
16
+ ## Choose your installation method
17
+
18
+ ### Python CLI (Python 3.12+)
19
+
20
+ ```bash
21
+ pip install post-quantum-check
22
+ post-quantum-check audit . --hosts api.example.com --format terminal
23
+ ```
24
+
25
+ ### Node.js / TypeScript CLI (Node.js 22+)
26
+
27
+ ```bash
28
+ npx post-quantum-check audit . --hosts api.example.com --format terminal
29
+ ```
30
+
31
+ ### Standalone OS scripts (zero install)
32
+
33
+ ```bash
34
+ # macOS and Linux
35
+ bash scripts/post-quantum-check.sh --hosts api.example.com
36
+ bash scripts/ssh-upgrade-macos.sh
37
+ bash scripts/ssh-upgrade-linux.sh
38
+ ```
39
+
40
+ ```powershell
41
+ # Windows PowerShell
42
+ pwsh -File scripts/post-quantum-check.ps1 -Hosts api.example.com
43
+ pwsh -File scripts/ssh-upgrade-windows.ps1
44
+ ```
45
+
46
+ ### Docker container (GitHub Packages)
47
+
48
+ ```bash
49
+ docker run --rm -v "$PWD:/workspace:ro" ghcr.io/wkambale/post-quantum-check:0.1.0 scan /workspace --format markdown
50
+ ```
51
+
52
+ ### Reusable GitHub Action
53
+
54
+ ```yaml
55
+ - name: Run Post-Quantum Check
56
+ uses: wkambale/post-quantum-check@v0.1.0
57
+ with:
58
+ command: scan
59
+ path: .
60
+ profile: hybrid
61
+ format: sarif
62
+ output: pqc-report.sarif
63
+ fail-on: high
64
+ ```
65
+
66
+ ## Core commands
67
+
68
+ | Command | Purpose |
69
+ | --- | --- |
70
+ | `post-quantum-check policy` | Display active `hybrid` or `cnsa2` baseline and CNSA 2.0 milestones |
71
+ | `post-quantum-check system` | Audit local OpenSSL, OpenSSH, Python, Node.js, and Go runtimes |
72
+ | `post-quantum-check tls <host...>` | Probe live TLS endpoints for TLS 1.3, `X25519MLKEM768`, and `AES-256-GCM` |
73
+ | `post-quantum-check ssh` | Audit `~/.ssh` public keys, SSH configs, and optional remote SSH host KEX |
74
+ | `post-quantum-check ssh-keygen` | Plan or create hybrid `mldsa44-ed25519` or `ed25519` SSH keys across OSes |
75
+ | `post-quantum-check scan [path]` | Statically scan code, reverse-proxy configs, and manifests for CBOM |
76
+ | `post-quantum-check audit [path]` | Run combined audit across system, SSH, codebase, and optional TLS hosts |
77
+
78
+ All audit commands support `--profile hybrid|cnsa2`, `--format terminal|text|json|markdown|cyclonedx|sarif`, `--output <file>`, `--no-color`, and `--fail-on low|medium|high|critical`.
79
+
80
+ ## Programmatic usage (Python)
81
+
82
+ ```python
83
+ from post_quantum_check import Profile, render_cyclonedx, run_audit
84
+
85
+ report = run_audit(path=".", profile=Profile.HYBRID, include_ssh=False)
86
+ cbom_json = render_cyclonedx(report)
87
+ print(report.readiness_score())
88
+ ```
89
+
90
+ ## License
91
+
92
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,27 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ Security updates are provided for the latest minor release on the `main` branch.
6
+
7
+ | Version | Supported |
8
+ | --- | --- |
9
+ | 0.1.x | Yes |
10
+
11
+ ## Reporting a vulnerability
12
+
13
+ Please do not open a public GitHub issue for security vulnerabilities.
14
+
15
+ Instead, report vulnerabilities privately through GitHub Security Advisories for `wkambale/post-quantum-check`. Include:
16
+
17
+ - Affected component (`post_quantum_check`, `packages/js`, `scripts/`, or `action.yml`)
18
+ - Steps to reproduce and potential security impact
19
+ - Suggested fix or mitigation, if available
20
+
21
+ We aim to acknowledge reports within 48 hours and publish coordinated fixes promptly.
22
+
23
+ ## Security invariants
24
+
25
+ - Audit commands are strictly read-only and never execute untrusted code from scanned repositories.
26
+ - Private key blocks, passphrases, and secret metadata are redacted from all findings and reports.
27
+ - Core packages ship with zero required third-party runtime dependencies.
@@ -0,0 +1,108 @@
1
+ from __future__ import annotations
2
+
3
+ from importlib.metadata import PackageNotFoundError
4
+ from importlib.metadata import version as _package_version
5
+
6
+ from post_quantum_check.audit import run_audit
7
+ from post_quantum_check.auditors import (
8
+ CommandResult,
9
+ CommandRunner,
10
+ SshHostProber,
11
+ SshHostProbeResult,
12
+ TlsProber,
13
+ TlsProbeResult,
14
+ audit_ssh,
15
+ audit_system,
16
+ audit_tls_endpoints,
17
+ scan_codebase,
18
+ )
19
+ from post_quantum_check.models import (
20
+ AuditReport,
21
+ CheckStatus,
22
+ CryptoAsset,
23
+ Finding,
24
+ Profile,
25
+ Severity,
26
+ Urgency,
27
+ redact_metadata,
28
+ redact_sensitive_text,
29
+ )
30
+ from post_quantum_check.policy import (
31
+ CNSA2_MILESTONES,
32
+ CNSA2_POLICY,
33
+ HYBRID_POLICY,
34
+ AlgorithmAssessment,
35
+ PolicySpec,
36
+ assess_algorithm,
37
+ get_policy,
38
+ parse_semver,
39
+ version_at_least,
40
+ )
41
+ from post_quantum_check.reporters import (
42
+ REPORT_FORMATS,
43
+ render_cyclonedx,
44
+ render_json,
45
+ render_markdown,
46
+ render_report,
47
+ render_sarif,
48
+ render_terminal,
49
+ )
50
+ from post_quantum_check.ssh_keygen import (
51
+ HARDENED_SSH_CONFIG_BLOCK,
52
+ HARDENED_SSHD_DROPIN,
53
+ SshKeygenPlan,
54
+ apply_ssh_keygen_plan,
55
+ build_ssh_keygen_plan,
56
+ render_ssh_keygen_plan,
57
+ )
58
+
59
+ try:
60
+ __version__ = _package_version("post-quantum-check")
61
+ except PackageNotFoundError:
62
+ __version__ = "0.1.0"
63
+
64
+ __all__ = [
65
+ "CNSA2_MILESTONES",
66
+ "CNSA2_POLICY",
67
+ "HARDENED_SSHD_DROPIN",
68
+ "HARDENED_SSH_CONFIG_BLOCK",
69
+ "HYBRID_POLICY",
70
+ "REPORT_FORMATS",
71
+ "AlgorithmAssessment",
72
+ "AuditReport",
73
+ "CheckStatus",
74
+ "CommandResult",
75
+ "CommandRunner",
76
+ "CryptoAsset",
77
+ "Finding",
78
+ "PolicySpec",
79
+ "Profile",
80
+ "Severity",
81
+ "SshHostProbeResult",
82
+ "SshHostProber",
83
+ "SshKeygenPlan",
84
+ "TlsProbeResult",
85
+ "TlsProber",
86
+ "Urgency",
87
+ "__version__",
88
+ "apply_ssh_keygen_plan",
89
+ "assess_algorithm",
90
+ "audit_ssh",
91
+ "audit_system",
92
+ "audit_tls_endpoints",
93
+ "build_ssh_keygen_plan",
94
+ "get_policy",
95
+ "parse_semver",
96
+ "redact_metadata",
97
+ "redact_sensitive_text",
98
+ "render_cyclonedx",
99
+ "render_json",
100
+ "render_markdown",
101
+ "render_report",
102
+ "render_sarif",
103
+ "render_ssh_keygen_plan",
104
+ "render_terminal",
105
+ "run_audit",
106
+ "scan_codebase",
107
+ "version_at_least",
108
+ ]
@@ -0,0 +1,6 @@
1
+ from __future__ import annotations
2
+
3
+ from post_quantum_check.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())
@@ -0,0 +1,82 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Sequence
4
+ from importlib.metadata import PackageNotFoundError
5
+ from importlib.metadata import version as _package_version
6
+ from pathlib import Path
7
+
8
+ from post_quantum_check.auditors.codebase import scan_codebase
9
+ from post_quantum_check.auditors.ssh import SshHostProber, audit_ssh
10
+ from post_quantum_check.auditors.system import CommandRunner, audit_system
11
+ from post_quantum_check.auditors.tls import TlsProber, audit_tls_endpoints
12
+ from post_quantum_check.models import AuditReport, CryptoAsset, Finding, Profile
13
+
14
+
15
+ def _tool_version() -> str:
16
+ try:
17
+ return _package_version("post-quantum-check")
18
+ except PackageNotFoundError:
19
+ return "0.1.0"
20
+
21
+
22
+ def run_audit(
23
+ *,
24
+ path: Path | str | None = None,
25
+ hosts: Sequence[str] = (),
26
+ profile: Profile = Profile.HYBRID,
27
+ include_system: bool = True,
28
+ include_ssh: bool = True,
29
+ include_scan: bool = True,
30
+ ssh_dir: Path | None = None,
31
+ ssh_host: str | None = None,
32
+ ssh_port: int = 22,
33
+ tls_timeout: float = 8.0,
34
+ ca_file: str | None = None,
35
+ runner: CommandRunner | None = None,
36
+ tls_prober: TlsProber | None = None,
37
+ ssh_prober: SshHostProber | None = None,
38
+ tool_version: str | None = None,
39
+ ) -> AuditReport:
40
+ """Run an aggregated multi-layer PQC readiness audit across system, SSH, TLS, and code."""
41
+ findings: list[Finding] = []
42
+ assets: list[CryptoAsset] = []
43
+
44
+ if include_system:
45
+ sys_findings, sys_assets = audit_system(profile=profile, runner=runner)
46
+ findings.extend(sys_findings)
47
+ assets.extend(sys_assets)
48
+
49
+ if include_ssh:
50
+ ssh_findings, ssh_assets = audit_ssh(
51
+ profile=profile,
52
+ ssh_dir=ssh_dir,
53
+ host=ssh_host,
54
+ port=ssh_port,
55
+ runner=runner,
56
+ host_prober=ssh_prober,
57
+ )
58
+ findings.extend(ssh_findings)
59
+ assets.extend(ssh_assets)
60
+
61
+ if hosts:
62
+ tls_findings, tls_assets = audit_tls_endpoints(
63
+ hosts,
64
+ profile=profile,
65
+ timeout=tls_timeout,
66
+ ca_file=ca_file,
67
+ prober=tls_prober,
68
+ )
69
+ findings.extend(tls_findings)
70
+ assets.extend(tls_assets)
71
+
72
+ if include_scan and path is not None:
73
+ scan_findings, scan_assets = scan_codebase(path, profile=profile)
74
+ findings.extend(scan_findings)
75
+ assets.extend(scan_assets)
76
+
77
+ return AuditReport(
78
+ tool_version=tool_version or _tool_version(),
79
+ profile=profile,
80
+ findings=findings,
81
+ assets=assets,
82
+ )
@@ -0,0 +1,41 @@
1
+ from __future__ import annotations
2
+
3
+ from post_quantum_check.auditors.codebase import scan_codebase
4
+ from post_quantum_check.auditors.ssh import (
5
+ SshHostProber,
6
+ SshHostProbeResult,
7
+ audit_ssh,
8
+ evaluate_ssh_host_probe,
9
+ parse_ssh_kexinit_payload,
10
+ probe_ssh_host,
11
+ )
12
+ from post_quantum_check.auditors.system import (
13
+ CommandResult,
14
+ CommandRunner,
15
+ audit_system,
16
+ )
17
+ from post_quantum_check.auditors.tls import (
18
+ TlsProber,
19
+ TlsProbeResult,
20
+ audit_tls_endpoints,
21
+ evaluate_tls_probe,
22
+ parse_host_target,
23
+ )
24
+
25
+ __all__ = [
26
+ "CommandResult",
27
+ "CommandRunner",
28
+ "SshHostProbeResult",
29
+ "SshHostProber",
30
+ "TlsProbeResult",
31
+ "TlsProber",
32
+ "audit_ssh",
33
+ "audit_system",
34
+ "audit_tls_endpoints",
35
+ "evaluate_ssh_host_probe",
36
+ "evaluate_tls_probe",
37
+ "parse_host_target",
38
+ "parse_ssh_kexinit_payload",
39
+ "probe_ssh_host",
40
+ "scan_codebase",
41
+ ]